Mombu the Microsoft Forum

Mombu the Microsoft Forum > Microsoft > Windows 2000 Server (TECHNET) > FOR command causes cmd window to exit
REGISTER NOW! Mark Forums Read




Reply
 
Thread Tools Display Modes
1 29th October 17:43
kok yong lee
External User
 
Posts: 1
Default FOR command causes cmd window to exit



hi there,

I bumped into a weird machine in my office where in the command window when
I type in
FOR /F "usebackq delims==" %i IN (`set`) DO @echo %i

and hit enter, the command window will just close down completely like I
just issue the EXIT command.

This only happen to
FOR /F ["options"] %variable IN (`command`) DO command
[command-parameters]

If i just use the FOR to parse the content of a file, then everthing just
work as expected.

Anyone seen this kind of problem before?
  Reply With Quote
SPONSORED LINKS BY GOOGLE

 


2 29th October 17:43
kok yong lee
External User
 
Posts: 1
Default FOR command causes cmd window to exit



Forgot to mention the Os is WinXp SP2
  Reply With Quote
3 29th October 17:43
foxidrive
External User
 
Posts: 1
Default FOR command causes cmd window to exit


Random Windows behaviour? It works here, but is there some reason you are
using usebackq?

FOR /F "delims==" %i IN ('set') DO @echo %i
  Reply With Quote
4 29th October 17:43
kok yong lee
External User
 
Posts: 1
Default FOR command causes cmd window to exit


Not really, I only copy the exmapel command from FOR /? to try out.

It is the same behaviour as well for "FOR /F "delims==" %i IN ('set') DO
@echo %i"

It is definately weird ebahviour but not random as it is reproducible every
time.
  Reply With Quote
5 29th October 17:43
esra sdrawkcab
External User
 
Posts: 1
Default FOR command causes cmd window to exit


Maybe a prank synonym of "set" to "For"?
  Reply With Quote
6 29th October 17:43
foxidrive
External User
 
Posts: 1
Default FOR command causes cmd window to exit


Random in terms of different Windows installations can behave differently.
(There's an entire MS knowledgebase out there dedicated to those things...)

There is also a random behaviour in a CMD window at times which is fixed with a
reboot.
  Reply With Quote
SPONSORED LINKS BY GOOGLE

 


Reply


Thread Tools
Display Modes







Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
Also visit Ogoun the Usenet Archive
666