Use Local System for scheduled tasks?

  • Thread starter Thread starter Allan Cady
  • Start date Start date
A

Allan Cady

Is it possible, using the Task Scheduler, to schedule a script (.vbs)
to run as Local System?
 
The simplest way to do this is to schedule your task with
at.exe. All such tasks run under the System account.

at 10:05 /every:m,w,f c:\tools\Allan.bat
 
Yes, I knew about that option, but I need to schedule something to run
every two minutes, indefinitely. As far as I can tell, "at" can't do
that. (Why it wasn't built to be able to do that is a bit puzzling to
me.)

So would the answer to my original question be "no"?
 
at.exe can indeed run a job every 2 minutes! Simply run this
command from the Command Prompt:

for /L %h in (0,1,23) do for /L %m in (0,2,59) do
at.exe %h:%m /every:m,t,w,th,f,s,su c:\tools\Allan.bat
(unwrap line)

This will generate 720 jobs! To delete them, issue this command:

for /L %a in (1,1,720) do at.exe %a /d

A more elegant method might be to schedule just one job, and
to re-run it once every two minutes. Here are a couple of ways
of achieving this. In each case you schedule the batch file
"c:\Tools\Allan.bat" to run exactly once:

"Allan.bat"
========
@echo off
:again
c:\tools\SomeTask.exe
ping localhost -n 120 > nul
goto again

"Allan.bat"
========
@echo off
c:\tools\soon.exe 120 c:\tools\Allan.bat
c:\tools\SomeTask.exe

soon.exe comes with the Win2000 Resource Kit.
 
Thanks for all the useful info... I'll see if one of those
alternatives will do the job.

But... I'm still looking for an answer to my original question!

"Is it possible, using the Task Scheduler, to schedule a script... to
run as Local System?"

Thanks,

Allan
 
Back
Top