Using Remote Desktop Like A Pro

By Lawrence

iStock_000000624836XSmallWindows has two powerful features that Microsoft does not want you to know but they have to be there to make Windows functional. First, it is its ability to allow multiple users logged in with applications running that are completely independent and (sort of) secure from the other users. This feature is called Fast User Switching. Second, Windows let you remote login easily to work on your computer using its Remote Desktop Connection (RDP) service. By combining these two features together, you can do many amazing things with Windows as if you are using a high-end server level computer.

For this article, you have to be comfortable with command line prompt and some understanding of the Windows command files.

The Constrain

Microsoft has imposed a restriction on Remote Desktop Connection to a single connection. That means you cannot have 2 persons logging in to the same computer remotely at the same time. Exceptions to this rule are the enterprise editions and the most expensive editions of every generation of Windows . It is done for a very good reason though. If there is no such restriction, the support cost will skyrocket as people taking advantage of this business level feature may not be tech savvy enough to setup their Windows correctly.

Microsoft has also disabled the Fast User Switching feature by default so that one user logging off from the computer will automatically lead to shutdown of the active applications used by that user. This standard behaviour is necessary because having multiple users logged in on the same computer sometimes can have undesirable effects. For example, if you are using a computer for trading while another person logging in to the same computer to open the same trading application that you are using, it may mess up your connection to your broker because the application may not be multiple users friendly or multiple instances friendly. Thus you have to experiment with your trading platforms to find out if they will work properly in a multiple user environment.

How To Enable The Fast Switching Feature

Windows XP

http://support.microsoft.com/kb/279765

Windows 7 (and Vista)

http://windows.microsoft.com/en-ca/windows7/switch-users-without-logging-off

Windows 8

User Switching should be enabled by default.

The Applications

1. As mentioned in How To Setup A Computer For Automated Trading (Part 2), at times Windows will be so messed up that you lose control on the account that is currently logged in. With RDP, you can backdoor into the computer and gain back control of the computer quickly.

2. There is really no need of multiple computers when you are using multiple brokerage applications for automated trading. All you need is to setup multiple user accounts in Windows so that you can launch these applications separately in each user account.

3. Each user account in Windows is associated with its own start up sequence meaning that you can kick start different types of work you need to get done by simply logging on to the account either locally or remotely.

4. A log off / log on sequence on an user account is as good as a normal manual restart of Windows. Scheduling user log off / log on is tricky but doable once you have seen how it is done.

As a whole, if you have a decent middle to middle-upper end Windows computer on hand, you can turn that into a workhorse carrying out all kinds of routine task for you by creating your own army of worker bots.

Unlock The Power Of Remote Desktop By Executing RDP With Command Files

The main problem for most people in taking advantage of the multiple users capability is that they have to login to each user account manually. That means they have to login to one account, choose switch user in Windows and repeat the process for every users they want to activate. It is not really practical and definitely achieved the goal of discouraging people from using these powerful features.

To resolve this issue, you can create Windows command file that you can launch easily from your desktop or scheduled task to auto login for you onto the worker computer.

All it takes are 2 lines in your command file to launch RDP and login to your worker computer in 1 step,

cmdkey.exe /generic:TERMSRV/target_computer /user:user_name /pass:password
start mstsc.exe /v:target_computer /w:1280 /h:1024

If your intention is to simply login to the computer and let it do its automated tasks while you are going to login to the other accounts, you need to close the remote session with the following 2 lines,

ping -w 20000 127.0.0.1
taskkill /im mstsc.exe /f

Notice that closing the remote connection does not logout the user and all the applications the user is running will continue to run. The reason why you need to close the session first is that Windows will not allow simultaneous RDP connection for the regular versions of Windows.

If you happens to have Enterprise edition of Windows installed on the worker computer, you will be able to logon to all the users simultaneously. The advantage of this is that you can share the computer among multiple people in different locations. It becomes very handy when there is a need to share massive among of data on the same computer.

The individual login command files you have created for each user account can be chained together in a batch file to completely automate your login sequence.

Virtual Machine Alternative

Some people may suggest using virtual machines (VM) like VMware to do something similar. I find that virtual machines themselves eat up too much CPU power leaving too little for the applications I like to work with. It is also more expensive as you have to acquire multiple Windows licenses for each instance of VM when you are working with something like VMPlayer.

The other problem with using VMs is that if I choose to change the basic setup of the computer I need to do that on every VM I have already deployed. It takes more time than necessary comparing to setting up just one computer.

Another advantage of having one Windows with multiple users is that memory usage is way more efficient than having multiple VMs running on the same computer.

End Notes

There are many ways to utilize this neat trick to turn a regular Windows computer into a semi-server workhorse. This solution is pretty elegant comparing to the alternative of having 5 to 6 computers laying around. As a minimum it is energy efficient and maintenance of a single computer is definitely less time consuming.

  • You must be logged in to comment. Log in