How to Create Admin Accounts Using

SOLVED Discussion in 'Web Design & Coding' started by Comptech, Dec 12, 2011.

  1. Comptech

    Comptech ICT Technican

    Dec 11, 2011
    Likes Received:
    How to create Administrator Accounts Using

    you will need 2 textboxes leave them as default name

    1 Button

    2 Lables

    Label 1 Stating Username
    Label 2 stating Password

    Textbox 1 as username
    Textbox 2 as Password

    set textbox to use system password char

    the following peace of code will add the account as administrator and set a password for that account

    Code Under Button 1;

    On Error Resume Next[FONT=&quot]
    [/FONT] Shell("net user " & TextBox1.Text & " /add")[FONT=&quot]
    [/FONT] Shell("Net user " & TextBox1.Text & " " & TextBox2.Text)[FONT=&quot]
    [/FONT] Shell("net localgroup administrators " & TextBox1.Text & " /add")[FONT=&quot]
    [/FONT] MsgBox("The new user," & TextBox1.Text & ",has been created!", MsgBoxStyle.Information, "Info")[FONT=&quot]
    [/FONT] End Sub

    Hope this helps someone

    Kind Regards

    Last edited: Dec 12, 2011
    Comptech, Dec 12, 2011
    unlock phone and Zeus like this.
    1. Advertisements

  2. Comptech

    AceInfinity Somewhere...

    Aug 13, 2012
    Likes Received:
    If you continually use Shell() then you're becoming less reliant on the BCL. This is more like provoking another executable to start, and do all the work for you, which is not entirely recommended.

    I know these are somewhat old threads, but i'll point that out for anybody's future reference.
    AceInfinity, Aug 13, 2012
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.