Accessing Remote Desktop and Copy file from Remote Desktop to Local System using xcopy?

0

I am using Windows OS and accessing Windows server through a remote desktop connection. I want to run a exe file on Remote Desktop and store the results in a .csv file. Now I want to copy that result file from remote Desktop to Local system.

I am using below command to connect to Remote Desktop and run exe file.

psexec \\IP_Address -u User_name -p password -c "C:\Users\vinodh\Desktop\Test.exe"

When I execute above command the test.exe will be copied to Remote Desktop and then the exe file will run and store the results in csv file. Now I want to return that result file back to local system.

There are similar questions but dint find answer for my question. So please help me with the relevant solution and example.

Vinodh Gowda

Posted 2019-04-01T17:56:28.703

Reputation: 15

Usually, if you can Remote Desktop into a system, then you can access a Shared Folder on that system. I suggest creating a folder "Shared" on the host, sharing it to the guest, and then saving the file to the UNC path. If you have a network drive, then you might make a dedicated shared folder there instead. – Christopher Hostage – 2019-04-01T18:25:29.300

@ChristopherHostage I want to copy the files using xcopy or any other powershell commands. – Vinodh Gowda – 2019-04-01T18:32:53.443

Exactly. When saving (or copying the file using xcopy or powershell) , use the UNC path of the shared folder. – Christopher Hostage – 2019-04-01T18:37:22.577

@ChristopherHostage I am new to powershell. Can you please explain how to do that? – Vinodh Gowda – 2019-04-01T18:48:36.103

No answers