Jump to content

RunWait net start command


Recommended Posts

Help! This is driving me nuts!

If I run the command

RunWait ('net start "symantec antivirus"', @SW_HIDE)

or

RunWait (@SystemDir & "\net.exe start " & '"symantec antivirus"', @AppDataCommonDir & "\Symantec\Symantec AntiVirus Corporate Edition\7.5\", @SW_HIDE)

or

RunWait (@Comspec & " /c " & "net start " & '"symantec antivirus"', @SW_HIDE)

or

RunWait (@Comspec & " /c " & "net start " & '"symantec antivirus"', @systemdir, @SW_HIDE)

BEFORE the TimerInit() and/or by itself, no problem. If it is run as in the script below, I get "unable to execute the external program, the directory name is invalid"

$t = TimerInit()
While TimerDiff($t) < 30000;do the following until half minute passes
    RunWait ('net start "symantec antivirus"', @SW_HIDE)
    If ProcessExists("RtvScan.exe") Then
    ExitLoop
    EndIf
WEnd
If Not ProcessExists("RtvScan.exe") Then
    MsgBox(48, "Error", "Unable to start Symantec Antivirus service!")
    Exit
    EndIf

Thanks! :evil::)

This signature is computer generated, nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#.......

Link to comment
Share on other sites

As far as I known the second parameter in Runwait is always the workingdir.

So try using:

$t = TimerInit()
While TimerDiff($t) < 30000;do the following until half minute passes
    RunWait ('net start "symantec antivirus"',"", @SW_HIDE)
    If ProcessExists("RtvScan.exe") Then
    ExitLoop
    EndIf
WEnd
If Not ProcessExists("RtvScan.exe") Then
    MsgBox(48, "Error", "Unable to start Symantec Antivirus service!")
    Exit
    EndIf
Link to comment
Share on other sites

That worked. Thanks!

This signature is computer generated, nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#.......

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...