Link to home
Start Free TrialLog in
Avatar of acetate
acetate

asked on

win2k domain - delete registry key upon login

hello,

i want to delete a HKEY Current USer registry value with a login script, can anyone provide the syntax please?

thanks
Avatar of paraghs
paraghs
Flag of India image

Here is what I do :

1. Download ftp://ftp.mountpoint.ch/pub/users/flo/regdel.zip.
Extract file regdelw.exe from it, and put it under %windir% (Windows directory).
2. In the startup folder (%userprofile%\Start Menu\Programs\Startup), create a text file and put this line into the file :
regdelw "give_here_the_key_to_be_deleted" /q /n
3. Save this file with any name, and extension of either .bat or .cmd
SOLUTION
Avatar of TheMCSE
TheMCSE

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'm assuming you already know how to merge a reg file via login script. Here is the syntax to remove keys and values using a reg file.

Of course you know that to add a new value and data, you structure the file like this:

REGEDIT4

[HKEY_CURRENT_USER\DummyKey]
"NewValue"="NEWDATA"

If you want to delete a value, create a reg file with the value you're after and add a minus sign after the equals. In other words, replace the value data with a minus sign, like this:


REGEDIT4

[HKEY_CURRENT_USER\DummyKey]
"NewValue"=-

If on the other hand you want ot delete a entire key, add a minus sign before the key name [but inside the brackets] like this:

REGEDIT4

[-HKEY_CURRENT_USER\DummyKey]

Of course, if all you want to do is remove the data but not the key or the value, it would be:

[HKEY_CURRENT_USER\DummyKey]
"NewValue"=""

Oops! this is a Windows 2000 question! The proper header for the file should be:

     Windows Registry Editor Version 5.00

instead of

     REGEDIT4

(although both will work)

And also sorry for the spelling and grammar errors...
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial