|
-
Jul 27th, 2005, 07:32 PM
#1
Thread Starter
Frenzied Member
-
Jul 27th, 2005, 08:23 PM
#2
Re: Corrupted Service cannot be removed from SCM
You can uninstall the service but sometimes you need to reboot before the changes update in the SCM.
VB Code:
Public Function UnInstallService() As Boolean
Dim hSCManager As Long
Dim hService As Long
Dim lRetVal As Long
hSCManager = OpenSCManager("ComputerName", vbNullString, SC_MANAGER_CREATE_SERVICE)
hService = OpenService(hSCManager, SERVICE_NAME, SERVICE_ALL_ACCESS)
lRetVal = DeleteService(hService)
CloseServiceHandle hService
CloseServiceHandle hSCManager
If lRetVal = 1 Then
UnInstallService = True
Else
UnInstallService = False
End If
End Function
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 27th, 2005, 10:27 PM
#3
Thread Starter
Frenzied Member
Re: Corrupted Service cannot be removed from SCM
THanks RD, I will try it
... hmm... but I can't view the property page of this particular service already... so I don't know its name 
I tried shutting down a couple of times but this particular pain of a service is still there.
-
Jul 27th, 2005, 10:29 PM
#4
Re: Corrupted Service cannot be removed from SCM
Probably because some of the registry settings are now missing. Hopefully the DeleteService API wil overcome this (holding breath and crossing fingers...).
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 27th, 2005, 10:46 PM
#5
Thread Starter
Frenzied Member
Re: Corrupted Service cannot be removed from SCM
Hmmm... okie will try later. 
I deleted the registry settings because... that's what adam said.. it would do remove the service...
I'll try this code ('cause I'm doing a rushed project today) but if it won't do, then I might just have to live with it (anyways it is not my laptop *evil laugh*)...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|