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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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 ;-)
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.
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

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...   :-)
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 ;-)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.