arunykand
asked on
Batch file - wait time
Hi,
I need to create a batch file that needs to have two commands in there, but it has to wait for the first command to finish before executing the second command. I know I can probably put a sleep statement in-between the two, but I cannot be certain that my 'sleep' will always be the same.
Here are the two commands that I need in the batch file
Thank you!
I need to create a batch file that needs to have two commands in there, but it has to wait for the first command to finish before executing the second command. I know I can probably put a sleep statement in-between the two, but I cannot be certain that my 'sleep' will always be the same.
Here are the two commands that I need in the batch file
ewfmgr c: -commitanddisable -live
ewfmgr c: -enable
Thank you!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Here's the whole thing.
First does -commitanddisable.
Then loops until the device shows DISABLED status.
Then enables it.
Then waits for user to type any key to close the window.
First does -commitanddisable.
Then loops until the device shows DISABLED status.
Then enables it.
Then waits for user to type any key to close the window.
ewfmgr c: -commitanddisable -live
@:waitForDisabled
@sleep 1
@ewfmgr c: |findstr DISABLED >nul:
@if ERRORLEVEL 1 goto waitForDisabled
ewfmgr c: -enable
@pause
ASKER
Great, thanks!
ASKER
Thanks