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 ???
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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:
Sample with robocopy:
robocopy.exe "\\SomeServer\share\folder" "\\SomeMachine\C$\folder" /e /r:0
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).
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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 :)
\\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\SOFTWAR
Add a new DWORD value called LocalAccountTokenFilterPol
Set its value to 1
Reboot the pc/server
Try running PSExec again from your local server