1

At work my new development PC is running XP SP3 (32bit) and whenever I try to run the FOR command in command prompt the console closes!

This happens when FOR is used in a BAT file as well as used on the command line.

I've tried CMD -> CMD -> FOR and then check the %ERRORLEVEL% o the remaining CMD but it returns 0

It only affects the FOR command, IF, RENAME ... all work

Has anyone else observed this / solved it?

Oliver
  • 2,175
  • 3
  • 24
  • 31
  • I have this problem too.. it happens with for /f like for /f %f in ('asdf') do echo wer . It doesn't happen with regular for. I haven't solved it. running cmd->cmd->for I can run the for multiple times no problem and no close. i'm thinking of doing a workaround so start..run..cmd does that, i've done it for the icon too. So it won't close automatically. I haven't really solved it. Also Win XP SP3 32-bit. But other Win XP 32-bit ones haven't done this. – barlop Aug 20 '11 at 00:01
  • See http://stackoverflow.com/questions/7236499/for-f-closes-cmd-prompt-immediately and it got a mention here http://stackoverflow.com/questions/261296/batch-closes-prematurely-on-a-for-f-command – barlop Dec 20 '11 at 22:49
  • If you check those, particularly the first one. you see that probably answers it for you, making your question probably a duplicate! – barlop Dec 20 '11 at 22:51

0 Answers0