Jump to content

Run or RunWait


Briandr
 Share

Recommended Posts

Would Run as opposed to RunWait be better for this?

RunWait(@ComSpec & " /c net localgroup administrators /ADD " & @LogonDomain & "\PCSupport" ,"",@SW_HIDE)
RunWait(@ComSpec & " /c net localgroup administrators /ADD " & @LogonDomain & "\svcs_ricoh" ,"",@SW_HIDE)

First line executes correctly second one not so much. From the help file it says RunWait runs and executes. Should I do just Run?

Thanks

Link to comment
Share on other sites

  • Developers

Not sure why Run() would solve anything here.

What is the issue with the second line?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Moderators

My question is have you tried it? You're asking if you should use Run or RunWait; I daresay trying it for yourself would take you less time than posting here. Then, if it doesn't work, we can try to assist you in finding out why.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

Using the close session switch, the only difference between the two, I'd imagine, is that if you want to interact with the stdout/in/err, you'd use the Run() scenario, if you're launching and moving on to another part of your script, you'd use the Run() scenario, if you need to wait for the comspec to end before you do something else, you'd use the RunWait() scenario.

Edit:

I just want to iterate, this is my interpretation (and a stab in the dark at helping), I don't play across networks so it may be moot even posting here.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Should I do just Run?

 

My point was that you're being unclear by asking "Should I do just Run", rather than saying "I've tried both ways, and neither is working"

That said, I would change your /c to /k, so you can view the command line window and potentially see why it is failing.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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