Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to ensure an application run on a server alway, as a service do, but for some reason I can't create a real window service. I would like to have this app running as an user with its own desktop ( not in Session0 ). I know this is kind of worst practice, but I've no other solution. What's the best way in achieving this?

share|improve this question
I say this with all kindness; when you say "I know this is the worst practice, but..." you're already setting yourself up for a major headaches. Is virtualization an option? I.e. have a virtual host running on the server, to do the one job that it needs to do? – Stephan Feb 5 '13 at 20:12
@Stephan: It would be nice not to have to deal with software like this, but it's a sad reality. I have multiple Customer sites where deal with brain-damaged applications like these. It's a roaring pain but something that, as sysadmins, we are often not in control of (don't have source code for the software, can't convince the business to use some other program, etc). Likewise, you may not have the budget or influence to demand the purchase of additional operating system licenses to run the software in a dedicated VM. I like to do things the best way, but sometimes that's not possible. – Evan Anderson Feb 5 '13 at 20:27
@EvanAnderson I could possibly have influence to buy a license, but how this would help me ? Please advice... – Felice Pollano Feb 5 '13 at 21:41
@EvanAnderson software is mine :) I trust it by a security point of view, this is a major drawback but it really save my soul having it working. – Felice Pollano Feb 5 '13 at 21:47
@FelicePollano: The "buy a license" was suggesting that you run a freestanding operating system a a VM with the software running on the console of that VM. This was primarily a response to Stephan's statement "have a virtual host running on the server". – Evan Anderson Feb 5 '13 at 21:51
up vote 2 down vote accepted

Here's an ugly, quick-and-dirty, insecure (and probably inadvisable) solution:

  • Configure the server computer with an AutoAdminLogon as some user with interactive logon capability. Let's call this user "user1".

  • While logged on as that user, create an .RDP file to logon to the server computer and save the credentials for the user account that will host the application you want to run in Terminal Services. Let's call this user "user2".

  • Save the .RDP file into the "user1" "Startup" program group.

  • Save a shortcut to the application you need to start in the "user2" "Startup" program group.

  • Add a shortcut to the both the "user1" and "user2" "Startup" program groups to execute rundll32.exe user32.dll,LockWorkStation to lock the workstation immediately after logon.

When the server boots it will logon as "user1", start the Terminal Services client with saved credentials for "user2", and lock the workstation. The Terminal Services client will logon "user2", start the application you intend to run on its own Session, and then lock the workstation.

This kinda makes me feel dirty.

share|improve this answer
+1 for "This kinda makes me feel dirty." Also ... for when you absolutely positively have to hack the hell out of it. – JamesBarnett Feb 6 '13 at 1:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.