Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
how can i edit the registry from command prompt (batch file) in windows xp. I want the batch file to be able to edit the registry and add something in the startup area to make itself boot when windows does.
im a newb so dont get to complicated, just a simple batch file

You would be better creating a .reg file then just running it. This will insert the entries into the registry. Here is my startp registry entry to get you going. Create the entries that you need and save it as STARTUP.REG.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
"AIM"="E:\\AOLInstantMessaging\\aim.exe -cnetwait.odl"
"CCWC7a"="D:\\TOOLS\\Windows Cleaner XP\\ac.exe"
"Magic Notes"="\"E:\\Magic Notes\\Sticky32.exe\""
"TClockEx"="D:\\TOOLS\\TClockEx\\TCLOCKEX.exe"
"HDDHealth"="D:\\TOOLS\\HDD Health\\hddhealth.exe -wl"Stuart

make a
launch_things.bat
let it read likec:\docume~1\user\mydocu~1\startm~1\bla\shortcut.lnk
c:\docume~1\user\mydocu~1\startm~1\bla\shortcut2.lnk
or make itSet shrtct_folder=c:\docume~1\user\mydocu~1\startm~1\bla
%shrtct_folder%\shortcut1.lnk
%shrtct_folder%\shortcut2.lnk
%shrtct_folder%\shortcut3.lnketc..
make a shortcut to it in your start/programs/startup folder ;Pbatch files and long filename referrings simply dont work together period.
actually its just that any file/folder name with a space in it wont work..so i always use shortnames
to find out short file/folder names (~1)
u need to use names formatted like that else batch wont work
(if you wanna browse your hdd in dos, go start->run->type 'cmd')
(to find out 8 character-file/folder names of files/folders with long names (needed for making your own items)
use these commands
if its your first time browsing your hdd in DOS it helps to open 'My Computer' on the background)firsttime-cmd-help
C: or D: or E: or F: to access one of your hard disks (depends on how many hdds you have)
dir /x to find out short formatted file/foldernames (needed in batch files)
CD foldername to access one..
CD foldername\foldername\foldername\etc
CD .. to go one folder back up
CD \ to go to the root of the HDDmost dos commands you get help when u type
'command' /?
example:
dir /?
CD /?
etc

ok, i got the whole thing to work, in the batch file, i used ,
c:\docume~1\alluse~1\startm~1\programs\startup\
the one thing i didn't know that i did wrong before was for words with spaces in them (ex : all users) i had to cut down to 6 words and get rid of the space, alluse, then put the ~1 to finish off the 8 character DOS names, so it would be alluse~1
thanks barteld
so for anything with a space in it, just to get rid of the space period.
o and thanks stuart for the registry editing one, thats something new i learned also.

I have tried using the .reg example by stuart which works well except that I get prompts to accept the registry changes. Do you know how I can stop these prompts so that registry changes occur automatically?

![]() |
Com dcom
|
Buffer Overflow in C
|

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