Jump to content
Sign in to follow this  

Going nuts trying to run VolumeID.exe with parameters

Recommended Posts


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.

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

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.