Sign in to follow this  
Followers 0
carlosrapa

Going nuts trying to run VolumeID.exe with parameters

4 posts in this topic

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")

Share this post


Link to post
Share on other sites



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)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

RunAsWait ( "username", "domain", "password", logon_flag, "program" [, "workingdir" [, show_flag [, opt_flag]]] )

No, never mind, that couldn't be the problem. Carry on.

Edited by LaCastiglione

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