![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | New Window vs Inline I'm not quite unterstanding when Powershell decides to open a new command window vs. a command is run inline. For example: PS> .\python-script.py Opens a new window. PS> python python-script.py Does not. Is there a way to change this behaviour? Michael |
My System Specs![]() |
| | #2 (permalink) |
| | Re: New Window vs Inline On Jun 18, 11:17*am, Michael Elsdörfer <mich...@xxxxxx> wrote: Quote: > I'm not quite unterstanding when Powershell decides to open a new > command window vs. a command is run inline. For example: > > PS> .\python-script.py > > Opens a new window. > > PS> python python-script.py > > Does not. Is there a way to change this behaviour? > > Michael In your first example, "PS> .\python-script.py", PowerShell just executes the file based on the association with the file's extension; it basically passes the responsibility off to python.exe, which opens a new console window and executes the file. It is just like opening a text file ("PS> .\file.txt") or a Word document ("PS> . \document.doc"). In the second example, you are specifying the name of an executable that has a command-line interface, along with a command-line parameter. Since that application can run in the PowerShell console, it does. I hope this clears things up a little. Jeff |
My System Specs![]() |
| | #3 (permalink) |
| | Re: New Window vs Inline What is in your PATHEXT environment variable? I guess, extension ".py" is not there. Try to add and see if it helps. -- Thanks, Roman Kuzmin http://code.google.com/p/farnet/ PowerShell and .NET in FAR Manager "Michael Elsdörfer" <michael@xxxxxx> wrote in message news:OFD4KpP0IHA.3648@xxxxxx Quote: > I'm not quite unterstanding when Powershell decides to open a new command > window vs. a command is run inline. For example: > > PS> .\python-script.py > > Opens a new window. > > PS> python python-script.py > > Does not. Is there a way to change this behaviour? > > Michael |
My System Specs![]() |
| | #4 (permalink) |
| | Re: New Window vs Inline Roman Kuzmin schrieb: Quote: > What is in your PATHEXT environment variable? I guess, extension ".py" > is not there. Try to add and see if it helps. Michael |
My System Specs![]() |
| | #5 (permalink) |
| | Re: New Window vs Inline Thats a great observation Jeff. Because. basically the fileassociation is doing the same as [system.diagnostic.process]::start which will always open a new process totally seperate from your console.. But when its the plain powershell invocation, powershell knows that its a console application and runs it through the same console. The same test can be done in cmd. in CMD.exe type CMD.EXE you get your new childshell inside the same console window then try START CMD.EXE this spawns a totally new process, and its in a new window. Jeff wrote: Quote: > On Jun 18, 11:17 am, Michael Elsdörfer <mich...@xxxxxx> > wrote: Quote: >> I'm not quite unterstanding when Powershell decides to open a new >> command window vs. a command is run inline. For example: >> >> PS> .\python-script.py >> >> Opens a new window. >> >> PS> python python-script.py >> >> Does not. Is there a way to change this behaviour? >> >> Michael > Michael, > > In your first example, "PS> .\python-script.py", PowerShell just > executes the file based on the association with the file's extension; > it basically passes the responsibility off to python.exe, which opens > a new console window and executes the file. It is just like opening a > text file ("PS> .\file.txt") or a Word document ("PS> . > \document.doc"). > > In the second example, you are specifying the name of an executable > that has a command-line interface, along with a command-line > parameter. Since that application can run in the PowerShell console, > it does. > > I hope this clears things up a little. > > Jeff |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Inline Photos in WLM | Live Mail | |||
| Can't insert inline image | Live Mail | |||
| Inline Photos | Live Mail | |||
| Editing Inline HTML | Vista mail | |||
| Viewing .jpg attachments inline | Vista mail | |||