Sign in to follow this  
Followers 0
Briandr

Run or RunWait

7 posts in this topic

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

Share this post


Link to post
Share on other sites



just not executing, but is odd and I think the problem it is executing in (Dell Kace). Outside of the environment it works fine. So I too thought RunWait should be fine too.Just looking at other possible ways to tame this.

Share this post


Link to post
Share on other sites

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.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Come on give me a break. I am always appreciative of the help I get here. I did try it, both ways. Please give me some credit. I am not a jerk on the forums

Edited by Briandr

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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.

Share this post


Link to post
Share on other sites

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.


√-1 2^3 ∑ π, and it was delicious!

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