Prev: Do not run at start
Next: User-defined Shortcut keys
From: VanguardLH on 7 Jun 2010 22:23 qq wrote: > Hi All, > > I have a program which need to run at start when user login. The vender, who > develop the program, save a value in registry key under > HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run > > But for some reason, the program did not run at start. In Task Manager, > under Processes tag, I could not find out the program. > > Any body knows why it happened? How to fix the problem? > > Thanks in advance. > And what happens when you take the EXACT command string shown under the Run key and then try to execute it at a command prompt? If the program won't run from a command prompt, it certainly won't run from a command line specified under the Run key. Services are NOT specified by the Run key. Those are commands to load [background] programs and use the same syntax as what you yourself can enter at a command prompt.
From: qq on 9 Jun 2010 10:34 > And what happens when you take the EXACT command string shown under the > Run key and then try to execute it at a command prompt? If the program > won't run from a command prompt, it certainly won't run from a command > line specified under the Run key. Services are NOT specified by the Run > key. Those are commands to load [background] programs and use the same > syntax as what you yourself can enter at a command prompt. > . Yes, I tried it. It works when I execute it at a command prompt. And the program run all the time when I run it at a command prompt and run it from Start > Run. Any suggestion?
From: VanguardLH on 10 Jun 2010 04:03
qq wrote: >> And what happens when you take the EXACT command string shown under the >> Run key and then try to execute it at a command prompt? If the program >> won't run from a command prompt, it certainly won't run from a command >> line specified under the Run key. Services are NOT specified by the Run >> key. Those are commands to load [background] programs and use the same >> syntax as what you yourself can enter at a command prompt. >> . > > Yes, I tried it. It works when I execute it at a command prompt. And the > program run all the time when I run it at a command prompt and run it from > Start > Run. > > Any suggestion? You could alter the command to have any stdout generated by the program saved in a logfile, like: <progfile> >> <progpath>\loadlog.txt where <progfile> is the name of the program's executable file (and should include its absolute path to ensure it gets found) and <progpath> is the folder of wherever program got installed (so the log file gets saved in the same place although you can pick some other location if you want). The ">>" will append the stdout from the program into the logfile so this file will continue to increase in size. If you don't want to see a log of all loads of this program then use ">" which overwrites the file when new content is captured. If the program doesn't generate any standard output for when it errors on attempting to load, this trick won't help as the log file will always be empty. Have you look in the Event Viewer to see if there is an entry showing an error for this program? Clear out all events in the Event Viewer for all categories, reboot, and then check the Event Viewer to see if there was an error recorded. With other programs getting loads, like security software (anti-virus, firewall, anti-spam, etc), it may be possible that there is too long a lag of when a program loads so that a subsequent program can no longer find the first program or whatever it might've created. Have you tried copying the command from the Run registry key, delete that registry key, and create a shortcut in your Startup folder? You can put the shortcut in either your own Startup folder or the one under All Users if you want every Windows account to load that program when the user logs in. If you don't want to pollute your Start folder with another startup program, you can schedule an event in Task Scheduler that loads the program on login. Using either the Startup folder or a scheduled task has the program load later to accomodate any dependency it may have on some other service, process, or data created by some prior program. Could be a timing issue where you have to automatically load the program but do it a bit later. Server programs that run as an NT service are NOT listed in the Run registry key or in your Startup folder. More likely this is a user-level program that runs as a background job and which listens for connections on a port. Yes, that is a server program but it is not a service in Windows. Also, many times when a program is listed in the Run registry key (and sometimes even when added as a shortcut in the Startup folder or added as a scheduled event to run on login), there is supposed to be a command-line parameter to specify that this instance is a special load of the program rather than a load of its GUI for use by the end user. Perhaps the command in the Run registry key got corrupted and a command-line parameter is missing. The manual or documentation for the program should detail if it has any command-line parameters when calling the program's executable file; however, too often developers don't tell to doc folks about parameters or they don't want their users to know about them (that is, there are some command-line parameters that may not be documented). |