Batch closes prematurely on a for /f command

Posted by VonC on Stack Overflow See other posts from Stack Overflow or by VonC
Published on 2008-11-04T09:08:11Z Indexed on 2010/06/16 8:42 UTC
Read the original article Hit count: 203

Filed under:

I have a batch file (in windows XP, with command extension activated) with the following line:

for /f %%s in ('type version.txt') do set VERSION=%%s

On some computer, it works just fine (as illustrated by this SO question), but on other it kills cmd (the console window just closes)

Why ?


Note: the computers seem to have a similar configuration: XpSP2, the user has administrative right, no 'Command processor" defined in HKEY_CURRENT_USER\Software\Microsoft\Command Processor...

© Stack Overflow or respective owner

Related posts about batch-file