Jump to content

Recommended Posts

Posted

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.

Posted

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

Posted (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 by Colyn1337
Posted

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.

Posted

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?

  • Moderators
Posted (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 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!

Posted

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.

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
×
×
  • Create New...