Trevor wrote:
> I have a application running on a Windows Server 2003 system that does NOT
> run as a service and requires that a user is logged on in order for it to
> run. Everything works fine however when I remote desktop into the system with
> the same user that is logged on, it starts a second instance of all the
> programs that that user is running. How do I prevent the applications from
> starting up a second time when I RDP in? Or how can I ensure that only one
> instance of the user can run at a time and if it is already running, to not
> allow other instances to connect or login?
>
> Setting the application to run as a service is NOT an option so please do
> NOT recommend that.
>
> Any assistance is appreciated.
I assume you have this starting via a shortcut in the startup folder or
possibly through a registry setting.
In either case, if you create a batch file, substituting the executable
name for "calc" (which I used in the example), you should be able to
ensure only one copy starts.
@echo off
tasklist | find /i "calc.exe"
If "%errorlevel%"=="1" "calc.exe"
|