Jump to content

SC.exe & Autoit problem


Recommended Posts

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

Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

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