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 ???
Govind ParthSystem AdministratorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sam JacobsDirector of Technology Development, IPMCommented:
Are you passing PSTools your credentials (-u username -p password)?
Afthab TIT ExpertCommented:
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
oBdACommented:
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

Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
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).
Shaun VermaakTechnical SpecialistCommented:
To access shares via PSEXEC on remote computer you need -u and -p as per first comment

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Govind ParthSystem AdministratorAuthor Commented:
Thanks. I figured out yesterday. With the usage of -u switch it worked..Thanks for ur efforts
Shaun VermaakTechnical SpecialistCommented:
Please mark the first comment by Sam as the answer :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
IT Administration

From novice to tech pro — start learning today.