Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Generic User Avatar

Retrospective effect in a batch file - in x32Win10ProV22H2


  • Please log in to reply
2 replies to this topic

#1 Bastie

Bastie

  •  Avatar image
  • Members
  • 241 posts
  • OFFLINE
  •  
  • Local time:03:31 PM

Posted 16 April 2024 - 01:58 AM

By using a batchfile, I'm trying to automate capturing a view of the desktop (for storage).
The following code produces the right image, but leaves the TaskBar permanently unhid.

Start "" "C:\Program Files\ToggleTaskbarAutohide\ToggleTaskbarAutohide.exe"
timeout 1
Start "" "C:\Program Files\Macro Express Pro 6\MeProc.exe" /ASaveDeskTopView
REM timeout 1
REM Start "" "C:\Program Files\ToggleTaskbarAutohide\ToggleTaskbarAutohide.exe"



The following prevents the first line from being effective.

Start "" "C:\Program Files\ToggleTaskbarAutohide\ToggleTaskbarAutohide.exe"
timeout 1
Start "" "C:\Program Files\Macro Express Pro 6\MeProc.exe" /ASaveDeskTopView
timeout 1
Start "" "C:\Program Files\ToggleTaskbarAutohide\ToggleTaskbarAutohide.exe"


I find it very peculiar that a late step can influence an earlier step.
Can anyone explain - or better still, REMEDY, this anomaly ?

 

I have stated the wrong title - the problem is different.

If the batch file has

 

Start "" "C:\Program Files\ToggleTaskbarAutohide\ToggleTaskbarAutohide.exe"
timeout 1
Start "" "C:\Program Files\Macro Express Pro 6\MeProc.exe" /ASaveDeskTopView
timeout 2
Start "" "C:\Program Files\ToggleTaskbarAutohide\ToggleTaskbarAutohide.exe"

 

The first line is NOT cancelled, but a CMD screen for the last step gets superimposed over the image.

So the problem is one of timing : how to prevent the CMD screen for the last step from being caught in the snip.


Edited by Bastie, 16 April 2024 - 02:11 AM.


BC AdBot (Login to Remove)

 


#2 pseymour

pseymour

  •  Avatar image
  • Members
  • 269 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Ohio, USA
  • Local time:01:31 AM

Posted 17 April 2024 - 07:20 AM

Try adding a /wait to your lines that use the start command.

 

e.g., 

start "" /wait "C:\My\Command\here.exe"

 


Edited by pseymour, 17 April 2024 - 07:21 AM.

-- Patrick


#3 Bastie

Bastie
  • Topic Starter

  •  Avatar image
  • Members
  • 241 posts
  • OFFLINE
  •  
  • Local time:03:31 PM

Posted 17 April 2024 - 01:13 PM

It seems to me '/wait' should not be added to all the lines, but to the third command. However that does not fix things.

Nor does adding it to all three.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users