Re: schtasks



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
.



Relevant Pages

  • RE: Remote Desktop (vncviewer)? (WAS: Remote X server login)
    ... Subject: Remote Desktop? ... (WAS: Remote X server login) ... connect my vncserver without problem. ...
    (Fedora)
  • schtasks
    ... run a batch file to start a test. ... but since I discover the schtasks command, now I can use a simple batch file ... However I also discovered that if the remote machines were already login ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Re: an issue related to remote desktop
    ... fails to login in and reset the password to empty. ... tried to find a way deleting the computer name from remote desktop ... What version of the Remote Desktop client? ... My remote desktop client (RTC) is 6.0.6000.16386. ...
    (microsoft.public.windowsxp.basics)
  • Re: M$ Users Learn About Remote Login
    ... >>Windows users have learned that they can login to remote ... >>You can use it to actually login to your computer at work ... > Big deal, You can do this for free, called Remote Desktop in XP Pro. ...
    (comp.os.linux.misc)
  • Re: Controlling Music from a remote PC
    ... I followed Michaels step by steps and I fail to login because of 'account ... I am trying to login on to the remote PC with the same name that I am ... >> I tried using Remote Desktop but that causes the music to play on the PC ... >> accessing the XPMC machine, ...
    (microsoft.public.windows.mediacenter)

Loading