Sign in to follow this  
Followers 0
byteme

Send Command In Command Line

3 posts in this topic

Hi everyone. I have a little problem. Could anybody tell me how I can get this to work? I have a script that at one point needs to open a command prompt and type the following:

net localgroup administrators "whatever\domain admins" /add.

my problem is getting the " marks around the whatever\domain admins...

how can I do this using the send command, or is there a much better way of doing this without even opening the dos prompt and have the user see the typing? I appreciate any help anyone can give me. Thanks all!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Use "" instead of a single "

Or try the following:

'net blablabla "' & $group & '" /add'
'net blablabla "domain\user name" /add'

Edit Should have read your full post first...

Try this:

RunWait('net blablabla "' & $user & '" /add', "", @SW_HIDE)
Edited by sugi

Share this post


Link to post
Share on other sites

Better:

RunWait(@ComSpec & ' /c ' & 'net localgroup administrators "whatever\domain admins" /add', '', @SW_HIDE)

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