Jump to content

Recommended Posts

Posted

I will admit I am new at this but I can not seem to get this to run... and it is driving me nuts, I know I am missing something simple.

If I were to manually run this application I have to do a runas (administrator) on the command prompt and type:

c:\volumeid.exe c: 1234-1234

then close the command prompt.

I think it is launching the volumeid.exe application but not passing the c: 1234-1234 to it. The $volumeid is random at runtime but for the example I made it static. In the real coding by the time I get to part it is randomized. Thanks for your help in advance.

$volumeid = "1234-1234"

Local $sUserName = "Administrator"
Local $sPassword = "12345678"
Local $AppA = "c:\volumeid.exe c: "
Local $App =  $AppA & $volumeid
Local $pid = RunAsWait($sUserName, @ComputerName, $sPassword, 0, $App)

; Wait for the process to close.
ProcessWaitClose($pid)

MsgBox(64, "", "Successful VolumeID Change")
Posted

Says in the help file that if you don't specify a working directory then @SystemDir will be used. I"m not sure if that will make a difference.

I think that is set in $AppA right? So the final non-variable result would be:

Local $pid = RunAsWait(Administrator, @ComputerName, 12345678, 0, C:volumeid.exe c: 1234-1234)

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...