Duelus Posted August 9, 2006 Share Posted August 9, 2006 Is it possible to have a batch file run a command run a command 2 seconds into the future? argh, what I really need to do is have a batch file run a scheduled at command but schedule it in a minute with out any user input of what time it is? possibly using the time command? do you get what I'm saying, I'm very frustrated. Quote Link to comment Share on other sites More sharing options...
Dr Zaius Posted August 9, 2006 Share Posted August 9, 2006 I'm not sure how accurate scheduling a task to run 2 seconds into the future will be. I remember back in the days of 9x there used to be a "choice" command that I used for delays, don't think it's around anymore. I don't know of any built-in commands specifically for waiting but you can grab the sleep.exe from the Windows Resource Kit which is for exactly what you want, waiting for a certain number of seconds in batch files: http://www.microsoft.com/downloads/details...;displaylang=en I have also been told that a nice workaround is to use ping, pinging the loopback a certain number of times. You see the first ping is sent immediately and then theres a one second delay before the second one is sent, so you could make your script wait two seconds with something like: ping -n 3 127.0.0.1 EDIT: Re-reading your post this might not be quite what you want, you want to schedule a command to run 2 seconds in the future but then have the rest of the script continue to run? Perhaps if you explain the context this is being used in it may help. Quote Link to comment Share on other sites More sharing options...
rFayjW98ciLoNQLDZmFRKD Posted August 9, 2006 Share Posted August 9, 2006 The sleep command http://www.ss64.com/nt/sleep.html Quote Link to comment Share on other sites More sharing options...
Duelus Posted August 9, 2006 Author Share Posted August 9, 2006 I pretty much figured out what I was trying to accomplish wasn't to scriptable so I found another way if anyones intrested: sc delete testsvc TASKKILL /F /IM "explorer.exe" sc create testsvc binpath= "cmd /K start" type= own type= interact sc start testsvc del admin.bat all you have to type is explorer.exe works perfectly at school for gaining SYSTEM Quote Link to comment Share on other sites More sharing options...
barrytone Posted August 9, 2006 Share Posted August 9, 2006 If you get the Windwows 2003 Resource kit tools there is a sleep command... Use it as follows... sleep 60 To wait 60 seconds sleep -m 40 To wait 40 milliseconds Quote Link to comment Share on other sites More sharing options...
tonysathre Posted August 10, 2006 Share Posted August 10, 2006 Your admin must be pretty foolish if he lets students use the console. Quote Link to comment Share on other sites More sharing options...
Sparda Posted August 10, 2006 Share Posted August 10, 2006 Your admin must be pretty foolish if he lets students use the console. Why? The console isn't dangerus, it's windows it's self that is dangerus. Any admin that disables command prompt thinking it's making there computers more secure is a fool. Quote Link to comment Share on other sites More sharing options...
armadaender Posted August 11, 2006 Share Posted August 11, 2006 Your admin must be pretty foolish if he lets students use the console. Why? The console isn't dangerus, it's windows it's self that is dangerus. Any admin that disables command prompt thinking it's making there computers more secure is a fool. Absolutly true. At work the admin and I were discussing the security precations she's implimented and as soon as she noted that cmd wasn't accessable, I turned around and performed the txt file trick to gain cmd then the 'kill explorer.exe...' trick, gained system and showed her that the entire network was obtainable from my 'temp' workstation. Absolutly loved the frown on her face. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.