Jump to content
Sign in to follow this  
cottage

Using strings with "Net User" command

Recommended Posts

cottage

Can someone please give me a little help with the following?

RunWait(@Comspec & " /c " & 'net user $username urp@ss /add')

How can I use a string (such as $username) with the above command? I've tried various ways of quoting it, but can't seem to find the right method.

Regards,

Bill :)

Share this post


Link to post
Share on other sites
PerryRaptor

Try this...

RunWait(@Comspec & " /c " & "net user " & $username & " urp@ss /add")

- $username cannot be inside quotes

- note the spaces after "...user " and before " urp@ss..."

Think of it as stringing all together "one" + "two" + 3 + "four"

Share this post


Link to post
Share on other sites
cottage

Try this...

RunWait(@Comspec & " /c " & "net user " & $username & " urp@ss /add")

- $username cannot be inside quotes

- note the spaces after "...user " and before " urp@ss..."

Think of it as stringing all together "one" + "two" + 3 + "four"

<{POST_SNAPBACK}>

Exactly what I needed. Thank you !!! :):D:D

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.