Script for automating a large assortment of AME related actions
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.2 KiB

9 months ago
9 months ago
  1. using System;
  2. using System.DirectoryServices.AccountManagement;
  3. using System.Threading.Tasks;
  4. using Ameliorated.ConsoleUtils;
  5. using Microsoft.Win32;
  6. namespace amecs
  7. {
  8. public static class Globals
  9. {
  10. public static string Username = null;
  11. public static string UserDomain = null;
  12. public static string UserSID = null;
  13. public static string UserFolder = null;
  14. public static bool UserElevated = false;
  15. public static string UserHive
  16. {
  17. get
  18. {
  19. return "HKU\\" + UserSID;
  20. }
  21. }
  22. public static Task UserLoadTask = Task.CompletedTask;
  23. public static ConsoleUtils.LoadingIndicator CurrentIndicator = new ConsoleUtils.LoadingIndicator();
  24. public static GroupPrincipal Administrators;
  25. public static UserPrincipal User;
  26. public static bool Exit()
  27. {
  28. ConsoleTUI.Close();
  29. Environment.Exit(0);
  30. return true;
  31. }
  32. public static readonly int WinVer = int.Parse(Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion").GetValue("CurrentBuildNumber").ToString());
  33. }
  34. }