Jump to content
Sign in to follow this  
Merrik

SC.exe & Autoit problem

Recommended Posts

Merrik

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
hannes08

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
Merrik

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
tkocsir

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
spudw2k

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.