I can't seem to get psexec
commands to work on a remote Windows 7 Enterprise workstation.
I'm trying to execute the following command:
psexec.exe \\172.16.165.157 -u jc -p testing123 -c -f -i cmd.exe
But I keep getting the error:
PsExec v1.94 - Execute processes remotely
Copyright (C) 2001-2008 Mark Russinovich
Sysinternals - www.sysinternals.com
Error copying C:\WINDOWS\system32\cmd.exe to remote system:
Access is denied.
I'm trying to execute the command from a machine running Windows XP Professional.
If you are trying to do something that could generate a UAC prompt on the remote system, you need to use this:
Copying cmd.exe from the system32 directory of a WinXP machine to the system32 directory of a Win7 machine is a very poorly conceived example. Please be careful. It is unwise to treat system files with such disrespect, especially across OS versions or architectures.
When you are using psexec, please specify a full path that is not within the c:\windows\ hierarchy on the remote system.
Presumably, there is a user account "jc" on the machine "172.16.165.157", with the password "testing123", and that account has "Administrator" rights there?
If the answer is "no" then this is your problem.
You don't want to copy "CMD.EXE" to the remote machine, either. It's already there. You don't need the "-c" flag on your PSEXEC command-line.
Try
-u computername\jc
I used the
-d
argument as a workaround. But that means I don’t get back the return code from the process I started remotely.This is a workaround, but it is not ideal.
Three things comes to my mind...