I can't seem to get psexec commands to work on Windows 7 Enterprise. I'm trying to execute a command like this:
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.
Has anybody seen an issue like this?
-
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.
tony roth : sometimes I need to read these things better!Jimmy C : Yes, an account with that name and admin rights exists on the system. I need the '-c' flag alright, I just used 'cmd.exe' as a example. I actually need to copy a number of tools to the system. It works fine on Windows XP, I just think there is some setting I haven't changed correctly on Windows 7.From Evan Anderson -
Try
-u computername\jcalharaka : If you do not specify a domain for the username, I am pretty sure `-u jc` is implicitly `-u computername\jc`. Just sayin'.Luca Matteis : @alharaka: no it isn't the same, you get an access denied if you don't specify the computername.alharaka : @Luca Matteis I just did the following with v1.96: `psexec \\TESTPC -u Administrator cmd` and pulled up a command prompt. That is a local account on a remote box. Did I miss something? I mean, you have to specify the computer name once before, is that what you meant?From Luca Matteis -
If you are trying to do something that could generate a UAC prompt on the remote system, you need to use this:
-h If the target system is Vista or higher, has the process run with the account's elevated token, if available.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.
From Miles Erickson -
I’m seeing the same problem. I can get around it by using the -d argument, but that means I don’t get back the return code from the process I started remotely.
It gives the workaround, but not ideal.
From bharath vn
0 comments:
Post a Comment