Jump to content

Recommended Posts

Posted

Hi,

I am having trouble with SC.EXE and Autoit.

If I do this:

$SvcStop = _RunDOS("Net stop COMsysapp")

This works great. If I do this below:

$SvcCfg = _RunDOS("sc config COMsysapp start= auto")

When run, this starts spawning multiple process of the script.

Next I tried:

$SvcCfg = "sc config COMsysapp start= auto"
RunWait(@ComSpec & " /C " & $SvcCfg, "", @SW_HIDE)

When run, this also starts spawning multiple process of the script.

What am I doing wrong?

Thanks

Posted

Hi Merrik,

did you try the service UDF by engine I think this is pretty handy to use.

:)

Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]
Posted

I just tried calling a batch script with SC CONFIG in it and it does the same thing, it just starts spawning multiple instances of the script process.

Posted

I don't know if you are using this command inside a loop, but if yes, then you should know that "net" command pauses the execution until it is finished but "sc" doesn't wait. So the RunWait, _RunDOS functions doesn't make it wait until finish.

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
×
×
  • Create New...