Re: For Function with Pipe Problem.
From: Paul R. Sadowski (xpert_at_mailshell13.mailshell.com)
Date: 03/24/04
- Next message: Marty List: "Re: For Function with Pipe Problem."
- Previous message: BaKaR: "Re: For Function with Pipe Problem."
- In reply to: BaKaR: "For Function with Pipe Problem."
- Next in thread: BaKaR: "Re: For Function with Pipe Problem."
- Reply: BaKaR: "Re: For Function with Pipe Problem."
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 24 Mar 2004 09:38:05 -0500
If I try to run kernrate from the system account I get:
RtlAdjustPrivilege(SE_PROFILE_PRIVILEGE) failed: c0000061
Try running it under anadmin account.
"BaKaR" <bakar@metro-cc.DnotSpamMe.hr> wrote in message
news:c3rsov$3ea$1@brown.net4u.hr...
> Hi!
> I have a problem with a *.cmd batch script.
> If i run it "on click" it is working, but if i run it with "schtasks.exe"
> and "system" user (in background) its not running one of
> the two for functions:
>
>
> @echo off
>
> for /f "tokens=2" %%i in ('tasklist ^| findstr /i aplication') do (
> echo %date% %time% Info.PID: %%i >> file.log
>
> for /f "tokens=4" %%k in ('kernrate -p %%i -s 2 ^| findstr /C:"User
> Time"') do (
> echo %date% %time% Info.CPU: %%k >> file.log
>
> if %%k GTR 40.0% (
> echo %date% %time% "CPU OverUse Positive ( %%k )" >> file.log
> call taskkill /pid %%i /F
> )
> echo Out_1 >> file.log
> )
> echo Out_2 >> file.log
> )
> echo %date% %time% "Finished!" >> file.log
>
> So, the problem is happening in for function where i use kernrate and
> findstr. If i run the batch "on click", everything is working
> well, but if im using schtasks.exe with system user that part of the batch
> is skipped (also, i cant see echo Out_1) ?! or something,
> cauze i cant see its run, every echo i set in front, or after is initiated
> (again, except Out_1).
>
> Any ideas ?
>
> Thank You,
>
>
> *. Remove: "DnotSpamMe" When R_ing.
>
>
- Next message: Marty List: "Re: For Function with Pipe Problem."
- Previous message: BaKaR: "Re: For Function with Pipe Problem."
- In reply to: BaKaR: "For Function with Pipe Problem."
- Next in thread: BaKaR: "Re: For Function with Pipe Problem."
- Reply: BaKaR: "Re: For Function with Pipe Problem."
- Messages sorted by: [ date ] [ thread ]