Sign in to follow this  
Followers 0
Tigerweld

kill process

11 posts in this topic

I have a service I need to kill (sygate firewall) prior to install an app, but I cannot get it to die using the processclose function.

Under service I have

Display name: Sygate Security Agent

Service name: SmcService

Path to Excutable: C:\program files\sygate\ssa\smc.exe

Help!

Share this post


Link to post
Share on other sites



Thats becuase a service is not a process.

Use _StopService().

Share this post


Link to post
Share on other sites

Thats becuase a service is not a process.

Use _StopService().

I must be doing something wrong. I figured out I need to use the #include "ServiceControl.au3". I have this in the same folder as my projects, does it need to be somewhere else? I tried use _StopService(SmcService) and I get a build error.

C:\Documents and Settings\tscott\My Documents\auto it scripts\killProcess.au3(3,24) : ERROR: syntax error
_stopService(smcService)
~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\tscott\My Documents\auto it scripts\killProcess.au3(3,24) : ERROR: _StopService() called with wrong number of args.
_stopService(smcService)
~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\tscott\My Documents\auto it scripts\ServiceControl.au3(157,49) : REF: definition of _StopService().
Func _StopService($sComputerName, $sServiceName)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\tscott\My Documents\auto it scripts\killProcess.au3 - 2 error(s), 0 warning(s)

Share this post


Link to post
Share on other sites

I must be doing something wrong. I figured out I need to use the #include "ServiceControl.au3". I have this in the same folder as my projects, does it need to be somewhere else? I tried use _StopService(SmcService) and I get a build error.

C:\Documents and Settings\tscott\My Documents\auto it scripts\killProcess.au3(3,24) : ERROR: syntax error
_stopService(smcService)
~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\tscott\My Documents\auto it scripts\killProcess.au3(3,24) : ERROR: _StopService() called with wrong number of args.
_stopService(smcService)
~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\tscott\My Documents\auto it scripts\ServiceControl.au3(157,49) : REF: definition of _StopService().
Func _StopService($sComputerName, $sServiceName)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\tscott\My Documents\auto it scripts\killProcess.au3 - 2 error(s), 0 warning(s)

Func _StopService($sComputerName, $sServiceName) ??????


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

awe rats, do I have to put the computer name in the func? It will be used by many computers, do I have to do it for each?

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

If you looked in the helpfile...

@ComputerName

Edited by JustinReno

Share this post


Link to post
Share on other sites

If you looked in the helpfile...

@ComputerName

It's official. I'm lost. I looked in the help file, not sure of what I'm looking for. I assume I have to use @computerName and the service name somewhere in the ServiceControl.au3???

:)

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

They are referred to as "macros" in the help file

When you use a function, like the _StopService() function, you have to supply it with the right arguments.

In this case call it like this

_StopService(@ComputerName, "smcService")
Edited by SpookMeister

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Share this post


Link to post
Share on other sites

They are referred to as "macros" in the help file

I understand the @computerName is a macro. I just want to stop a service. I don't know why it is so difficult. It has been too long a day!

Share this post


Link to post
Share on other sites

oops, I added more info to my earlier post... see if that answers your question.


[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Share this post


Link to post
Share on other sites

ah, now I understand! That is all I needed. Thanks SpookMeister!

sweet!

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