Solved how do i run a batch file every 20 mins without Task Schedul

May 18, 2013 at 05:06:20
Specs: Windows 7
I need to run a batch file every 20mins on strip down WindowsNT machine that doesnt have Task Scheduler on it. Is there a way to do it?

See More: how do i run a batch file every 20 mins without Task Schedul

Report •


✔ Best Answer
May 18, 2013 at 21:00:06
Yeah, I know. If you had done it yourself, it'd be sane looking. Like this:
Const sleepTime = 20 * 60 * 60000
Set shell = CreateObject("Wscript.Shell")
Do While True
  WScript.Sleep sleepTime
  WshShell.Popup "PLEASE CHECK ALL GET ARE INTACT. IF MISSING REPORT IMMEDIATLY. THIS MESSAGE WILL SELF DISTRUCT IN 10s'." ,10 ,"CHECK GET Click OK!", 0
Loop
Note: I'm not sure which version of the VBScript engine your WinNT box has. For a while, the engines were released with Internet Explorer. It wasn't until Win2K that VBScripts were guaranteed to actually run, and WScript.Sleep wasn't included until version 2.0.

How To Ask Questions The Smart Way



#1
May 18, 2013 at 05:36:25
How about the "at" command. Does that work?

Report •

#2
May 18, 2013 at 06:24:01
AT is just a CLI interface for Task Scheduler. Probably the best solution is to write a program that sleeps for 20 minutes, runs the script, then loops.

How To Ask Questions The Smart Way


Report •

#3
May 18, 2013 at 14:39:09
AT is just a CLI interface for Task Scheduler. Probably the best solution is to write a program that sleeps for 20 minutes, runs the script, then loops.
______________________________________________________________________

I am a novice at this, I have only just started writing batch files. Can you give me anymore info on how to do that or provide a link on the process?

Cheers,
______________________________________________________________________
MORE INFO
I have a batch file that runs as follows;

echo set WshShell = WScript.CreateObject("WScript.Shell") > %tmp%\tmp.vbs
echo WScript.Quit (WshShell.Popup( "PLEASE CHECK ALL GET ARE INTACT. IF MISSING REPORT IMMEDIATLY. THIS MESSAGE WILL SELF DISTRUCT IN 10s'." ,10 ,"CHECK GET Click OK!", 0)) >> %tmp%\tmp.vbs
cscript /nologo %tmp%\tmp.vbs
if %errorlevel%==1 (
echo You Clicked OK
) else (
echo The Message timed out.
)
del %tmp%\tmp.vbs

The idea is to remind the operator to make a check.


Report •

Related Solutions

#4
May 18, 2013 at 18:20:31
All good i researched it out as follows;
______________________________________________________________________
echo off
echo set WshShell = WScript.CreateObject("WScript.Shell") > %tmp%\tmp.vbs
echo WScript.Quit (WshShell.Popup( "PLEASE CHECK ALL GET ARE INTACT. IF MISSING REPORT IMMEDIATLY. THIS MESSAGE WILL SELF DISTRUCT IN 12s'." ,12 ,"CHECK GET Click OK!", 0)) >> %tmp%\tmp.vbs
cscript /nologo %tmp%\tmp.vbs
if %errorlevel%==1 (
echo You Clicked OK
) else (
echo The Message timed out.
)
del %tmp%\tmp.vbs
ping 127.0.0.1 -n 1200 > nul
start Hide.bat.vbs
del %tmp%\tmp.vbs
______________________________________________________________________

Then created a hide.bat.vbs with the following code;

CreateObject("Wscript.Shell").Run "name_me.bat",0,True

Insert name off bat file here "name_me.bat",

This will hide the CMD and just pop up the message.
I put the Hide.bat.vbs file into "Startup" folder in All Programs so it will launch on i start up the PC

This worked exactly the way i wanted it to on my Win 7 laptop the next test will be on the WinNT machine.

I take no credit for this. I got what i was after from a bunch of different Forums.

Happy Days..........


Report •

#5
May 18, 2013 at 21:00:06
✔ Best Answer
Yeah, I know. If you had done it yourself, it'd be sane looking. Like this:
Const sleepTime = 20 * 60 * 60000
Set shell = CreateObject("Wscript.Shell")
Do While True
  WScript.Sleep sleepTime
  WshShell.Popup "PLEASE CHECK ALL GET ARE INTACT. IF MISSING REPORT IMMEDIATLY. THIS MESSAGE WILL SELF DISTRUCT IN 10s'." ,10 ,"CHECK GET Click OK!", 0
Loop
Note: I'm not sure which version of the VBScript engine your WinNT box has. For a while, the engines were released with Internet Explorer. It wasn't until Win2K that VBScripts were guaranteed to actually run, and WScript.Sleep wasn't included until version 2.0.

How To Ask Questions The Smart Way


Report •

#6
May 18, 2013 at 22:58:38
Thanks Razor2.3,

I have a support guy that knows this particular NT system very well. I'll contact him tomorrow with what I have and your comments and he will straighten it out for me. Thanks for your time.

Cheers,


Report •

Ask Question