![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | PS Console when invoking a script from VB.NET In a VB program I use the following statement: Shell("c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe -noexit " _ + arg1 + " " + arg2, AppWinStyle.MaximizedFocus, True) This works fine on my Vista where it brings up the PS console and I can do the debugging. Not so on Win 2003 where the Console does not appear. What should I change in the settings on 2003? Thank you very much, Dan |
My System Specs![]() |
| | #2 (permalink) |
| | RE: PS Console when invoking a script from VB.NET I assume that PowerShell.exe actually exists at the path you have given on your Win 2003 machine -- Richard Siddaway Please note that all scripts are supplied "as is" and with no warranty Blog: http://richardsiddaway.spaces.live.com/ PowerShell User Group: http://www.get-psuguk.org.uk "Dan" wrote: > In a VB program I use the following statement: > Shell("c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe -noexit " _ > + arg1 + " " + arg2, AppWinStyle.MaximizedFocus, True) > This works fine on my Vista where it brings up the PS console and I can do > the debugging. > > Not so on Win 2003 where the Console does not appear. > > What should I change in the settings on 2003? > > Thank you very much, > Dan > |
My System Specs![]() |
| | #3 (permalink) |
| | RE: PS Console when invoking a script from VB.NET Indeed it is there and the script is executed only the PS Console does not appear. Thanks, Dan ========================================== "RichS" wrote: > I assume that PowerShell.exe actually exists at the path you have given on > your Win 2003 machine > -- > Richard Siddaway > Please note that all scripts are supplied "as is" and with no warranty > Blog: http://richardsiddaway.spaces.live.com/ > PowerShell User Group: http://www.get-psuguk.org.uk > > > "Dan" wrote: > > > In a VB program I use the following statement: > > Shell("c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe -noexit " _ > > + arg1 + " " + arg2, AppWinStyle.MaximizedFocus, True) > > This works fine on my Vista where it brings up the PS console and I can do > > the debugging. > > > > Not so on Win 2003 where the Console does not appear. > > > > What should I change in the settings on 2003? > > > > Thank you very much, > > Dan > > |
My System Specs![]() |
| | #4 (permalink) |
| | RE: PS Console when invoking a script from VB.NET Sounds strange. Does the arguments contain spaces or quoting chars? Are they looks alike on each platform? Try to run the following on each machine through Start >> Run c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe -noexit Can you see the console? Next try to add the arguments and see if it runs as exepected. Shay http://scriptolog.blogspot.com > Indeed it is there and the script is executed only the PS Console does > not > appear. > Thanks, > Dan > ========================================== > "RichS" wrote: > >> I assume that PowerShell.exe actually exists at the path you have >> given on >> your Win 2003 machine >> -- >> Richard Siddaway >> Please note that all scripts are supplied "as is" and with no >> warranty >> Blog: http://richardsiddaway.spaces.live.com/ >> PowerShell User Group: http://www.get-psuguk.org.uk >> "Dan" wrote: >> >>> In a VB program I use the following statement: >>> Shell("c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe >>> -noexit " _ >>> + arg1 + " " + arg2, AppWinStyle.MaximizedFocus, True) >>> This works fine on my Vista where it brings up the PS console and I >>> can do >>> the debugging. >>> Not so on Win 2003 where the Console does not appear. >>> >>> What should I change in the settings on 2003? >>> >>> Thank you very much, >>> Dan |
My System Specs![]() |
| | #5 (permalink) |
| | RE: PS Console when invoking a script from VB.NET Could there be a GPO with software restriction or some other permissions setting peventing it from running? -- Richard Siddaway Please note that all scripts are supplied "as is" and with no warranty Blog: http://richardsiddaway.spaces.live.com/ PowerShell User Group: http://www.get-psuguk.org.uk "Dan" wrote: > Indeed it is there and the script is executed only the PS Console does not > appear. > Thanks, > Dan > ========================================== > > "RichS" wrote: > > > I assume that PowerShell.exe actually exists at the path you have given on > > your Win 2003 machine > > -- > > Richard Siddaway > > Please note that all scripts are supplied "as is" and with no warranty > > Blog: http://richardsiddaway.spaces.live.com/ > > PowerShell User Group: http://www.get-psuguk.org.uk > > > > > > "Dan" wrote: > > > > > In a VB program I use the following statement: > > > Shell("c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe -noexit " _ > > > + arg1 + " " + arg2, AppWinStyle.MaximizedFocus, True) > > > This works fine on my Vista where it brings up the PS console and I can do > > > the debugging. > > > > > > Not so on Win 2003 where the Console does not appear. > > > > > > What should I change in the settings on 2003? > > > > > > Thank you very much, > > > Dan > > > |
My System Specs![]() |
| | #6 (permalink) |
| | RE: PS Console when invoking a script from VB.NET The behaviour described initially was when the program was built on Vista and installed (using msi) on the 2003 server. When I built the program on the server (without any editing!) it behaved as expected i.e. the PS console appeared. Strange indeed! Thank you all, Dan "Dan" wrote: > Indeed it is there and the script is executed only the PS Console does not > appear. > Thanks, > Dan > ========================================== > > "RichS" wrote: > > > I assume that PowerShell.exe actually exists at the path you have given on > > your Win 2003 machine > > -- > > Richard Siddaway > > Please note that all scripts are supplied "as is" and with no warranty > > Blog: http://richardsiddaway.spaces.live.com/ > > PowerShell User Group: http://www.get-psuguk.org.uk > > > > > > "Dan" wrote: > > > > > In a VB program I use the following statement: > > > Shell("c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe -noexit " _ > > > + arg1 + " " + arg2, AppWinStyle.MaximizedFocus, True) > > > This works fine on my Vista where it brings up the PS console and I can do > > > the debugging. > > > > > > Not so on Win 2003 where the Console does not appear. > > > > > > What should I change in the settings on 2003? > > > > > > Thank you very much, > > > Dan > > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| How to run powershell script without console ? | PowerShell | |||
| Invoking PS script in RunOnce | PowerShell | |||
| how to call win32 console app or bat file from ps script | PowerShell | |||
| Hide console and capture output from script? | PowerShell | |||
| Invoking Powershell from C# | PowerShell | |||