Sign in to follow this  
Followers 0
Merrik

SC.exe & Autoit problem

5 posts in this topic

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

Share this post


Link to post
Share on other sites



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]

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

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