VB Script deleting Registry Keys
Results 1 to 6 of 6

Thread: VB Script deleting Registry Keys

Hybrid View

  1. #1
    Registered User
    Join Date
    Jul 2000
    Location
    Brandon, FL U.S.A.
    Posts
    300

    Post VB Script deleting Registry Keys

    I am writing a VB Script that makes all of the registry tweaks for my network upon login. I am attempting to delete a REG_SZ key. It is not named by default though. How do I delete an un named key? I tried the <No Name> that is displayed, doesn't work. I am sure this is real easy, can someone push me along?

    I am using the following syntax:
    msettings = "HKCR\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\"

    ' Delete old String Value
    old = msettings & "<No Name>"
    wshshell.RegDelete old

    ' Write new string value
    icon = msettings & ""
    user = "%USERNAME% on %COMPUTERNAME%"
    wshshell.RegWrite icon, user, "REG_EXPAND_SZ"
    Life is 10% what happens to you and 90% how you react to it.

  2. #2
    Junior Member
    Join Date
    May 2001
    Location
    A Pit/Cave
    Posts
    7

    Post

    Whew, okay, been awaile since ive been down and dirty with the registry in VB, much less vb script... hmm. i have a great idea... check the web. www.altavista.com search for "+ vbscript + registry + delete" it should get you started. (if you really mean vb just remove the script part and add some more specifics

  3. #3
    Registered User
    Join Date
    Jul 2000
    Location
    Brandon, FL U.S.A.
    Posts
    300

    Post

    My problem is not due to lack of reading and searching. I have looked all over, and have yet to come across anything that deals with deleting an un-named key. Not saying its not out there, but I haven't found it yet. And I am kinda in a time crunch now, that's why I posted it. I know that it can be done, and I know that there is someone on Windrivers that knows how to do it. I am still looking, but some help from my brothers/sisters would be very much appreciated. Where are you Sorry_I_Win?? You are one of the registry Gurus, hook me up.
    Life is 10% what happens to you and 90% how you react to it.

  4. #4
    Registered User Deity's Avatar
    Join Date
    Mar 2001
    Location
    Elsewhere
    Posts
    1,412

    Post

    http://planet-source-code.com/xq/ASP/lngWId.1/qx/vb/

    This web site has a link to a list of registry programs. There are over 150 different listings there, I'm sure one of them has an answer to your question. I wish I could help you myself, but that's an area of VB I haven't touched on yet.

  5. #5
    Registered User
    Join Date
    Jul 2000
    Location
    Brandon, FL U.S.A.
    Posts
    300

    Post

    Thanks, I'll check it out.

  6. #6
    Registered User
    Join Date
    Jan 1999
    Location
    London, Great Britain
    Posts
    300

    Post

    You may also want to check out the Microsoft RegObj DLL as this exposes the registry as a class.

    You could set the key to the point you require, then you are given all the child objects as a collection. This would enable you to loop through all of these keys, deleting the ones you wanted to.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •