Computer Hope
Software => Computer programming => Topic started by: Sebastian42 on April 21, 2024, 06:26:14 AM
-
Two versions of a batch file and their results :
Start "" "C:\Program Files\ToggleTaskbarAutohide\ToggleTaskbarAutohide.exe"
Start "" "C:\Program Files\Macro Express Pro 6\MeProc.exe" /ASaveDeskTopView
Start "" "C:\Program Files\ToggleTaskbarAutohide\ToggleTaskbarAutohide.exe"
The third line takes effect before the second is finished.
Start "" "C:\Program Files\ToggleTaskbarAutohide\ToggleTaskbarAutohide.exe"
Start "" "C:\Program Files\Macro Express Pro 6\MeProc.exe" /ASaveDeskTopView
timeout 1
Start "" "C:\Program Files\ToggleTaskbarAutohide\ToggleTaskbarAutohide.exe"
The CMD window that handles the timeout gets caught in the snip, thus spoiling it.
How to get a delay without the CMD window ? I have tried 'wait' - it is no better.
-
Hi Sebastian
As this is a syn-tech question using Macro express it may be an idea to ask on their forums.
https://www.macros.com/knowledge-base/how-do-i-run-a-batch-file-with-macro-express/
-
You don't need the start command. You can just run the program from the batch file.
"C:\Program Files\ToggleTaskbarAutohide\ToggleTaskbarAutohide.exe"
"C:\Program Files\Macro Express Pro 6\MeProc.exe" /ASaveDeskTopView
"C:\Program Files\ToggleTaskbarAutohide\ToggleTaskbarAutohide.exe"
It may also be useful to do some error handling with a conditional.
For more info see here:
https://ss64.com/nt/syntax-conditional.html (https://ss64.com/nt/syntax-conditional.html)