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

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Chris Kitzmann (ChrisKitzmann_at_discussions.microsoft.com)
Date: 07/16/04


Date: Fri, 16 Jul 2004 08:36:07 -0700

Works great thanks.

"Torgeir Bakken (MVP)" wrote:

> 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: Adding a Key without overwriting what is already there
    ... >> Does it matter if these are in numerical order? ... > On Error Goto 0 ... > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.win2000.registry)
  • Re: Adding a Key without overwriting what is already there
    ... > On Error Goto 0 ... > ' second entry ... > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.win2000.registry)
  • Re: C:WINDOWSsystem32autoexec.nt The system file is not suitabl
    ... Thanks to everyone for your prompt replies. ... > In the command prompt, type in the following two commands exactly as ... > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.windowsxp.configuration_manage)
  • Re: Error number: 0x800A0046
    ... > newsgroup because my dialup network settings had vanished and a guy ... > Notice that the logon account is set to a NT/User account under the RPC ... > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.windowsupdate)
  • Re: opening "owner" files after hard drive failure
    ... >> My hardrive posts a failure warning, and XP Home SP2 crashes soon after ... > that has Administrative rights to have access to the Security tab. ... > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.windowsxp.general)