PDowning Posted June 25, 2013 Author Posted June 25, 2013 (edited) damnit... just realized i didn't use " & " before the variables in the msgbox... hang on,,, rechecking. brb. Edit: $MyPath variable is not getting a value. I put a msgbox AFTER this: $MyPath = _WinNet_GetUniversalName($ScriptPath) no value returned Edit: msgbox(0, "Mypath value, "mypath value = " & $MyPath[0]) is the correct way that shoulda been done. It returns the correct unc path value. After that all msgbox's return the correct value, but when I run the RunAs(), nothing happens. Maybe it's a problem with the domain credentials somehow? Edited June 25, 2013 by PDowning
KSum Posted June 25, 2013 Posted June 25, 2013 Cut and past caused 2 lines to show as one. Inside that first If... Then should be 2 lines: ;Make sure it is a UNC and not a mapped drive if StringInStr($ScriptPath, ":") > 0 Then $MyPath = _WinNet_GetUniversalName($ScriptPath) $ScriptPath = $MyPath[0] EndIf Are you getting an error returned? An error of 1 has been, in my experience, bad credentials. Note that my code is looking for the credentials to be put into variables: $sUserName = the user name $sDomain = the network domain $sPassword = the password Also note that it needs to be a network account with rights to the msi. A local account may not work.
PDowning Posted June 25, 2013 Author Posted June 25, 2013 Taking a break from this ... going to lunch.
PDowning Posted June 25, 2013 Author Posted June 25, 2013 Cut and past caused 2 lines to show as one. Inside that first If... Then should be 2 lines: ;Make sure it is a UNC and not a mapped drive if StringInStr($ScriptPath, ":") > 0 Then $MyPath = _WinNet_GetUniversalName($ScriptPath) $ScriptPath = $MyPath[0] EndIf Are you getting an error returned? An error of 1 has been, in my experience, bad credentials. Note that my code is looking for the credentials to be put into variables: $sUserName = the user name $sDomain = the network domain $sPassword = the password Also note that it needs to be a network account with rights to the msi. A local account may not work. yes, I replaced those with the correct credentials, but it just doesn't work. how do I get the error code returned?
KSum Posted June 25, 2013 Posted June 25, 2013 Use the RunAsWait that I provided with the IF... THEN set that follows it and see what you get. My experience is that credential problems have error out fairly quickly. Better yet for testing, replace the msiexec call with one for a test executable that lets you know it is running. I have made a script that I compiled that simply opened a MsgBox stating it was running and called it from the same folder as the .msi. I know then that the RunAsWait or RunAs function was working properly.
PDowning Posted June 25, 2013 Author Posted June 25, 2013 Use the RunAsWait that I provided with the IF... THEN set that follows it and see what you get. My experience is that credential problems have error out fairly quickly. Better yet for testing, replace the msiexec call with one for a test executable that lets you know it is running. I have made a script that I compiled that simply opened a MsgBox stating it was running and called it from the same folder as the .msi. I know then that the RunAsWait or RunAs function was working properly. Ok .. that got me closer. It actually launches the msi now. i'm going home. thanks for the help. I'll be back here tomorrow I'm sure.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now