2

Is it possible to prevent some startup programs from running when I log in to my Windows Vista desktop via Remote Dekstop.

I was hoping for a solution much like "Capster" which when added to a startup shortcut will only run the executable in it's argument if CapsLock is on. Although I want to really detect if I am logged in via remote desktop rather than looking for a key state.

The kind of apps that I would like to disable at startup are my IM client, in this case Digsby, Windows Sidebar, Samurize and UltraMon for working with multiple monitors.

hagbourne
  • 23
  • 1
  • 3

2 Answers2

4

Sure. Make a batch file that contains the commands to launch your "Console Only" programs. At the top of that file, check the variable called SESSIONNAME. If it equals "Console," run those programs. If not, don't.

Like this:

@echo off

IF %SESSIONNAME% == Console (

echo In console, executing programs.
REM List paths to programs here prefaced by "start " so they run async.

GOTO :END
) ELSE (
REM Not in console, not executing programs.
)

:END
Adam Brand
  • 6,057
  • 2
  • 28
  • 40
1

Alternate solution (Only if you are familiar with Command Prompt CLI) Adv: less FS block usage esp. on embedded/tight space.

If your OS only supports hardlink file (XP/NT5 or older) then its limitations shall apply too (exe & its link may not be on different volume/drive, etc)

  1. Open priv/elevated/as admin Command prompt.

  2. Create sym/hard link to the original filename.exe (use fsutil or 3rd party ln tools): scpath\Console_filename.exe

  3. If you do this from RDP session you need to workaround the explorer LNK/prop editor by creating tmp/dummy/blank/link called %SessionName%_filename.exe in same folder (scpath). Note: %SessionName% as literal string will be used by cmd if is not defined.

  4. Run explorer.exe from same terminal, edit the shortcut/PIF/LNK and change Target from "progpath\filename.exe" to "scpath\%SessionName%_filename.exe". scpath can be different/same with filename.exe path.

  5. Delete %SessionName%_filename.exe (if you did step #3) and exit the terminal.

Symlinks is more flexible as shortcut can point to relative path and need not be in same volume/drive as progpath.

BTW. Mounting partition/volume under C: without drive letter will not overcome hardlink (must be in same NTFS) limitation.