autoitNOW Posted July 29, 2004 Share Posted July 29, 2004 (edited) I've tried to feed this command- net localgroup "power users" "temp users" /add ...to Autoit and can't get past syntax errors. The quotes seem to keep freaking AutoIt out. If I do get it past AutoIt's syntax checker then the command does NOT work from the command line and I get errors. Can anybody show the right way to get this command past the syntax checker??? Edited July 29, 2004 by autoitNOW An ADVOCATE for AutoIT Link to comment Share on other sites More sharing options...
Andre Posted July 29, 2004 Share Posted July 29, 2004 (edited) hi, perhaps with Chr(34) Good Luck, Dre Edited July 29, 2004 by Andre What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel! Link to comment Share on other sites More sharing options...
emmanuel Posted July 29, 2004 Share Posted July 29, 2004 see faq 7, but here's the answers: run('net localgroup "power users" "temp users" /add') run("net localgroup ""power users"" ""temp users"" /add") "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
autoitNOW Posted July 29, 2004 Author Share Posted July 29, 2004 (edited) Thanks Emmanuel that does work. I was also trying to use the command with (@ComSpec & " /k ") so that I could see the result. Which started me down the road of being freaked out with syntax and quotes. Edited July 29, 2004 by autoitNOW An ADVOCATE for AutoIT Link to comment Share on other sites More sharing options...
Nova Posted July 29, 2004 Share Posted July 29, 2004 Try this RunWait(@ComSpec & " /c " & 'net localgroup [power users temp users {/add', "", @SW_HIDE) Link to comment Share on other sites More sharing options...
autoitNOW Posted July 29, 2004 Author Share Posted July 29, 2004 Hmmmm.... that doesn't seem to work. Plus in your example you hide it, which defeated my purpose of being able to see it. But thanks anyway.... RunWait(@ComSpec & " /k " & 'net localgroup [power users temp users {/add', "", @SW_MAXIMIZE) An ADVOCATE for AutoIT Link to comment Share on other sites More sharing options...
ezzetabi Posted July 29, 2004 Share Posted July 29, 2004 Really. If you a working with the command line dont use " to enclose the data for Autoit use ' that will not force you using double "" that are very confusing. In that case: Run(@comspec & ' /c net localgroup "power users" "temp users" /add') As you can see using ' makes anything much more easy and readable. Link to comment Share on other sites More sharing options...
emmanuel Posted July 29, 2004 Share Posted July 29, 2004 (edited) Thanks Emmanuel that does work. I was also trying to use the command with (@ComSpec & " /k ") so that I could see the result. Which started me down the road of being freaked out with syntax and quotes.oh, ok, and I totally forgot about the @comspec part... run(@comspec & ' /k net localgroup "power users" "temp users" /add') run(@comspec & " /k net localgroup ""power users"" ""temp users"" /add") and I'm with ezzetabi on using single quotes on the outside, much cleaner. just wanted to show you both options. Edited July 29, 2004 by emmanuel "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now