Re: URGENT!!! Removeing entries inside a key?
From: Chris Kitzmann (ChrisKitzmann_at_discussions.microsoft.com)
Date: 07/16/04
- Next message: Chris Kitzmann: "Re: Adding a Key without overwriting what is already there"
- Previous message: Chris Kitzmann: "Re: File Type Association"
- In reply to: Torgeir Bakken \(MVP\): "Re: URGENT!!! Removeing entries inside a key?"
- Messages sorted by: [ date ] [ thread ]
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
>
- Next message: Chris Kitzmann: "Re: Adding a Key without overwriting what is already there"
- Previous message: Chris Kitzmann: "Re: File Type Association"
- In reply to: Torgeir Bakken \(MVP\): "Re: URGENT!!! Removeing entries inside a key?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|