Results 1 to 7 of 7

Thread: Can I remove a service in the registry?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2000
    Posts
    1,463

    Question Can I remove a service in the registry?

    Is there any way to remove a service using the registry?

    I have a program in VB 6 that starts up with the registry. Then in the program you can select to have it start as a service instead and it automatically clears the reg key in startup.

    My problem is when I do an update or another install, it still adds to the registry for startup. If its already set to start as a service, thats my problem. My installer cannot support checking this.

    So I want to delete the service in the registry with my installer and just let them reset it to a service later if needed when they re-install/upgrade.

    Thanks!

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    how about NET STOP ?

    this will stop the service if it's running. couldn't your program just delete the key, with error checking to check if it was not there?
    Last edited by dglienna; Nov 18th, 2004 at 04:56 AM.

  3. #3
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    You should be able to delete straight from:
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  4. #4
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961
    Originally posted by plenderj
    You should be able to delete straight from:
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services
    Is that true for all Windows OS's?

  5. #5
    Fanatic Member cid's Avatar
    Join Date
    Nov 2002
    Location
    Fort Worth, Texas
    Posts
    854
    I was under the impression it was:
    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Current Version\Run

    www.google.com - Pay Tribute.

    Always Listening To: Thrice

  6. #6
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961
    Originally posted by cid
    I was under the impression it was:
    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Current Version\Run
    That is where programs get loaded once a user logs in.

    A service is started before that - when the OS is loaded and before anyone logs in.

  7. #7
    Frenzied Member Ideas Man's Avatar
    Join Date
    Aug 2002
    Location
    Australia
    Posts
    1,718
    Originally posted by plenderj
    You should be able to delete straight from:
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services
    As far as I'm aware, this approach should work with all OSes, though the 98 range may not actually use them.

    Please be aware, editing information in this section is very dangerous, deleting incorrect keys can cause your computer to stuff up completly, as most of the services are Windows ones anyway.
    I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified)

Posting Permissions

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



Click Here to Expand Forum to Full Width