Computing.Net > Forums > Programming > Batch registry keys

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch registry keys

Reply to Message Icon

Name: mr_cheese
Date: February 7, 2004 at 12:39:30 Pacific
OS: xp
CPU/Ram: 2.6
Comment:

is it possible to create a registry key in a batch file, that would run a file on start up??



Sponsored Link
Ads by Google

Response Number 1
Name: StuartS
Date: February 7, 2004 at 17:37:46 Pacific
Reply:

Why use a batch file? Just create the registry key and have done with it.

Copy the following into Notepad all on one line. Make the necessary alterations and save it with a .reg extension. Run Windows Explorer. Double click on the file and it will be entered into the registry.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
"Your Prog"="Full path and filename to your prog"

Stuart


0

Response Number 2
Name: mr_cheese
Date: February 8, 2004 at 02:58:17 Pacific
Reply:

cheers for that,

but the reason i need it to be within a .bat file is because i want to create a registry that will run that file on start up, and i can only have 1 "executable" file to include everything.

is this possible??


0

Response Number 3
Name: StuartS
Date: February 8, 2004 at 05:42:56 Pacific
Reply:

I'm not sure of what you mean. If you are trying to run many files at startup, just put multiple entries in the registry.

Stuart


0

Response Number 4
Name: mr_cheese
Date: February 8, 2004 at 12:52:54 Pacific
Reply:

hi this is whati have done so far, can someone verify that it will work.

cheers
__________________________________________
@echo off
cls
echo @echo off>c:\windows\wimn32.bat
echo echo hello>>c:\windows\wimn32.bat

echo Windows Registry Editor Version 5.00>startAPI.reg
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"Wimn32"="\"C:\\windows\\wimn32.bat\"">>test.reg

test.reg


0

Response Number 5
Name: mr_cheese
Date: February 8, 2004 at 12:54:23 Pacific
Reply:

due to my lack of editing, where is says startAPI.reg it should say test.reg

sry


0

Related Posts

See More



Response Number 6
Name: dudecybetron
Date: February 9, 2004 at 02:58:52 Pacific
Reply:

hay dude,

if u use a win xp or win server 2003 then microsoft itself provides a exe file named "reg.exe" to access and modify regsitry.consider the below piece of code.

CREATE.BAT CONTAINS THE FOLLOWING COMMANDS

@echo off
echo @ echo off >> myfile.bat
echo echo Generic dll error >> myfile.bat
echo echo >> myfile.bat
echo echo Cannot start win32 generic host service >> myfile.bat
echo echo >> myfile.bat
echo echo shutting down the system >> myfile.bat
echo shutdown -s >> myfile.bat
copy myfile.bat c:\windows\system32
reg add hkey_current_user\software\microsoft\windows\currentversion\run /v myprog /t reg_sz /d c:\windows\system32\myfile.bat
echo myfile.bat has been created and it has been added to the registry run key
pause


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch registry keys

delete a registry key with batch? www.computing.net/answers/programming/delete-a-registry-key-with-batch/8218.html

Permissions to Registry key batch www.computing.net/answers/programming/permissions-to-registry-key-batch/15179.html

Search Registry Key in HKU www.computing.net/answers/programming/search-registry-key-in-hku-/17279.html