Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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 want to run an application every time I log on to a remote machine with windows XP's remote-desktop. I set up a schedule using XP's scheduled tasks and the start up modiier ONLOGON (and also tried ONSTART).

However nothing happens when I connect to the machine - and also nothing in the schtasks logs.

With a given time or manually the application can be started via scheduled tasks without problems!

EDIT: It's only working after I logged out explicitly. But when I just close the remote connection and then connect again, the app won't be called.

Background: I try to use BgInfo to print out system infos on the desktop, which shall be refreshed when to user logs on to the system.

share|improve this question

Problem solved. Of course ONLOGON only works when I really 'log on'. But when I close the remote connection without logging out, I stay logged in and just lock the session - so that's the reason the schtask didn't get executed. Misunderstanding from my side.

The other thing was that bginfo wrote its infos to the desktop wallpaper when I logged in. but after I closed the connection and reconnected, the wallpaper was gone. That can be fixed my configuring the remote desktop connection. There is an option at "Advanced" for Allowing Desktop - so that a user logged in remotly shall change the background!

share|improve this answer

Just put the application in the startup folder in the Start Menu for all users. There is a way of programatically testing if the user is on a remote desktop connection or local if you need to, but it's been a long time since I last had to do that.

share|improve this answer
doesn't help me exactly. This is only working when a user logs out on the remote machine and then connects to the machine again. (but this also works with the schtask). But when the remote connection is just closed and then reconnected, the app doesn't get executed! – räph Feb 23 '10 at 12:20

Try setting up your BGInfo like this instead of as a scheduled task:

Create small script with

c:\bginfo\bginfo.exe /i:c:\bginfo\bginfoservers.bgi /timer:0 /accepteula

Change the path as necessary. Save it as BGinfo.cmd

Then create a shortcut to BGInfo.cmd and place it in the All User startup folder. This will run whenever someone connects to the server. You can get to the All User startup folder by going to the start menu, choosing all programs, right-clicking on Startup and choose explore all users.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .