Method of managing (copying / deleting / moving, etc.) the files/folders in local and remote Windows machines when connected to the remote Windows machine using Microsoft Terminal Services.
Frequently we transfer files from one Windows machine to another Windows machine, or access the remote desktop of a Windows machine for various reasons.
Maybe copying the setup files or backing up files from a development machine to a test machine, or when we connect to the remote machine, we want to access our local machine (the machine from where we did remote desktop) disks to the remote machine where we did remote desktop.
We can use winscp or secure shell file transfer, etc. There are lots of tools available to do copying. We can even share a folder to do copying. But, each of these has its own limitations and drawbacks. To use the tools, we need to download and install them, and need to be very clear that they won’t harm the machines, etc.
This issue can be solved without installing any tools, or even without creating shared folders, etc. in the local machine.
Using the default mstsc (Microsoft Terminal Service client) the problem can be solved. mstsc is a client for accessing the remote desktop of a Windows machine. Terminal services server should be running in the remote machine to access its desktop.
How to enable Remote Desktop in a Windows Machine
- Open the System Properties. (right-click on MyComputer and select properties or hit win + pause/break keys to view the system properties dialog) the dialog will appear.
- Navigate to the “Remote” tab.
Enable “Allow users to connect remotely to this computer” option.
If there are any issues when accessing the remote desktop of a machine, make sure either firewall is off. Instead of stopping the firewall, add an exception to the firewall for the remote desktop service.
- Go to the control panel –> Windows firewall.
Navigate to the Exception tab and check the “Remote Desktop” option.
- Now open the Microsoft Terminal Services client.
Start –> run –> mstsc /console
Start -> All Programs –> Accessories –> communication –> Remote Desktop Connection
The remote desktop connection client will be opened.
- We need to configure access to the local machine disks in the remote session.
Navigate to the “Local Resources” tab
and select the option “Disk Drives”.NOTE:- Depends on the version of the Windows, the options of selecting the disk drives varies.
In the lower versions you have only the option to select all the drives, but in the newer versions we can specify what disks should participate ( shared ) in the session.
Select the “More” option to select the disk drives.
In the disk drives list, select which disks we want to see in the remote machine, and there is an option to get the disks that get connected to the local machine during the session.
Now the settings are done for the session. If we connect to any remote machine we can access our local drives in that machine.
Connect to any remote desktop of Windows (make sure terminal services is running in that machine).
Once you connect to the remote machine. Go to MyComputer.
We can see the:
- Local disks
- Removable Storage disks
- In the “Other” section, all the disks will be shown
<drive letter> on <hostname of the machine>
Another way of viewing all the remote drives is using the tsclient command.
start -> run -> \\tsclient
It will show the drives that got connected.
With the above procedure we can manage the files (copying / moving/ deleting) both in local and remote machines while we are in remote session itself.
As we are using the built-in tools provided by Microsoft we may not worry about security issues. But, if we use other external tools we may need to think of the security issues.