Computing.Net > Forums > Programming > Schedule task to run after 2 minute

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Schedule task to run after 2 minute

Reply to Message Icon

Name: eesa
Date: January 5, 2009 at 05:13:35 Pacific
OS: Windows Server 2003
CPU/Ram: Xeon - 2G
Product: Intel / Xeon(tm) cpu 3.20ghz
Subcategory: Batch
Comment:

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,



Sponsored Link
Ads by Google

Response Number 1
Name: Holla
Date: January 5, 2009 at 21:28:56 Pacific
Reply:

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.


0

Response Number 2
Name: eesa
Date: January 5, 2009 at 22:42:27 Pacific
Reply:

I'll try it. Thank you very very very VERY much


0

Response Number 3
Name: eesa
Date: January 5, 2009 at 22:53:57 Pacific
Reply:

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.


0

Response Number 4
Name: Holla
Date: January 6, 2009 at 02:24:07 Pacific
Reply:

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.


0

Response Number 5
Name: eesa
Date: January 6, 2009 at 03:51:37 Pacific
Reply:

You are the HERO!
Thank you Holla, you did help me very much.


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Schedule task to run after 2 minute

Scheduled Tasks and VBS Scripts www.computing.net/answers/programming/scheduled-tasks-and-vbs-scripts/18801.html

batch file to set in schedule task www.computing.net/answers/programming/batch-file-to-set-in-schedule-task/14751.html

Program an event to run auto daily www.computing.net/answers/programming/program-an-event-to-run-auto-daily/6166.html