sarah geen
sarah geen

Reputation: 1

start /w not working anymore?

I have always used start /w in batch files and from a Windows console to run something and pause till the application is closed. But since a few weeks ago, this does not work anymore!

I tried to simply open one by one the .pdf files in a folder and it doesn't work. So I studied for at least 3 hours what could be wrong to no avail. And nobody on the Internet seems to mention a problem like that. Today I picked a batch I used in the past to open files in sequence and it doesn't work anymore either. It would use two simple batches, the core one doing just this:

cd %1
for %%f in (*.py) do start /wait %%f
cd ..

I am pretty sure I used it successfully on the same machine I use now (Win7 Professional, 64-bit). I tried all sorts of things like call, command /b with the command, but none of them works.

From the console when I do ver I get Microsoft Windows [Version 6.1.7601] (from the 32 or the 64-bit console).

What do you think has gone wrong here?

Upvotes: 0

Views: 155

Answers (1)

dbenham
dbenham

Reputation: 130819

In one of your comments, you show that the following specific command fails from the command line:

for %a in (*.pdf) do start /wait "C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" %a

It doesn't work properly because the first argument is treated as a title if it is quoted. If you need to quote your executable, then you must precede the program with a quoted title. You can provide an empty title if you want:

for %a in (*.pdf) do start /wait "" "C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" %a

Upvotes: 1

Related Questions