Re: schtasks
- From: Jerold Schulman <Jerry@xxxxxxxxxx>
- Date: Mon, 10 Oct 2005 08:17:04 -0400
On Mon, 10 Oct 2005 11:57:08 +0100, "Kok Yong Lee" <lkoky@xxxxxxxxxxx> wrote:
>Hi there,
>
>I used to have to use Remote Desktop to login to various test machine and
>run a batch file to start a test.
>
>but since I discover the schtasks command, now I can use a simple batch file
>like below from my machine to kick start the test on various machines.
>However I also discovered that if the remote machines were already login
>then the running the following batch file does nothing at all. By login I
>mean one either goto the remote machine physically login and leave or login
>via Remote Desktop and end the session (without logoff from it).
>
>Any ideas why this behaviour?
>
>
>
>----------
>@echo off
>set machines=^
> CAMASM2 ^
> CAMASM3 ^
> CAMASM4 ^
> CAMASM5 ^
>
>REM
>REM Fisrt make sure there is such a schedule task on the remote mahcine
>REM
>for %%i in (%machines%) do (
> schtasks /query /s %%i | findstr /i /c:"asmversiontest" 1>nul
> if ERRORLEVEL 1 (
> echo %%i does not have schedule task
> schtasks /create /s %%i /tn ASMDebugTest /tr
>"z:\scripts\asmversiontest.bat" /sc once /st 06:00:00
> ) else (
> echo %%i has schedule task
> )
> schtasks /run /s %%i /tn ASMVersionTest
>)
>
Using the following syntax, I cannot recreate your experience. It works for me.
schtasks /Create /S \\JSI009 /U JSIINC\Jerry /P password /RU Administrator /RP password /SC ONLOGON /TN DefragD /TR C:\UTIL\DefragD.bat
Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com
.
- Follow-Ups:
- Re: schtasks
- From: Kok Yong Lee
- Re: schtasks
- References:
- schtasks
- From: Kok Yong Lee
- schtasks
- Prev by Date: Re: Re: catching output from schtasks
- Next by Date: Re: schtasks
- Previous by thread: schtasks
- Next by thread: Re: schtasks
- Index(es):
Relevant Pages
|
Loading