0

I have created a right-click menu item based on this answer to run a batch file. This batch file runs a command which does some processing on the file. However, if I select multiple files, I see a separate command window for each file opened simultaneously. This is problematic as the command has to completely read and overwrite the file, and the file is on a USB flash drive. I need for each command to complete on a single file before starting on the next file. I also need to be able to select multiple files at once and then have it run, so as to not waste time manually waiting for each file to be processed before starting the next.

How can I get the right-click command to not try to open all files with simultaneous parallel scripts and instead do it in a serial fashion?

Update: As a workaround, I am creating a lock file to act as a semaphore and while this does work, it also opens hundreds or thousands (or however many files are selected) of CMD windows to each run the batch script, which in itself prevents anything else from being done until they are all on the screen, and presumably takes quite a bit of unnecessary resources when only a single command window with a single batch file is really needed at a time. In fact, this makes some functionality unusable while running, such as the ability to alt+tab between apps.

Michael
  • 2,824

0 Answers0