Computer Hope

Software => Computer programming => Topic started by: Sebastian42 on April 21, 2024, 06:26:14 AM

Title: timing conflict in a x32Win10ProV22H2 batch file
Post 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.



Title: Re: timing conflict in a x32Win10ProV22H2 batch file
Post by: Lisa_maree on April 21, 2024, 03:10:57 PM
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/
Title: Re: timing conflict in a x32Win10ProV22H2 batch file
Post by: TheWaffle on May 17, 2024, 11:41:16 AM
You don't need the start command. You can just run the program from the batch file.

Code: [Select]
"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)