Jump to content

Using strings with "Net User" command


Recommended Posts

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

Link to comment
Share on other sites

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
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...