PC Review


Reply
Thread Tools Rate Thread

FOR command causes cmd window to exit

 
 
Kok Yong Lee
Guest
Posts: n/a
 
      26th Oct 2007
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
 
 
 
 
Kok Yong Lee
Guest
Posts: n/a
 
      26th Oct 2007
Forgot to mention the Os is WinXp SP2

"Kok Yong Lee" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
 
foxidrive
Guest
Posts: n/a
 
      26th Oct 2007

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

FOR /F "delims==" %i IN ('set') DO @echo %i

On Fri, 26 Oct 2007 11:31:09 +0100, "Kok Yong Lee" <(E-Mail Removed)> wrote:

>Forgot to mention the Os is WinXp SP2
>
>"Kok Yong Lee" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed)...
>> 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
 
Kok Yong Lee
Guest
Posts: n/a
 
      26th Oct 2007
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.


"foxidrive" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> Random Windows behaviour? It works here, but is there some reason you are
> using usebackq?
>
> FOR /F "delims==" %i IN ('set') DO @echo %i
>
> On Fri, 26 Oct 2007 11:31:09 +0100, "Kok Yong Lee" <(E-Mail Removed)>
> wrote:
>
>>Forgot to mention the Os is WinXp SP2
>>
>>"Kok Yong Lee" <(E-Mail Removed)> wrote in message
>>news:(E-Mail Removed)...
>>> 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
 
Esra Sdrawkcab
Guest
Posts: n/a
 
      26th Oct 2007
Kok Yong Lee wrote:
> 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.
>
>
> "foxidrive" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Random Windows behaviour? It works here, but is there some reason you are
>> using usebackq?
>>
>> FOR /F "delims==" %i IN ('set') DO @echo %i
>>
>> On Fri, 26 Oct 2007 11:31:09 +0100, "Kok Yong Lee" <(E-Mail Removed)>
>> wrote:
>>
>>> Forgot to mention the Os is WinXp SP2
>>>
>>> "Kok Yong Lee" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> 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?
>>>>

>
>

Maybe a prank synonym of "set" to "For"?
 
Reply With Quote
 
foxidrive
Guest
Posts: n/a
 
      26th Oct 2007

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.

On Fri, 26 Oct 2007 11:56:53 +0100, "Kok Yong Lee" <(E-Mail Removed)> wrote:

>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.
>
>
>"foxidrive" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed)...
>>
>> 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
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to exit main office outlook 07 window & keep mail window open Zev Microsoft Outlook Discussion 4 17th Aug 2009 03:52 PM
exit command enrico via DotNetMonster.com Microsoft VB .NET 1 18th Mar 2008 08:25 AM
Exit All Sub Command? =?Utf-8?B?anV0bGF1eA==?= Microsoft Excel Programming 1 15th Jun 2007 09:53 PM
How to wait for command window to exit? Terry Olsen Microsoft VB .NET 4 28th Jul 2005 01:38 PM
Close child window on exit of parent window =?Utf-8?B?UHJpc3k=?= Microsoft C# .NET 0 27th Jul 2005 06:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:50 PM.