Re: URGENT!!! Removeing entries inside a key?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Torgeir Bakken \(MVP\) (Torgeir.Bakken-spam_at_hydro.com)
Date: 07/16/04


Date: Fri, 16 Jul 2004 17:06:08 +0200

Chris Kitzmann wrote:

> This is VERY URGENT for a rollout.
>
> I was wondeirng how I would go about removeing certain entries inside a key?
> Below is the data that I what to remove from the entry.
>
> \\Bmkc1alsol01\ESTeam6\Setup\Lisp Files;\\Bmkc1alsol01\ESTeam6\Setup\Steel.lsp Files;\\Bmkc1alsol01\ESTeam6\Setup\Menu Files;\\Bmkc1alsol01\Process\ZRegion\Research\Lisp;\\bmkc1alsol01\Process\ZRegion\Custom_Details\Z Details;\\bmkc1alsol01\Process\ZRegion\Custom_Details\Custom Details;
>
> This is the actual entry that I have. I only want to remove the above
> entries without removeing anything else. PLEASE HELP.
>
> Name:
> [HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R15.0\ACAD-1:409\Profiles\<<Unnamed Profile>>\General]
>
> Data:
> \\bmkc1aleng\ESTeam6\Setup\Lisp Files;\\Bmkc1alsol01\ESTeam6\Setup\Lisp Files;C:\ACAD2000\Support;\\bmkc1alsol01\ACAD2K\ACAD2000\support;C:\ACAD2000\fonts;\\bmkc1alsol01\ACAD2K\ACAD2000\Fonts;C:\ACAD2000\Help;\\bmkc1alsol01\ACAD2K\ACAD2000\Help;C:\ACAD2000\Express;\\Bmkc1alsol01\acad2k\ACAD2000\express;\\bmkc1alsol01\ProgramFiles\Butler\Acad2k\Lisp;\\bmkc1alsol01\ProgramFiles\Butler\Acad2k\Symbols;\\bmkc1alsol01\ProgramFiles\Butler\Smart;\\bmkc1alsol01\std_drawings;\\bmkc1alsol01\std_drawings\Cadlib;\\Bmkc1alsol01\Process\ZRegion\Custom_Details\Z Details;\\Bmkc1alsol01\Process\ZRegion\Custom_Details\Custom Details;\\Bmkc1alsol01\ESTeam6\Setup\Steel.lsp Files;\\Bmkc1alsol01\ESTeam6\Setup\Menu Files;\\Bmkc1alsol01\Process\ZRegion\Research\Lisp;\\bmkc1alsol01\Process\ZRegion\Custom_Details\Z Details;\\bmkc1alsol01\Process\ZRegion\Custom_Details\Custom Details;\\bmkc1aleng\ESTeam6\Setup\Steel.lsp Files;\\bmkc1aleng\ESTeam6\Setup\Menu Files;\\bmkc1alsol01\Process\ZRegion\Resear
ch\Lisp;
Hi

As I see from your other posts in this thread you want to remove
some entries inside the *value* (and not key) with the name ACAD.
This you can't do with a registry file, you can only use a registry
file to delete a key or value completely.

Below is a VBScript file that should do the job.

Also note my recent response to your question in the
"File Type Association" post.

'--------------------8<----------------------

' do not add a trailing semicolon on the paths below!
aPaths = Array( _
           "\\Bmkc1alsol01\ESTeam6\Setup\Lisp Files", _
           "\\Bmkc1alsol01\ESTeam6\Setup\Steel.lsp Files", _
           "\\Bmkc1alsol01\ESTeam6\Setup\Menu Files", _
           "\\Bmkc1alsol01\Process\ZRegion\Research\Lisp", _
           "\\bmkc1alsol01\Process\ZRegion\Custom_Details\Z Details", _
           "\\bmkc1alsol01\Process\ZRegion\Custom_Details\Custom Details")

Set oShell = CreateObject("WScript.Shell")

sRegValueName = "HKCU\Software\Autodesk\AutoCAD\R15.0\ACAD-1:409" _
                & "\Profiles\<<Unnamed Profile>>\General\Acad"

On Error Resume Next
sRegValueData = "" ' init value
sRegValueData = oShell.RegRead(sRegValueName)
On Error Goto 0

If sRegValueData <> "" Then

    For Each sPath In aPaths
       'WScript.Echo sPath
       ' replace value that is surrounded with quotes
       sRegValueData = Replace(sRegValueData, """" & sPath & """;", "")
       ' replace value that is not surrounded with quotes
       sRegValueData = Replace(sRegValueData, sPath & ";", "")
    Next

    oShell.RegWrite sRegValueName, sRegValueData, "REG_SZ"

End If
'--------------------8<----------------------

-- 
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/community/scriptcenter/default.mspx


Relevant Pages

  • Re: URGENT!!! Removeing entries inside a key?
    ... > Windows Registry Editor Version 5.00 ... Below is the data that I what to remove from the entry. ... > entries without removeing anything else. ...
    (microsoft.public.win2000.registry)
  • Re: Windows Hotfix question
    ... > Windows 'Hotfix' entries, all of which are noted as not taking up any MB, ... Remove Hotfix Backup files and the Add/Remove Programs Registry Entries ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.windowsxp.general)
  • Re: What do you think of registry mechanic?
    ... say Registry Mechanic is as good a product of the type as any. ... Even although I do use System Mechanic to remove redundant entries in the ... problem but I also use ERUNT to backup the Registry as I believe everyone ... > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.windowsxp.general)
  • Re: URGENT!!! Removeing entries inside a key?
    ... >> This is the actual entry that I have. ... >> above entries without removeing anything else. ... > If the required data is known and fixed. ...
    (microsoft.public.win2000.registry)
  • Re: Corrupt WindowsUpdate registry
    ... > entries per folder in the WindowsUpdate directory. ... > I've been trying to reinstall Service Pack 2 after a Repair which rendered ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.windowsupdate)