Odewallrus Posted February 2, 2011 Posted February 2, 2011 I have a compiled script that is being installed on a computer via PsExec. 3 exe's are being copied to a remote computer: Client.exe (main app) ClientMon.exe (monitor for the main app to restart if the user shuts it down) ClientStart.exe (application to start both Client.exe and ClientMon.exe and handle install and uninstall. Does not run once the other 2 apps are started) My problem is that when I remote execute the ClientStart.exe with: RunWait(@ComSpec & " /c " & 'PSexec.exe -i -s \\' & $aHosts[$p][1] & ' "c:\Program Files\Client\ClientStart.exe"') My Client.exe is unable to write to an ini file on a \\computer\share It is able to read the file. It is not a securities issue on the share. Once the remote computer is rebooted, the Client.exe starts under the logged in users account from the “RUN” Registry key instead of the system account and everything works fine. I have tried multiple switch combinations on PsExec with no luck, and I am not sure why. Is there a way to have my ClientStart.exe execute the 2 apps under the currently logged on users account? I am open to any solution that will make my app read and write to the share.
EOL Posted February 2, 2011 Posted February 2, 2011 Have you looked at possibly using RunAsWait? $strDomain = "Domain" $strUserName = "Username" $strPassword = "Password" $strCMD = @ComSpec & " /c " & 'PSexec.exe -i -s \\' & $aHosts[$p][1] & ' "c:\Program Files\Client\ClientStart.exe"' RunAsWait($strUserName, $strDomain, $strPassword, 0, $strCMD)
Odewallrus Posted February 3, 2011 Author Posted February 3, 2011 Have you looked at possibly using RunAsWait? $strDomain = "Domain" $strUserName = "Username" $strPassword = "Password" $strCMD = @ComSpec & " /c " & 'PSexec.exe -i -s \\' & $aHosts[$p][1] & ' "c:\Program Files\Client\ClientStart.exe"' RunAsWait($strUserName, $strDomain, $strPassword, 0, $strCMD) Yes, I had tried that as well with no luck.
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