Link to home
Start Free TrialLog in
Avatar of Chris Michalczuk
Chris MichalczukFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Working -- Script for Automatically delete a registry key when someone logs on

we have ghosted 60 HDDs with XP and rolled out to users. We have a windows 2k server and have one domain called VBI
Unfortunately our CA - Etrust virus software needed a seperate SID to work correctly via the anti virus admin console so we have to go round to each machine and delete a particular registry key

I thought there must be a better way. If we set up a group in Active Directory called "ETRUST" and add users to this group can we write a script ( i cant) that will delete the key in the registry of the computer that they log onto). I'd remove the people once they've done this.

Can anyone help with the script. I've heard of something called kixscripts but wouldn't know how to put this together.
Avatar of jzanette
jzanette

You can do this using ONLY native commands using NTCmdLib.cmd, the Expert NT/2K/XP/K3 Command Library from TheSystemGuard.com.

This library provides three commands for Registry Keys.

   .RegReadKey
   .RegWriteKey
   .RegDeleteKey

The syntax, in a shell script, would be

   CALL \\Server\ReadOnlyShareName\NTCmdLib.cmd /Init /Quiet
   SET "DeleteKey=HKEY_LOCAL_MACHINE\Software\YourKey"
   %.RegDeleteKey%
   %.Call% /Unload

*******

Replace "\\Server\ReadOnlyShareName\" with a commonly available share point for all the subject machines.
Replace "HKEY_LOCAL_MACHINE\Software\YourKey" with the complete registry path to the key you want to delete.

   NOTE:

            This is a VERY DANGEROUS command!  Be careful and
             MAKE SURE that you have set the DeleteKey variable to
             the correct key.  The subject key, including any subkeys
             and all data will be immediately and irrevocably deleted.

*******

The Expert Library provides over 400 such commands using ONLY what is available in a default installation of Windows NT4SP6a, 2000, XP and Server 2003.

More info at (http://NTCmdLib.com)
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

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
at the command prompt type reg /?

you could use reg delete in a standard dos batch script.
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:
Accept dean_dodd's comment as answer

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Leew
EE Cleanup Volunteer
First off, I don't want to step on anyone's toes here, and this is certainly not about the points either (as far as I'm concerned, this question can be PAQed with no points refunded), but even though dean_dodd's and jzanette's answer might have been what chrismichalczuk asked for, this is definitely not what he needs.
Manipulating the registry to get a software running that wouldn't work due to an *incorrectly* *installed* operating system is treating a symptom, not the cause; talk about applying heavy make-up to treat measles. Ghosting an NT4/W2k/XP installation without running sysprep will not only lead to software issues like the one described, it will in addition lead to a complete loss of Microsoft's support for these machines.

The Microsoft Policy Concerning Disk Duplication of Windows XP Installations
http://support.microsoft.com/?kbid=314823