keyongtech


  keyongtech > windows.* > windows.powershell > 01/2008

 #1  
01-15-08, 12:42 PM
powershell fail on winodws 2008
On windows 2008 ,run powershell script by windows serivice application ,but
this script always failed due to the following .Net runtime error

..NET Runtime version 2.0.50727.1433 - The Win32 internal error "Access is
denied" 0x5 occurred when retrieving handle for active console output buffer.
Please contact Microsoft Support Services.

Another thing I need to get the result of powershell script by redirect
stdout/stderr of
powershell ,so I create powershell process without specified creation flags.
 #2  
01-15-08, 01:35 PM
Marco Shaw [MVP]
powershell fail on winodws 2008 wrote:
> On windows 2008 ,run powershell script by windows serivice application ,but
> this script always failed due to the following .Net runtime error
>
> .NET Runtime version 2.0.50727.1433 - The Win32 internal error "Access is
> denied" 0x5 occurred when retrieving handle for active console output buffer.
> Please contact Microsoft Support Services.
>
> Another thing I need to get the result of powershell script by redirect
> stdout/stderr of
> powershell ,so I create powershell process without specified creation flags.
>


You're trying to run a PowerShell script as a service?

Can you detail exactly what you're trying to do?

Marco
 #3  
01-15-08, 04:25 PM
powershell fail on winodws 2008
"powershell fail on winodws 2008" wrote:
[..]
 #4  
01-15-08, 04:29 PM
powershell fail on winodws 2008
I have windows services application ,which run script periodically . if this
srcipt is
common batch ,no problem .but if this script is wrotten in powershell and
with
externsion name ".ps1" , the script cann't be done and from applicataion
event
log ,I found some .Net runtime error


I wan to know from .Net runtime error , can you tell me which win32API
failed ,or
can you tell me what powershell is try to doing at that point

"Marco Shaw [MVP]" wrote:
[..]
 #5  
01-15-08, 04:30 PM
Shay Levi
What's the command line you're service is running to invoke the script?

-----
Shay Levi
$cript Fanatic
http://scriptolog.blogspot.com
[..]
 #6  
01-15-08, 05:50 PM
Marco Shaw [MVP]
powershell fail on winodws 2008 wrote:
> I have windows services application ,which run script periodically . if this
> srcipt is
> common batch ,no problem .but if this script is wrotten in powershell and
> with
> externsion name ".ps1" , the script cann't be done and from applicataion
> event
> log ,I found some .Net runtime error


OK, built-in, you cannot simply run a .ps1 file by double-clicking on it
for example.

Just for fun, wrap the PowerShell commands in a VBScript script
following this example:
[url down]
 #7  
01-15-08, 09:20 PM
Karl Prosser[MVP]
Powershell.exe interacts with the console intimately, maybe .bat's don't
neccisarily have to. However i'm sure you could make a small application
yourself that hosts the powershell engine and runs scripts in the service.
-Karl

Marco Shaw [MVP] wrote:
[..]
Similar Threads
Is it possible to run a Powershell script as a Windows Service?

Is it possible to run a Powershell script as a Windows Service? Many Thanks, =Adrian=

Powershell V/s VB script windows installer COM object

Hello, I am trying to use the windows installer COM object with powershell and I'm running into problems. It looks like the shell holds on to the .wsi file that I'm trying...

What is the MIME type of Windows Powershell script files (.ps1 fil

hi, there, does anyone know what the *.ps1 files' MIME type is? thanks! zkyboy

Powershell or Windows Script

Dear all, since my phone is not good for browsing in long MP3-Files i´m looking for a convenient way to split my MP3-Podcasts. I found a splitting- program (mp3DirectCut)...

Powershell Script as Windows Service

Hello everybody, i am wondering if it is possible to run powershell scripts as windows service? embedding my *.ps1 script in a batch file and using instsrv/srvany allows me...


All times are GMT. The time now is 05:32 PM. | Privacy Policy