Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. import java.io.BufferedWriter;
  2. import java.io.FileWriter;
  3. import java.io.IOException;
  4. import java.util.Scanner;
  5.  
  6. public class Main {
  7.  
  8. public static void main(String[] args) throws IOException, InterruptedException {
  9. String[]editions = new String[8];
  10. editions[0] = "TX9XD-98N7V-6WMQ6-BX7FG-H8Q99";
  11. editions[1] = "3KHY7-WNT83-DGQKR-F7HPR-844BM";
  12. editions[2] = "W269N-WFGWX-YVC9B-4J6C9-T83GX";
  13. editions[3] = "MH37W-N47XK-V7XM9-C7227-GCQG9";
  14. editions[4] = "NW6C2-QMPVW-D7KKK-3GKT6-VCFB2";
  15. editions[5] = "2WH4N-8QGBV-H22JP-CT43Q-MDWWJ";
  16. editions[6] = "NPPR9-FWDCX-D2C8J-H872K-2YT43";
  17. editions[7] = "DPH2V-TTNVB-4X9Q3-TJR4H-KHJW4";
  18.  
  19. Scanner scanner = new Scanner(System.in);
  20. System.out.println("Which edition are you using?");
  21. System.out.println("0. Home");
  22. System.out.println("1. Home N");
  23. System.out.println("2. Professional");
  24. System.out.println("3. Professional N");
  25. System.out.println("4. Education");
  26. System.out.println("5. Education N");
  27. System.out.println("6. Enterprise");
  28. System.out.println("7. Enterprise N");
  29.  
  30. int i = -1;
  31. while (i < 0 || i > 7){
  32. i = scanner.nextInt();
  33. }
  34.  
  35. BufferedWriter key = new BufferedWriter(new FileWriter("C:\\ProgramData\\key.bat"));
  36. key.write("cscript //nologo slmgr.vbs /ipk "+editions[i]+" >nul");
  37. BufferedWriter server = new BufferedWriter(new FileWriter("C:\\ProgramData\\server.bat"));
  38. key.write("cscript //nologo slmgr.vbs /skms kms9.MSGuides.com > nul");
  39. BufferedWriter activate = new BufferedWriter(new FileWriter("C:\\ProgramData\\activate.bat"));
  40. key.write("slmgr /ato");
  41.  
  42. Runtime a=Runtime.getRuntime();
  43. Process b=a.exec("cmd /c start C:\\ProgramData\\key.bat");
  44. Thread.sleep(5000);
  45. Runtime c=Runtime.getRuntime();
  46. Process d=c.exec("cmd /c start C:\\ProgramData\\server.bat");
  47. Runtime e=Runtime.getRuntime();
  48. Process f=e.exec("cmd /c start C:\\ProgramData\\activate.bat");
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement