Jump to content

Change starttype of windows-service


Recommended Posts

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.

Link to comment
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]

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...