Sign in to follow this  
Followers 0
DeltaVictorLima

Change starttype of windows-service

3 posts in this topic

Hello,

I wrote an AutoIt-script which reads

"HKLM\System\CurrentControlSet\Services\SharedAccess", "Start"

If this entry = 4 (disabled), I change it to "3" (manual).

Then I execute the following command to start the Windows-Firewall:

RunWait( @ComSpec & ' /c net start SharedAccess', @ScriptDir)

That doesn't work (I get returncode 2)

But when I manually change the start-type from "disabled" to "manual" before starting my script, it can start the Windows-Firewall, (returncode=0)

Can somebody please tell me what else I have to do to sucessfully change the starttype of the Windows-Firewall from "disabled" to "manual"? Changing the registry-entry doesn't seem to be enough.

Hon.

Share this post


Link to post
Share on other sites



Welcome to the forum.

It has been a while since I looked into doing what you are doing with services. You can either use this User Defined Function (UDF) as is...

http://www.autoitscript.com/forum/index.php?showtopic=6487

... or study it to see what parts of it you can use.

Post back if you have trouble with the UDF or your script.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Thanks, I'll try that.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0