![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Invoke-History surprises I just did this to open cmd in a new window. PS> cmd /s start cmd This returned immediately and a new cmd.exe shell opened in a new window. I then tried repeating this action using invoke-history like so: PS> invoke-history 1 I was surprised to find that although the new cmd.exe window was opened, the invoke-history command did not return until the new cmd.exe shell window was closed. Any idea why this is? M |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Invoke-History surprises Hi, I don't see the same behaviour as you describe. If I start a new PowerShell window then type cmd /s start cmd CMD.exe opens inside the PowerShell console. You can demonstrate that it is CMD.exe not PowerShell by typing a command like: get-help when the error message shown in the session below is displayed. Windows PowerShell Copyright (C) 2006 Microsoft Corporation. All rights reserved. Transcript started, output file is c:\PowerShellScripts\Transcripts\20070110142425.txt PS C:\Documents and Settings\Andrew Watt> cmd /s start cmd Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\Andrew Watt>get-help 'get-help' is not recognized as an internal or external command, operable program or batch file. C:\Documents and Settings\Andrew Watt> If you type EXIT then you are returned to PowerShell and it works as normal, as far as I can see. Andrew Watt MVP On Mon, 8 Jan 2007 16:22:21 -0000, "Michael Lewis" <news@michaellewis.co.uk> wrote: >I just did this to open cmd in a new window. >PS> cmd /s start cmd >This returned immediately and a new cmd.exe shell opened in a new window. > >I then tried repeating this action using invoke-history like so: >PS> invoke-history 1 >I was surprised to find that although the new cmd.exe window was opened, the >invoke-history command did not return until the new cmd.exe shell window was >closed. > > >Any idea why this is? > > >M |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Invoke-History surprises Andrew, There was a typo in my problem description. Instead of "cmd /s start cmd", try "cmd /c start cmd". My apologies. With this mistake corrected I am able to confirm the odd behaviour I described: it blocks until the new cmd shell exits, but only if invoked from history. Thanks, Michael "Andrew Watt [MVP]" <SVGDeveloper@aol.com> wrote in message news:nnt9q2lsms6oojf8ubsfc7mirm07pcvqsk@4ax.com... > Hi, > > I don't see the same behaviour as you describe. > > If I start a new PowerShell window then type > > cmd /s start cmd > > CMD.exe opens inside the PowerShell console. > > You can demonstrate that it is CMD.exe not PowerShell by typing a > command like: > > get-help > > when the error message shown in the session below is displayed. > > Windows PowerShell > Copyright (C) 2006 Microsoft Corporation. All rights reserved. > > Transcript started, output file is > c:\PowerShellScripts\Transcripts\20070110142425.txt > PS C:\Documents and Settings\Andrew Watt> cmd /s start cmd > Microsoft Windows XP [Version 5.1.2600] > (C) Copyright 1985-2001 Microsoft Corp. > > C:\Documents and Settings\Andrew Watt>get-help > 'get-help' is not recognized as an internal or external command, > operable program or batch file. > > C:\Documents and Settings\Andrew Watt> > > If you type > > EXIT > > then you are returned to PowerShell and it works as normal, as far as > I can see. > > Andrew Watt MVP > > > On Mon, 8 Jan 2007 16:22:21 -0000, "Michael Lewis" > <news@michaellewis.co.uk> wrote: > >>I just did this to open cmd in a new window. >>PS> cmd /s start cmd >>This returned immediately and a new cmd.exe shell opened in a new window. >> >>I then tried repeating this action using invoke-history like so: >>PS> invoke-history 1 >>I was surprised to find that although the new cmd.exe window was opened, >>the >>invoke-history command did not return until the new cmd.exe shell window >>was >>closed. >> >> >>Any idea why this is? >> >> >>M |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| New stuff like Invoke-History enhancement | PowerShell | |||
| Vista: Full of surprises | Vista General | |||
| Vista: Full of surprises | Vista General | |||
| Vista: Full of surprises | Vista security | |||
| 2 surprises of vista | Vista General | |||