Autoloading a file to the registry on startup

daggs

Distinguished
May 12, 2009
712
0
19,010
hello all,

I have a reg file which I want to load into the registry when ever xp starts up, is there a way to do that?

Thanks.
 
Sure there is a way...

I will show one that puts the command prompt in the context menu of Windows Explorer as an example. This registry tweak lets you get a command prompt by right-clicking a folder in Windows explorer and have it already pointing at that folder. My sample only needs to be done once, but it shows the mechanics of how to do what you want.


The batch file: Regenter.bat (This file is located in the start menu "Startup" folder)

cd \
regedit /s cmd-prompt.reg
exit




The registry file is in the root of the system drive in this example.

The actual Registry file to be installed at startup: Cmd-Prompt.reg


Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\Command]

@="Command &Prompt"

[HKEY_CLASSES_ROOT\Directory\shell\Command\command]

@="cmd.exe \\\"%1\\\""



Your registry file to import is, of course, different. This sample shows how to make that batch file and how to have a .reg file get imported without any user interaction.

Hope this helps.


 
The need to have this registry change at startup is amusing to say the least. If set to run at startup the way I said to do it... it will be done before the desktop even appears with no user input or intervention whatsoever. If it is set to startup via registry "Run" then it will load just a few steps earlier.

You must remember the registry is a database and you're not going to get a program to alter the registry on the fly during startup because Windows would need to be running to invoke that program anyway, so you're not going to accomplish what you set out to do and the help stops here.


 

daggs

Distinguished
May 12, 2009
712
0
19,010
I have xp installed behind a different login manager, I want to define which user xp will auto logon so when I user logs on, doesn't have to go via two login screens and I won't have to install multiple copies of xp on the same computer.

if xp is running, I cannot set which user is it.

the registry change before xp is starting was addressed, I just need a way for tell xp to load the file on first db population.