Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: timing conflict in a x32Win10ProV22H2 batch file  (Read 6284 times)

0 Members and 1 Guest are viewing this topic.

Sebastian42

    Topic Starter


    Intermediate

    • Yes
  • Certifications: List
  • Experience: Experienced
  • OS: Windows 10
timing conflict in a x32Win10ProV22H2 batch file
« 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.




Lisa_maree



    Mentor
  • My first real computer
  • Thanked: 162
    • Yes
  • Experience: Expert
  • OS: Windows 10
Re: timing conflict in a x32Win10ProV22H2 batch file
« Reply #1 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/
You have not lived today until you have done something for someone who can never repay you.”
― John Bunyan

TheWaffle



    Hopeful
  • Thanked: 4
    • Yes
  • Computer: Specs
  • Experience: Beginner
  • OS: Linux variant
Re: timing conflict in a x32Win10ProV22H2 batch file
« Reply #2 on: Today at 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