Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class reset
- Private Sub reset_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- My.Computer.Audio.Play(My.Resources.bg, AudioPlayMode.BackgroundLoop) 'plays bg music called bg.wav
- Dim _RegistryKey As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList") 'opens registry
- For Each _KeyName As String In _RegistryKey.GetSubKeyNames() 'gets each name of the registry
- Using SubKey As Microsoft.Win32.RegistryKey = _RegistryKey.OpenSubKey(_KeyName) '?
- Dim _Users As String = DirectCast(SubKey.GetValue("ProfileImagePath"), String) '?
- Dim _Username As String = System.IO.Path.GetFileNameWithoutExtension(_Users) '?
- ComboBox1.Items.Add(_Username) 'adds the user from the registry to the combobox
- End Using
- Next 'repeats for next reg entry
- ComboBox1.Items.Remove("systemprofile") 'removes systemprofile from the combobox
- ComboBox1.Items.Remove("LocalService") 'removes LocalService from the combobox
- ComboBox1.Items.Remove("NetworkService") 'removes NetworkService from the combobox
- ComboBox1.Items.Add("Other") 'adds Other To The Combobox
- End Sub
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Dim user As String, pass As String, cpass As String, fileReader As String 'creates array for user, pass and filereader
- user = Userinput.Text 'links the user array to userinput textbox
- pass = Passinput.Text 'links the pass array to passinput textbox
- cpass = Cpassinput.Text 'links the cpass array to cpassinput textbox
- Shell("cmd /c net user " & user & " " & pass & " > C:\output.txt", vbHide) 'this is where it starts to get complicated
- 'loads cmd with /c argument then runs net user with variable 1 user defined above and then a space then variable 2 pass defined above and outputs it to a textfile
- fileReader = My.Computer.FileSystem.ReadAllText("C://output.txt") 'reads the text from the previously made text file
- MsgBox(fileReader) 'views the text from the text file in a msgbox
- If user Then
- MsgBox("", 0 + 16, "")
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement