RayGeide
asked on
how to open regedit and show key
How can I open regedit.exe and have it show a key from my program? I can open regedit.exe by simply running it, but I also want it to show a certain key, for example, HKEY_CLASSES_ROOT\.bat.
I assume that there must be parameters that can be passed with regedit.exe to do this, but I have experimented with different switches and have found nothing that works.
Fix-It Utilities 2000 by Ontrack does this and I have heard that other programs also do this, so it can be done.
How?
I assume that there must be parameters that can be passed with regedit.exe to do this, but I have experimented with different switches and have found nothing that works.
Fix-It Utilities 2000 by Ontrack does this and I have heard that other programs also do this, so it can be done.
How?
ASKER
Yes, I am well aware of that.
I am writing a program that will work with the registry and a user has asked that I provide with it the ability to open regedit so that the user can see where the key is and what is in it, before deleting it. He mentioned that the program that he is using opens regedit and shows the key. I have Fix-It Utilities and it also does this. I want to be able to do this in my program.
I am writing a program that will work with the registry and a user has asked that I provide with it the ability to open regedit so that the user can see where the key is and what is in it, before deleting it. He mentioned that the program that he is using opens regedit and shows the key. I have Fix-It Utilities and it also does this. I want to be able to do this in my program.
All known regedit command line options:
regedit.exe [options] [filename]
filename Import .reg file into the registry
/s Don't display dialog box when importing .reg files
/e Export registry file
e.g. regedit /e filename.reg HKEY_LOCAL_MACHINE\SYSTEM
/L:system Specify the location of the system.dat to use
/R:user Specify the location of the user.dat to use
/C Compress [filename] (Windows 98)
I think, Fix-It Utilities 2000 install their own regedit utility, that look like windows regedit (most probably instead of it) and then start it with specific parameters. You can find links to alternative regedits at www.regedit.com.
regedit.exe [options] [filename]
filename Import .reg file into the registry
/s Don't display dialog box when importing .reg files
/e Export registry file
e.g. regedit /e filename.reg HKEY_LOCAL_MACHINE\SYSTEM
/L:system Specify the location of the system.dat to use
/R:user Specify the location of the user.dat to use
/C Compress [filename] (Windows 98)
I think, Fix-It Utilities 2000 install their own regedit utility, that look like windows regedit (most probably instead of it) and then start it with specific parameters. You can find links to alternative regedits at www.regedit.com.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
There are some magic things in Windoze that are called DDE and OLE. I can't even begin to think or understand what they mean, but it comes down to the principle that any program can call, start, give orderds and share information with another program that supports this.
So I guess that must be what your Fix-It does. Sorry I can't say anyting constructive though.
So I guess that must be what your Fix-It does. Sorry I can't say anyting constructive though.
ASKER
I knew about the commandline options and I had already determined that Fix-It was actually running regedit.exe and not just immitating it.
I took a look at regmon which does the same thing as Fix-It (just slower). So I looked at the source code and saw that it was indeed running regedit.exe, setting the focus to it, and entering keystrokes to get to the proper key. I rewrote the C code to Delphi and after some more fiddling was able to do it. Thanks inthe for pointing me in the right direction.
I took a look at regmon which does the same thing as Fix-It (just slower). So I looked at the source code and saw that it was indeed running regedit.exe, setting the focus to it, and entering keystrokes to get to the proper key. I rewrote the C code to Delphi and after some more fiddling was able to do it. Thanks inthe for pointing me in the right direction.
Regards,