Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. Public Class reset
  2.  
  3. Private Sub reset_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  4. My.Computer.Audio.Play(My.Resources.bg, AudioPlayMode.BackgroundLoop) 'plays bg music called bg.wav
  5. Dim _RegistryKey As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList") 'opens registry
  6. For Each _KeyName As String In _RegistryKey.GetSubKeyNames() 'gets each name of the registry
  7. Using SubKey As Microsoft.Win32.RegistryKey = _RegistryKey.OpenSubKey(_KeyName) '?
  8. Dim _Users As String = DirectCast(SubKey.GetValue("ProfileImagePath"), String) '?
  9. Dim _Username As String = System.IO.Path.GetFileNameWithoutExtension(_Users) '?
  10. ComboBox1.Items.Add(_Username) 'adds the user from the registry to the combobox
  11. End Using
  12. Next 'repeats for next reg entry
  13. ComboBox1.Items.Remove("systemprofile") 'removes systemprofile from the combobox
  14. ComboBox1.Items.Remove("LocalService") 'removes LocalService from the combobox
  15. ComboBox1.Items.Remove("NetworkService") 'removes NetworkService from the combobox
  16. ComboBox1.Items.Add("Other") 'adds Other To The Combobox
  17.  
  18. End Sub
  19. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  20. Dim user As String, pass As String, cpass As String, fileReader As String 'creates array for user, pass and filereader
  21. user = Userinput.Text 'links the user array to userinput textbox
  22. pass = Passinput.Text 'links the pass array to passinput textbox
  23. cpass = Cpassinput.Text 'links the cpass array to cpassinput textbox
  24. Shell("cmd /c net user " & user & " " & pass & " > C:\output.txt", vbHide) 'this is where it starts to get complicated
  25. '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
  26. fileReader = My.Computer.FileSystem.ReadAllText("C://output.txt") 'reads the text from the previously made text file
  27. MsgBox(fileReader) 'views the text from the text file in a msgbox
  28. If user Then
  29. MsgBox("", 0 + 16, "")
  30. End If
  31. End Sub
  32. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement