Sign in to follow this  
Followers 0
waster656

Using RunAs to set Windows XP Power Policy

2 posts in this topic

Guys,

I wonder if anyone can help.

I have written a simple script to set the Windows XP power policy using the "Powercfg.exe" command line utility. If I run the script using the "Run" command everything works OK, however if I run it using the "RunAs" command it doesn't seem to work.

My command line is as follows:

RunAs($sUserName, @ComputerName, $sPassword, 0, 'powercfg.exe /setactive "Always On"', @SystemDir)

Can anyone help or suggest an alternative please?

Share this post


Link to post
Share on other sites



Maybe a stupid question; You do have full path to executable in your code? It is specified you should include it. (In helpfile...)

/Manko


Yes i rush things! (I sorta do small bursts inbetween doing nothing.) Things I have rushed and reRushed:* ProDLLer - Process manager - Unload viri modules (dll) and moore...* _WinAPI_ProcessListOWNER_WTS() - Get Processes owner list...* _WinAPI_GetCommandLineFromPID() - Get commandline of target process...* _WinAPI_ThreadsnProcesses() Much info if expanded - optional Indented "Parent/Child"-style Processlist. Moore to come... eventually...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0