manipulating registry in dos

Hi friends,

I've something in my mind that it was possible to manipulate the registry in dos somehow. Perhaps adding a *.reg file or something like that. I just don't remember how it worked exactly. Thank you...    :-)

Regards, Madshi.
LVL 20
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

intheConnect With a Mentor Commented:
hi mate ,
done some looking and you cannot use regedit from that dos (you can obviously use it from dos boxes in windows though)
its strange because when calling it via bat file before windows loads dos then it starts and says "importing reg file...." as though it is working ,yet when you load windows and check the registry the keys havent been added..

if you reboot to dos and type regedit /?
or just regedit you get a list of the command line params it takes.
i searched the discussion groups at and there was no answer apart from what i tried already.
(regedit file.reg)
oh for a decent help file ;-)
hi madshi,
just create a batch file that look like:

echo off

/s is for silent mode..

i presume you know the layout of .reg files?

my some.reg looks like:


"Edit1"="some text "
"Edit2"="some more text"

Regards Barry
thats strings and dwords and here a binary:

"some value"=hex:01,00,11,00,01,10,00,01,01,10,01,00,01,11,00,11,01,10,10,\

do you know what that spells (8bit ;-)
[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

MadshiAuthor Commented:
Hi Barry...   :-)

And that works in DOS (not DOS-window, but "real" DOS 95/98), too? RegEdit is a 32bit executable, or am I wrong?

Thanx... Madshi.
madshi dont know as dont have real dos (just pretend dos)
i tested it in a dos window ,
do you want to do it from "reboot in dos mode"? i can try that ;-)

can you test and let me know or dont you have real dos either?(no if i remember you have every operating system ever ;-)
if you have real dos ,when your real dos is loaded is windows loaded too?
otherwise youd have to get into the .dat? (main registry)file would'nt you
i was reading the other day actually about calling api's like shellexecute etc from dos(in c) ,but i cant remember if it was pure dos or pretend dos..
MadshiAuthor Commented:
I'm not talking about dos 6.22, I'm talking about the win9x dos. I mean, every win9x computer first boots dos, then after that it loads win9x on top of dos. And *before* win9x loads, I need to manipulate the registry.

Or in simpler words: I want to put a command in the autoexec.bat that manipulates the registry somehow.

I don't think RegEdit works there, because it's a 32bit executable. At least I thought so...   :-)
Odd, as

seems to agree with you Barry that you should be able to add *.reg files from Dos...

MadshiAuthor Commented:
It *DOES* work, I tested it both under win95 and win98. Perhaps the format of your reg file was not correct...   :-)

Thank you, friends!

Regards, Madshi.
madshi can you send me an example reg file and bat becuase i tried it 3 times once worked and twice didnt ,after reading i deleted the one that did by mistake now i dont know what i did to make it work the first time :-(
I run regedit from a logon script to apply or remove registry restrictions depending on user. Correct call from dos environment is:
regedit.exe /s <path> <regfile.reg>
/s will supress the confirmation dialog.
I apply/remove restrictions on IE, control pannel, desktop and such this way. Works in win98, win2k, and WinXP.
All Courses

From novice to tech pro — start learning today.