Jump to content

Some InputBox help please


skyee
 Share

Recommended Posts

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 :D

Link to comment
Share on other sites

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 :D

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')

:P

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

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')

:D

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 :P)
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...