Running a process at startup

crapshooter
crapshooter used Ask the Experts™
on
I am trying to run a process at system startup.  I put an entry in the registry key

HKLM\Software\Microsoft\Windows\CurrentVersion\Run

If I login via the console and GUI, I can see the process running.  If I login via telnet, the process is not running.  It is not just hidden because, if I login via the GUI and have a concurrent session in telnet, I can see the application.

Does anyone have any insight as to why this would be?

Thanks,
Dan
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Hello,

the processes in "Run" will not start when you log in via telnet, it's by design...

if you want to start a custom program after someone logs on to telnet server, here is the solution: https://technet.microsoft.com/en-us/library/cc787871%28v=ws.10%29.aspx

btw, telnet is not secure at all... you may want to use powershell remoting if you want to perform remote administration, etc...: In PowerShell: Enter-PSSession MyComputer

Author

Commented:
So, this was a change from XP to Win7?  I do have it working in an XP scenario.  Further, shouldn't anything in that key run as soon as the system starts regardless of anyone logging in?  That's the point of it being in HKLM instead of HKCU, right?

Commented:
I don't know exactly how Windows XP handles theses keys but here is what Microsoft says:
Run keys cause programs to automatically run each time that a user logs on.
https://support.microsoft.com/en-us/kb/314866

or:
The Run key is processed after every logon, either by the Explorer shell, if it is present
https://msdn.microsoft.com/en-us/library/ms940034%28WinEmbedded.5%29.aspx

if you want, you can create a startup script by GPO: https://technet.microsoft.com/en-us/library/cc779329%28v=ws.10%29.aspx

or create a scheduled task that runs "At startup":
https://technet.microsoft.com/en-us/library/cc748841.aspx
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Author

Commented:
I saw that.  However, I also saw the following:

From: https://technet.microsoft.com/en-us/magazine/ee851671.aspx

Run key (machine) Programs listed in the registry’s HKLM\Software\Microsoft\Windows\CurrentVersion\Run key are available at startup to all users.

Run key (user) Programs listed in the HKCU\Software\Microsoft\Windows\CurrentVersion\Run key run when the current user logs on. A similar subkey, HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows\Run, can also be used.

I may try some of the other methods you have mentioned as well but I am still a little miffed that Microsoft is not being consistent.
Commented:
Yes, but it's subtle:
Run key (machine) Programs listed in the registry’s HKLM\Software\Microsoft\Windows\CurrentVersion\Run key are available at startup to all users.
=> Regardless which user logs on ==> processed after every logon, by the shell (explorer...)


Run key (user) Programs listed in the HKCU\Software\Microsoft\Windows\CurrentVersion\Run key run when the current user logs on
=> When this specific user logs on ==> processed after this user logon, by the shell

Author

Commented:
OK, I'm going to give some of the other options a shot and let you know.
LeeTutorretired
Top Expert 2009

Commented:
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial