psexec to copy files form remote server to local machine

I want to use psexec  and get all files from server 111.11.1.11(dummy) ip address  and file location D:\Myfiles\archive\ on that server.
I want to copy and delete or move all files from that server to my C:\downloadedfiles folder.
Please help...I want to write a .bat file that i can call from another program
Angela4evaAsked:
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.

NVITCommented:
Put this in your .bat file:
psexec cmd /c "copy \\111.11.1.11\D$\Myfiles\archive C:\downloadedfiles"

Open in new window

0
Angela4evaAuthor Commented:
I also have username and password for the remote host. Ca you please let me know where I need to enter taht?
0
Angela4evaAuthor Commented:
psexec -u "username" -p "pwd11"  cmd /c "copy \\111.11.1.11\D$\Myfiles\archive C:\downloadedfiles"
this is what I did
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

arnoldCommented:
Not sure why you think you need to use psexec where robocopy might do the trick?

The references do not include whether the user you provide has the requisite access rights to both locations.
 The credentials might have access on one side while being denied access on the other side since it seems that you will be relying on administrative shares to access c$ and d$ based location on separate systems.
1
NVITCommented:
Does it work?
0
Angela4evaAuthor Commented:
not its says bad user name or password but when i
psexec \\11.1.1.1.1. -u username -p "pwd11"  ipconfig
above lien works but not the copy
0
Angela4evaAuthor Commented:
arnold,
Can I create a .bat file with above like command using robocopy. I do not ahve a prefrence as long as I can put teh cmd in .bat file and call from another program.
0
NVITCommented:
Do this. It is similar to my last post but does a DIR. It opens a separate CMD window. If username has rights to folder, D:\Myfiles\archive, you should see the files:

psexec -u "username" -p "pwd11"  cmd /k "dir \\111.11.1.11\D$\Myfiles\archive"

Open in new window

0
NVITCommented:
Without the rights to see D$, it doesn't matter if you use psexec or robocopy.
0
Angela4evaAuthor Commented:
It still says bad username/password, but the thing is I am able to rdp on this server using the same username and password
0
arnoldCommented:
Accessing the system is one thing, accessing the administrative shares requires a higher level of rights.


your best bet is to use RDP to the remote server while attaching your local system drives.  
Then you can use a command window on the remote
robocopy d:\Myfiles\Archive \\tsclient\c\downloadedfiles /E /L
To copy them.
0
NVITCommented:
If I recall correctly, RDP rights are separate from admin rights, which you need in this case.

Can you access the folders by NOT using the drive letter, i.e. by creating a share? If that is an option, do that instead.
0

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
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
Windows Batch

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.