Copy Files from Remote RDP to Local Machine [closed]

Is there a way I can launch a RDP session to a remote Windows server, and perform a file transfer to the local computer? Versions of the remote Windows Server varies. Ranges anywhere from 2000 to 2008.

I've tried to look up solutions and it seems scattered everywhere. Some suggest using mstsc.exe, others suggest PowerShell / Java / ASP Net. I'm confused. Appreciate some guidance here.

Thanks!

Update Below: 17 Feb 2012

Thanks for all suggestions. Would like to add that the remote servers are securely locked down and I'm not allowed to install SSH servers, FTP servers, or shared drives. The only way for accessing the remote machine is through RDP, and these machines are also on separate VLANs to which only authorised users can use RDP to access these machines. I'm trying to create a script that can help authorised users to download the required files.


You can map a drive using remote desktop.

Options > Local Resources > More

enter image description here


Ctrl + C at the Remote Desktop, and Ctrl + V at local, if you not looking for any automated solution. (Please check RD Config to enable copy and paste)


Once you have mapped the drives you want using mstsc, you can use \\tsclient to access the file system of the local machine i.e the Terminal services client from which you have RDP'ed on to the remote box.

If all you are trying to do is copy file from a remote box, just do \\machine\c$\path etc or share the folder and do \\machine\share to get them. RDP is not necessary in this case.


Once you have mapped the needed drives as Andy says, you can execute remotely a LOCAL batch file every time you connect specifying it's local path (using \\tsclient\c to refer your local drive) in the Programs tab at RDP properties.
Remember to write cmd /c before that path.
The rdp connection will automatically close once the batch file ends, but you can add the pause command to the end to see what happened during execution.

Connecting this way, you can edit the batch file before connecting.

rdp execute BAT


Make sure your remote Machine enabled PSRemoting by running the following command in PowerShell

Enable-PSRemoting –Force

From the client computer, run the following command to establish the connection.

net use "\\{RemoteIP}\c$" "{Password}" /USER:"{Username}" /persistent:no

Here after you can use Copy-Item, Delete-Item over the network.

Copy-Item [PACKAGEPATH]\* \\[COMPUTER]\c$\installers -recurse