Control services behavior through .reg files

Z

zzz

Hi,

with windows xp i used to have my .reg file to control the startup type of the
services, so that i didn't had to manually do it every time i had to reinstall.
Now with Windows 7 it looks like it's no longer possible to do that since they
keep having the same startup type even though the settings in the reg file
should disable them. My reg file looks like this:


Windows Registry Editor Version 5.00


[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\WSearch]
"Start"=dword=00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\TrkWks]
"Start"=dword=00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\FontCache3.0.0.0]
"Start"=dword=00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\WMPNetworkSvc]
"Start"=dword=00000004


Should i just use the sc command or is there a way to use the reg files?
 
S

Seth

zzz said:
Hi,

with windows xp i used to have my .reg file to control the startup type of
the
services, so that i didn't had to manually do it every time i had to
reinstall.
Now with Windows 7 it looks like it's no longer possible to do that since
they
keep having the same startup type even though the settings in the reg file
should disable them. My reg file looks like this:
Should i just use the sc command or is there a way to use the reg files?
Depends on how you are launching the .REG file (UAC constraints and all).

My pick would be to do the work via a CMD file calling SC or make the move
to PowerShell.
 
Z

zzz

Thanks for the answer.
I can see the uac prompt and i choose yes but it still doesn't work... how do i
do that with powershell?
 
S

Seth

Thanks for the answer.
I can see the uac prompt and i choose yes but it still doesn't work... how
do i
do that with powershell?
Well if you insist on doing it via direct registry edits an example of that
code in a PS1 file would be (this particular code is for changing the
networking mode on a Med-V guest)...

$RegKey ="HKLM:\SOFTWARE\Microsoft\Medv\v2\VM"
Set-ItemProperty -path $RegKey -name NetworkingMode -value BRIDGED

For doing the equivalent of the SC process... (see
http://technet.microsoft.com/en-us/library/ee176963.aspx)

Set-Service spooler -startuptype Automatic
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top