|
-
use a double ampersands && in between the commands
so;
Net stop "dns client" && Net start "dns client"
more examples;
FORMAT A: /Q && COPY C:\DATA\*.* A:
will copy all files from C:\DATA to diskette IF and ONLY IF the format succeeds.
XCOPY C:\*.* D:\ /S 2>&1> NUL ¦¦ ECHO Something terrible happened
will display your own custom error message if XCOPY fails
the double pipes || is used to Execute command2 only if execution of command1 has finished unsuccessfully
Source
or even perhaps the Start /wait switch (which can be used with TIME)
Delete the Electoral College - Support
www.NationalPopularVote.com
"The world according to DRM Bozos"
I am a consumer, I'll buy anything
I am a sheep, I am cattle, I follow the herd
I am ignorant, a dumbass, and I am a bozo...
I am the epitome of the 'rank and file'
I am your next door neighbor
I am 95% of American Consumers
I will consume you
- If the light in your head hasn't come on yet,
I suggest you go get a new bulb!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|