Jump to content

Recommended Posts

Posted

Hello everybody,

I have an installation where I need to stop an existing service before the installation and restart after. I looked at the AI doc and didn't find anything about starting/stopping a service. I guess it's not available yet in the current version ( I hope I'm wrong). I can use "net start <service>" and "net stop <service>" but would like to use an autoit function.

Thanks,

=MX=

Posted

Hi,

is indeed not a default function.

Perhaps post an message in the Idea section ?

Andre

What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
Posted

It is a good idea. But I would even greater if it they'll also non standard commands like "Disable Sevice", or if possible even "Uninstall Service".

Posted

To Ezzetabi,

to Disable service see :

RegWrite("HKLM\System\CurrentControlSet\Services\{servicename}\Start".........

Andre

What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
Posted

If you know you'll only be using WinXP ONLY, try the SC command (Service Controller). Use Windows Help (gasp!) and type A-Z in the search bar, and click on "Command-line reference A-Z" and then on the letter S at the top of the window. SC will be at the top of the list - click on it for the full reference.

Jerry

Posted (edited)

If you know you'll only be using WinXP ONLY, try the SC command (Service Controller).  Use Windows Help (gasp!) and type A-Z in the search bar, and click on "Command-line reference A-Z" and then on the letter S at the top of the window.  SC will be at the top of the list - click on it for the full reference.

Jerry

<{POST_SNAPBACK}>

If you want to remove service see these keys :

regdelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentControlSet\Services\xxxxxxxxx")

regdelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentControlSet\Enum\Root\xxxxxxxxxxxxx")

where the x are service name.

To stop the service :

RunWait(@ComSpec & " /c " & 'net stop <service>', "", @SW_HIDE) works fine.

chees

Edited by kristoff
Posted

If you want to remove service see these keys :

regdelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentControlSet\Services\xxxxxxxxx")

regdelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentControlSet\Enum\Root\xxxxxxxxxxxxx")

Er, maybe you mean:

"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services"

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
  • 1 month later...
Posted

Larry,

Could you expound upon your comment of trapping the return code when using the "Net Stop" command to stop a service. As an example, stopping and then restarting the "Spooler" service. Obviously there should not be an attempt to restart the service until it has completed a stop. I would be interested in seeing an example of AutoIT using the return code to test a 'Pass' / 'Fail' type of scenario.

Thanks,

ZK

Posted

If you know you'll only be using WinXP ONLY, try the SC command (Service Controller).  Use Windows Help (gasp!) and type A-Z in the search bar, and click on "Command-line reference A-Z" and then on the letter S at the top of the window.  SC will be at the top of the list - click on it for the full reference.

Jerry

<{POST_SNAPBACK}>

or, if you're not just using XP, try using SysInternals' PsService

"I'm not even supposed to be here today!" -Dante (Hicks)

Posted

a friend of mine uses vbscripting to stop, verify, start, verify services. you could probable write a vbscript and then launch it with a runwait from autoit. Apparently vbscript will work on 2000, XP, 2003, and NT if scripting patch is installed.

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
  • Recently Browsing   0 members

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