Schedule task to run after 2 minute

Intel / Xeon(tm) cpu 3.20ghz
January 5, 2009 at 05:13:35
Specs: Windows Server 2003, Xeon - 2G
Hi all,
I need to run vbscipt located on another server from my server after 2 minutes from (now), it is preferred to run that script at the CMD in my server.
Thank you all,

See More: Schedule task to run after 2 minute

Report •


#1
January 5, 2009 at 21:28:56
This batch file (after.bat) executes the command
supplied in parameters after n seconds.
You invoke it like "after 120 d:\dir\vbscrip.vbs"

@echo off
if "%1"=="" goto error
set /a seconds=%1
if %seconds% leq 0 goto InvalidNumber
echo After %seconds% seconds, launching %2 %3 %4 %5 %6 %7 %8 %9

ping -n %seconds% 127.0.0.1 > nul
start %2 %3 %4 %5 %6 %7 %8 %9
goto exit
:InvalidNumber
Echo Error! Non numeric or too huge a time interval.
goto exit
:error
Echo Usage example:
echo %0 120 Notepad
echo - will launch Notepad after approximately 120 seconds
echo.
echo %0 12*60 Notepad
echo - will launch Notepad after approximately 12 minutes
:exit

--
Holla.


Report •

#2
January 5, 2009 at 22:42:27
I'll try it. Thank you very very very VERY much

Report •

#3
January 5, 2009 at 22:53:57
You are my hero. Would you help me in some thing else.. I need it to run a (task) after 120 sec without needing to type any thing, I mean double clicking the batch becomes very enough to do all the task. Consider that task as another batch file placed in system32. Thanks again.

Report •

Related Solutions

#4
January 6, 2009 at 02:24:07
Just right click on your desktop and create a new shortcut.
enter the command as "d:\directory-where-the-batchfile-is\after.bat 120 whatever.your.commmand.here"

--
Holla.


Report •

#5
January 6, 2009 at 03:51:37
You are the HERO!
Thank you Holla, you did help me very much.

Report •


Ask Question