Link to home
Start Free TrialLog in
Avatar of Govind Parth
Govind Parth

asked on

Copy From CMD

Hi

I am trying to copy a directory from the network file share to a remote computer root drive. When i run the copy cmd using the PSTools on the remote computer it throws error saying access denied. However when i file explore the remote computer using C$ and copy it using the GUI it works. Any suggestions ???
EXPERT CERTIFIED SOLUTION
Avatar of Sam Jacobs
Sam Jacobs
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Can you check from the source
\\destination_server\ADMIN$
If you are getting access denied, follow below steps on remote server/pc




Open RegEdit on your remote server
Take a backup of the registry
Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
Add a new DWORD value called LocalAccountTokenFilterPolicy
Set its value to 1
Reboot the pc/server
Try running PSExec again from your local server
Avatar of oBdA
oBdA

Assuming you can access the source from the machine you're running the command on, there's no need to use psexec. Since the GUI and psexec work, the administrative shares are accessible, so you can copy directly to the remote machine.
Sample with robocopy:
robocopy.exe "\\SomeServer\share\folder" "\\SomeMachine\C$\folder" /e /r:0

Open in new window

You cannot compare both methods. What you have done with Explorer corresponds with oBdA's robocopy suggestion - you copy content from remote to your machine to another remote.
Using psExec however performs a direct copy on the remote machine, so you need to make sure to have network access from there (as has been said above).
Remember that with psExec you are just talking to the remote machine, and seeing results of it sends back. No files, drives or whatever are exchanged (after the session started).
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Govind Parth

ASKER

Thanks. I figured out yesterday. With the usage of -u switch it worked..Thanks for ur efforts
Please mark the first comment by Sam as the answer :)