Creating reg files.

Soldato
Joined
20 Jan 2005
Posts
2,722
Location
Whitley Bay
Hi guys.

We have a fairly common issue with some of our users which requires the deletion of a couple of .sys files and a regkey.
I want to create a batch file to delete these automatically rather than guiding them through it or remote accessing the pc.
Trouble is the reg key is a variable value so I'm not sure how to delete it.

As an example the reg key might be:

HKEY_LOCAL_MACHINE\Software\CompanyName\Licenses\123456

but the only bit that is consistant is:

HKEY_LOCAL_MACHINE\Software\CompanyName\Licenses\

Is there a wilcard I can use to delete any subkeys of Licenses regardless of their name?

Cheers

Si
:)
 
deleting the whole key and then re-creating it works. or is that not an option? :p

Code:
Windows Registry Editor Version 5.00

[-HKEY_LOCAL_MACHINE\Software\CompanyName\Licenses]

[HKEY_LOCAL_MACHINE\Software\CompanyName\Licenses]
 
Last edited:
Thanks for that :)

On the same note.
Is there a way of running a .reg file from a .bat so that it looks for the .reg file in the same folder as the .bat?

That's pretty unclear :/

What I mean is if I zip the .reg and .bat into a file and have them extract it to a folder on their desktop (for example) is there a way to tell the batch file to run the fix.reg file in the same directory?
Obviously each person will have a different path to the desktop so it's a pain.

I know I could work around it by getting them to extract the files to c:\ and referencing c:\fix.reg but I was wondering if there was another way.

Cheers
:)
 
Back
Top Bottom