skyee Posted January 22, 2008 Share Posted January 22, 2008 DIM $USER $USER=InputBox ( "User", "Enter username:") run("net localgroup Network Configuration Operators domain\$USER /add")^^ this is the code, but it's not functioning. First, I think it doesn't even grab $USER parameter, secondly the command should be like:net localgroup "Network Configuration Operators" domain\$USER /add - note the quotation marks on the group! without them, you cannot add user to that group.I'd appreciate very much for helping me with this piece of code, since I'm a beginner - and have problems as such Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 22, 2008 Share Posted January 22, 2008 DIM $USER $USER=InputBox ( "User", "Enter username:") run("net localgroup Network Configuration Operators domain\$USER /add") ^^ this is the code, but it's not functioning. First, I think it doesn't even grab $USER parameter, secondly the command should be like: net localgroup "Network Configuration Operators" domain\$USER /add - note the quotation marks on the group! without them, you cannot add user to that group. I'd appreciate very much for helping me with this piece of code, since I'm a beginner - and have problems as such Use single quotes to include double quotes in the string. And you won't get variable substitution if it's quoted as a string. So that should be: Run('net localgroup "Network Configuration Operators" domain\' & $USER & ' /add') Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
skyee Posted January 22, 2008 Author Share Posted January 22, 2008 Use single quotes to include double quotes in the string. And you won't get variable substitution if it's quoted as a string. So that should be: Run('net localgroup "Network Configuration Operators" domain\' & $USER & ' /add') Thank you very much! I was so near the solution, heh. Tried to play around with quotation marks myself but as I see I failed miserably ) 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