Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Shell 

Batch Sleep/Wait Command [Add-On]

Hey Guys,

Just a quick application I made in pascal to allow you to use a 'Sleep' command within batch, to use it simply add

Code
sleep <milliseconds>

into your code, and make sure the file is kept in the directory that you are running the batch file from, or added to the system32 of the computer running the batch file, you could also package your batch into an EXE using 'BatchToExe Converter' and add the 'sleep.com' file to the includes when you compile so that it will be extracted and usable at runtime.

Here is an example script:
Code
@echo off
set /a count=0
:loop
cls
echo %count%
sleep 1000
set /a count=%count%+1
goto loop

Here is a link to the Sleep file

Here is the virus scan (Click to View)
Here is a link to the virus scan

Here is a link to 'Batch to Exe'

Hope this is of some use to people, as I remember wishing I could do this back when I used Batch.

Regards,

UndrGrnd (AKA Logic_Bomb)
ping -n seconds localhost > nul is very close... maybe not as accurate. I don't see the need to download an extra command as well as force people to download the command in order to use my script...
[Image: 8vvxbk8.jpg]
Meh, I didn't like using ping, it's inaccurate for long periods of time, it also lacks the capability of using milliseconds.
I do understand what you mean, but batch plug-ins have always existed and it's down to the script writer as to whether they think using an external plug-in is function they need/want or not.

You don't have to use it if you don't want to and you can feel free to re-distribute it zipped with you batch files if you wish, or, you might want to use 'batch to exe' and add the file as an include, this way nobody has to extract/download anything. =)

Regards,

UndrGrnd.
I use this same method to sleep my batch files, but there is no reason to call a separate file, use this in your file, example script below.

Code
@echo off
:: Put your commands here...
Echo this is calling sleep, with a parameter
Echo The syntax is Call :Sleep Parameter [ you have to call the label with the colon before it]
Echo Also, any label you call like this needs to end in Goto :EOF
Echo the paramater is not equal is seconds, only the amount of loops.
Echo You will have to time and find numbers that are equal to your delay.
Echo This is so much better than using Ping.exe
Echo The ping command will be detected by firewalls, like Comodo.
Echo Also, the ping.exe will be in the task manager.
Echo Important, having echo on will make the delay way longer..
Echo.

Echo example script below.
start notepad|Start notepad|Start Notepad
call :Sleep 10000
Echo Back from sleeping....
start notepad|Start notepad|Start Notepad
call :Sleep 10000
Echo Back from sleeping....
start notepad|Start notepad|Start Notepad
echo Random Sleep Delay
Call :Sleep %random:~0,4%
:: True End of File is Here.
Goto :EOF

:Sleep
Set "_Res=0"
:Resume
Set /A "_Res=%_Res%+1"
If %_Res% Leq %1 Goto Resume
Goto :Eof
::--



Possibly Related Threads...
Thread / Author Replies Views Last Post
[Shell] by Robert RougeSep 24, 2026 10:02 AM 4 219 Sep 24, 2026 10:02 AM
Last Post: Anonynuk
[Shell] by ɩᴄᴀʀᴜȿ ᴌוᴠᴇѕ™Sep 24, 2026 09:37 AM 3 61 Sep 24, 2026 09:37 AM
Last Post: Anonynuk
[Python] by iRazorOct 15, 2021 12:35 PM 3 157 Oct 15, 2021 12:35 PM
Last Post: steel iron