ScriptFu Posted September 19, 2012 Share Posted September 19, 2012 I have a script which opens up a rdc remotely on a Windows 7 machine using psexec. It works perfectly on one machine, but does not work at all on the other which is using the same OS (Win 7). Anyone has this happen to them? The second machine just does nothing when i execute the command to open the rdc. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 19, 2012 Moderators Share Posted September 19, 2012 Hi, ScriptFu. How about posting your code so we can take a look? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
ScriptFu Posted September 19, 2012 Author Share Posted September 19, 2012 I can't put too much due to privacy, but this is the function which i have been using. Func _remoteLaunch($remoteIp, $path, $username) RunWait(@ComSpec & " /c " & "C:\pstools\psexec.exe \\" & $remoteIp & ' -u ' & $username & ' -p password -d -i 1 -w c:\windows\system mstsc "' & $path & '" /admin ') EndFunc and here is how i call it: Case $button _remoteLaunch($Ip, "c:\Users\User\Desktop\rdp.RDP", "User") Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 19, 2012 Moderators Share Posted September 19, 2012 So what do you see if you change the '/c" to "/k" to keep the window open? Any errors? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Colyn1337 Posted September 19, 2012 Share Posted September 19, 2012 (edited) My first question would be............ The computer that's not working, is the remote management service running? run the "winrm quickconfig" and see if you get better results. If the machine is already configured, no harm no foul. Edited September 19, 2012 by Colyn1337 Link to comment Share on other sites More sharing options...
Michahe Posted September 20, 2012 Share Posted September 20, 2012 (edited) Under some circumstances you should use the parameter '-accepteula' for psexec !? Edited September 20, 2012 by Michahe Link to comment Share on other sites More sharing options...
ScriptFu Posted September 20, 2012 Author Share Posted September 20, 2012 So what do you see if you change the '/c" to "/k" to keep the window open? Any errors?Thanks for this.I see 'Logon Failure: unknown user name or bad password'I know for a fact that i have the right username and password however. Link to comment Share on other sites More sharing options...
ScriptFu Posted September 20, 2012 Author Share Posted September 20, 2012 Thanks for this.I see 'Logon Failure: unknown user name or bad password'I know for a fact that i have the right username and password however.I have sorted out the bad credentials issue, it was a problem with the function parameters.The error i now receive is 'invalid connection file ("path") specified'.Thoughts? Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 21, 2012 Moderators Share Posted September 21, 2012 (edited) RunWait(@ComSpec & " /c " & "C:pstoolspsexec.exe " & $remoteIp & ' -u ' & $username & ' -p password -d -i 1 -w c:windowssystem mstsc "' & $path & '" /admin ')Take a look at what you have for the path to mstsc, you stop at C:windowssystem. You should be calling C:WindowsSystem32mstsc.exe (or SysWOW64 if your box is 64-bit). Edited September 21, 2012 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
ScriptFu Posted September 21, 2012 Author Share Posted September 21, 2012 Take a look at what you have for the path to mstsc, you stop at C:windowssystem. You should be calling C:WindowsSystem32mstsc.exe (or SysWOW64 if your box is 64-bit).It now gives me 'cant access: specified path invalid' Indeed it is a X64 machine. Link to comment Share on other sites More sharing options...
ScriptFu Posted September 21, 2012 Author Share Posted September 21, 2012 It works!!!! It was a stupid typo in the file name with 2 spaces instead of one. Thanks a lot guys! Link to comment Share on other sites More sharing options...
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