Computing.Net > Forums > Windows NT > Script commands

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.

Script commands

Reply to Message Icon

Name: Ken
Date: May 10, 2001 at 22:02:11 Pacific
Comment:

Hi

I need to insert a 2 second delay between commands in a *.bat file. Can anyone help me and also where can I get a list of all the commands and syntax?

Thanks

Ken



Sponsored Link
Ads by Google

Response Number 1
Name: b
Date: May 11, 2001 at 19:11:05 Pacific
Reply:

try adding REM statments inbetween commands


0

Response Number 2
Name: Fabien
Date: May 14, 2001 at 05:19:23 Pacific
Reply:

Forget REM.
In the Resource Kit of windows NT, there is a small tool, TIMEOUT.exe.
Copy it in the same folder as your batch file.
In your BAT file, add:
TIMEOUT 2


0

Response Number 3
Name: Perry
Date: May 14, 2001 at 07:22:17 Pacific
Reply:

Another option from the Res kit it sleep.


If you do not have the res kit go to this link
http://www.uwasa.fi/~ts/http/http2.html#batch


grab the faq file tsbat67.zip

# 44 lists how to make a sleep command.

For those interested here is a list of what he covers in the FAQ:

1) How can I make "@echo off" MS-DOS version independent?
2) Deleting all files without being prompted "Are you sure (Y/N)?"
3) Is it possible to nest for loops in batch files?
4) How can I check in a batch whether a directory exists?
5) Checking that a program is available at the current directory or at path
6) Is it possible to use subroutines and recursion in batches?
7) How can I convert a lowercase parameter to uppercase?
8) Is there an easy way to append a new directory to the path?
9) How can I compare if two files are identical?
10) Writing an empty line to the screen. How is that done?
11) A tip: Customizing the pause message
12) A tip: Complicated renaming of files with for
13) How can I check if the file name given included wildcards?
14) Is it possible to prevent the user from breaking the batch?
15) Can I prevent a break from bypassing the autoexec.bat?
16) How can I extract the extension of a file name?
17) Information on the quote character %
18) Eliminating auxiliary batches (making do with the main batch)
19) Utilizing the subst command in paths
20) How can I run a batch once a week (testing for the weekday)
21) How can I test if a given file name includes the path?
22) How can I display the time without having to press enter?
23) Alternatives for testing for the errorlevel value
24) About redirecting a batch file's output
25) How can I test if my batch has sufficient environment space?
26) Is there a simple trick to "disable" or hide a drive?
27) How can I send an escape sequence to the printer?
28) Is it possible to create a random string in a batch?
29) Is it possible in a batch to find out the length of a string?
30) How to obtain the MS-DOS version into an environment variable?
31) How can I find out the number of regular files on a drive?
32) How can I use a batch to augment line numbers to my text file?
33) Storing and returning to the original directory (push and pop)
34) Enticing the current date into an environment variable
35) A tip for power users. Identifying the individual PC.
36) For loop and redirection quirks
37) Is it possible to traverse a directory tree with a batch?
38) Is it possible to echo the redirection symbol in a batch?
39) How can I extract the file basename?
40) A batch to put user input into an environment variable
41) How can I get the last replaceable parameter given to a batch?
42) Creating an empty file if the file does not already exist
43) How can I change or remove the disk volume serial number?
44) How to pause in a batch for a preset number of seconds?
45) Where can I find a program to compile batches into COMs or EXEs?
46) How can I test whether a disk is empty or not?
47) How can I run a different batch depending on the weekday?
48) Can one put line numbers into a file with just batch commands?
49) How can I backup from the current directory files made today?
50) How can I traverse all files of a directory in a batch?
51) How can I step through a batch a command at a time to debug it?
52) How to display all files made or updated on a day or today?
53) How can I make a list of all my files and locate a certain file?
54) How can I tell if a batch is running in a Windows dosbox?
55) How can I test if there is a disk in a floppy disk drive?
56) Could you please solve this problem for me with a batch?
57) How can I make a loop that is repeated a preset number of times?
58) How can I display the contents of the memory?
59) How get today's date into a six-character environment variable?
60) How can I find and copy the files updated today in a directory?
61) How can I test in a batch whether a TSR program has been loaded?
62) Putting the current drive letter into an environment variable.
63) How can I extract the drive letter from a full file path?
64) How can I write a "SLEEP" command to pause for a certain time?
65) How can put comments into a batch file?
66) How can I echo just the word "off" in a batch file?
67) How can I extract the first two characters of a file name?
68) How can I compare two numbers with batch commands?
69) All these solutions are for wimps. Why not rather use 4DOS?
70) How can I give more than the nine parameters to a batch?
71) How can I update copy files from one directory to another?
72) How can I best clear all the files from my TEMP directory?
73) How can I check the number of parameters given to a batch?
74) How can I locate and e.g. delete all *.TMP files on a drive?
75) How can I rename all files sequentially in a directory?
76) How to search all the *.txt files on a drive for a word?
77) How can I give multiple commands on one line?
78) Is there a batch to individually zip each file in a directory?
79) A batch to substitute a string through a set of text files?
80) Where do I find a good book or WWW page on batch programming?
81) How to read a file's date and time into environment variables?
82) How would I get a beep in a batch file?
83) Y2K: My old BIOS gives a wrong year at boot. How can I fix it?
84) Is there a batch to drop the first letter of a file name?
85) How do I close the command window once my batch file has run?
86) Is MS-DOS batch programming going to die along with W2K?
87) How can I test for the existence of a substring in a string?
88) How can I put MS-DOS FIND results into an environment variable?
89) How to get months as letters and years in four digits in DIR?
90) Isn't MS-DOS dead with W2K? So why bother with MS-DOS batches?
91) How can I exit the called batch without returning to the first?
92) How do I create a sequence of directories from 1 to MaxValue?
93) How do I add +1 to a variable in a batch?
94) How to copy the errorlevel into a variable in a batch?
95) How can I test for a zero byte file?
96) How to show the last N lines of a file using DOS batch files?
97) How do I get the path of a file located somewhere on my disk?
98) How to read a file's attributes into environment variables?
99) Is it possible to echo without linefeed like the Unix echo -n?
100) How can I detect the F1-F10 function keys in a batch?
101) How can I get the free size and total size of a drive?
102) How can I search for a string through a directory of files?
103) How do I find the largest numeric extension and add +1 to it?
104) How do I run the latest executable from the default directory?
105) How can I determine if ANSI.SYS is loaded?
106) How do I get the last drive into an environment variable?
107) How can I calculate the number of lines in a file?
108) Is it possible to save and later restore the command history?


0

Response Number 4
Name: Bola
Date: April 8, 2002 at 01:11:06 Pacific
Reply:

Another useful way to pause/sleep/wait in NT is to ping the loop back address.
This example will give you a wonderful 10 seconds break.

Ping -l 1 -n 10 127.1.1.1 >nul



0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Windows NT Forum Home


Sponsored links

Ads by Google


Results for: Script commands

Login Script Command www.computing.net/answers/windows-nt/login-script-command/22276.html

Logon Script Command www.computing.net/answers/windows-nt/logon-script-command/11267.html

NT Logon Script www.computing.net/answers/windows-nt/nt-logon-script/1645.html