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
MadshiAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
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 www.regedit.com and there was no answer apart from what i tried already.
(regedit file.reg)
oh for a decent help file ;-)
0
 
intheCommented:
hi madshi,
just create a batch file that look like:

echo off
REGEDIT /s SOME.REG

/s is for silent mode..

i presume you know the layout of .reg files?

my some.reg looks like:

REGEDIT4

[HKEY_CURRENT_USER\Software\MySoftware]
"CheckBox1"=dword:00000001
"CheckBox2"=dword:00000001
"CheckBox3"=dword:00000000
"Edit1"="some text "
"Edit2"="some more text"
"TrackBar1"=dword:00000006
..


Regards Barry
0
 
intheCommented:
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,\
  00,01,10,01,00


do you know what that spells (8bit ;-)
0
[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.
0
 
intheCommented:
hi,
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..
0
 
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...   :-)
0
 
AttarSoftwareCommented:
Odd, as

http://www.zdjournals.com/w9p/9608/w9p9682.htm

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

Tim.
0
 
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.
0
 
intheCommented:
madshi can you send me an example reg file and bat becuase i tried it 3 times once worked and twice didnt ,after reading regedit.com i deleted the one that did by mistake now i dont know what i did to make it work the first time :-(
0
 
chunkdbCommented:
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.
Chuck
0
All Courses

From novice to tech pro — start learning today.