Advertisement
YourMain12

Advanced Debug Mode

Aug 14th, 2023
417
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 12.26 KB | None | 0 0
  1. @echo off
  2. setlocal enabledelayedexpansion
  3.  
  4. net session >nul 2>&1
  5. if %errorLevel% neq 0 (
  6.     echo Administrator privileges required. Please run as administrator.
  7.     pause
  8.     exit
  9. )
  10.  
  11. set "title=Advanced Debug Mode V1.0.0"
  12. set "color=17"
  13. set "log_file=%cd%\debug_log.txt"
  14.  
  15. :continue
  16. title %title%
  17. color %color%
  18. cls
  19.  
  20. echo Welcome to %title%
  21. echo.
  22.  
  23. :menu
  24. echo Select an option:
  25. echo 1. Display Comprehensive System Information
  26. echo 2. Perform CHKDSK with File System Repair and Recovery
  27. echo 3. View Running Processes with Extended Details
  28. echo 4. Open an Elevated Command Prompt
  29. echo 5. Check Network Connectivity and Latency
  30. echo 6. Create Detailed System Restore Point
  31. echo 7. Manage Services and Startup Types
  32. echo 8. Backup Files and Folders with Compression
  33. echo 9. Launch Windows Registry Editor
  34. echo 10. Generate Comprehensive System Report
  35. echo 11. Clean Temporary Files and Cached Data
  36. echo 12. View Application and System Event Logs
  37. echo 13. Manage Startup Programs and Delay Timers
  38. echo 14. Run Comprehensive Hardware Diagnostic Tests
  39. echo 15. Check Disk Space Usage and File Distribution
  40. echo 16. Uninstall Software and Remove Residual Data
  41. echo 17. Check Detailed Driver Information
  42. echo 18. Execute Custom Script
  43. echo 19. Access Remote Command Line
  44. echo 20. Analyze Network Traffic
  45. echo 21. Monitor CPU and Memory Usage
  46. echo 22. Control Power Settings
  47. echo 23. Exit
  48.  
  49. set /p choice=Enter your choice:
  50.  
  51. if "%choice%"=="1" (
  52.     systeminfo /FO CSV > %log_file%
  53.     notepad %log_file%
  54.     goto menu
  55. ) else if "%choice%"=="2" (
  56.     echo Running CHKDSK with file system repair and bad sector recovery...
  57.     chkdsk C: /f /r > %log_file%
  58.     notepad %log_file%
  59.     goto menu
  60. ) else if "%choice%"=="3" (
  61.     tasklist /V > %log_file%
  62.     notepad %log_file%
  63.     goto menu
  64. ) else if "%choice%"=="4" (
  65.     echo Opening an elevated Command Prompt...
  66.     powershell -command "Start-Process cmd -ArgumentList '/k', 'cd %cd%', '-noexit', '-verb runas'"
  67.     goto menu
  68. ) else if "%choice%"=="5" (
  69.     echo Checking Network Connectivity and Latency using extended ping...
  70.     ping google.com -t > %log_file%
  71.     notepad %log_file%
  72.     goto menu
  73. ) else if "%choice%"=="6" (
  74.     echo Creating a Detailed System Restore Point with description...
  75.     set /p restore_description=Enter a description for the restore point:
  76.     wmic.exe /Namespace:\\root\default Path SystemRestore Call CreateRestorePoint "%restore_description%", 100, 7
  77.     echo System Restore Point created successfully. >> %log_file%
  78.     notepad %log_file%
  79.     goto menu
  80. ) else if "%choice%"=="7" (
  81.     :services
  82.     echo Manage Services and Startup Types:
  83.     echo 1. List all services
  84.     echo 2. Start a service
  85.     echo 3. Stop a service
  86.     echo 4. Restart a service
  87.     echo 5. Change startup type of a service
  88.     echo 6. Go back to the main menu
  89.  
  90.     set /p service_choice=Enter your choice:
  91.  
  92.     if "%service_choice%"=="1" (
  93.         net start > %log_file%
  94.         notepad %log_file%
  95.         goto services
  96.     ) else if "%service_choice%"=="2" (
  97.         set /p service_name=Enter the name of the service to start:
  98.         net start "%service_name%" > %log_file%
  99.         echo Service "%service_name%" started successfully. >> %log_file%
  100.         notepad %log_file%
  101.         goto services
  102.     ) else if "%service_choice%"=="3" (
  103.         set /p service_name=Enter the name of the service to stop:
  104.         net stop "%service_name%" > %log_file%
  105.         echo Service "%service_name%" stopped successfully. >> %log_file%
  106.         notepad %log_file%
  107.         goto services
  108.     ) else if "%service_choice%"=="4" (
  109.         set /p service_name=Enter the name of the service to restart:
  110.         net stop "%service_name%" > %log_file%
  111.         net start "%service_name%" > %log_file%
  112.         echo Service "%service_name%" restarted successfully. >> %log_file%
  113.         notepad %log_file%
  114.         goto services
  115.     ) else if "%service_choice%"=="5" (
  116.         set /p service_name=Enter the name of the service to change startup type:
  117.         set /p startup_type=Enter new startup type (AUTO, MANUAL, DISABLED):
  118.         sc config "%service_name%" start=%startup_type% > %log_file%
  119.         echo Startup type of service "%service_name%" changed to %startup_type%. >> %log_file%
  120.         notepad %log_file%
  121.         goto services
  122.     ) else if "%service_choice%"=="6" (
  123.         goto menu
  124.     ) else {
  125.         echo Invalid choice. Please select a valid option.
  126.         pause
  127.         goto services
  128.     }
  129. ) else if "%choice%"=="8" (
  130.     :backup
  131.     echo Backup Files and Folders with Compression:
  132.     echo 1. Create a compressed backup of a file or folder
  133.     echo 2. Restore a backup
  134.     echo 3. Go back to the main menu
  135.  
  136.     set /p backup_choice=Enter your choice:
  137.  
  138.     if "%backup_choice%"=="1" (
  139.         set /p source_path=Enter the path of the file or folder to backup:
  140.         set /p backup_location=Enter the backup location:
  141.         set /p compression_level=Enter compression level (FASTEST, FAST, NORMAL, MAXIMUM, ULTRA):
  142.         set /p overwrite=Do you want to overwrite existing backup? (YES/NO):
  143.         7z a -t7z -mx=%compression_level% -r -y "%backup_location%\backup.7z" "%source_path%" > %log_file%
  144.         echo Content at "%source_path%" backed up to "%backup_location%\backup.7z" with compression level %compression_level%. >> %log_file%
  145.         if "%overwrite%"=="YES" (
  146.             copy /y "%backup_location%\backup.7z" "%backup_location%\backup_latest.7z" > %log_file%
  147.             echo Overwritten the latest backup. >> %log_file%
  148.         )
  149.         notepad %log_file%
  150.         goto backup
  151.     ) else if "%backup_choice%"=="2" (
  152.         set /p backup_path=Enter the path of the backup to restore:
  153.         set /p restore_location=Enter the restore location:
  154.         set /p overwrite=Do you want to overwrite existing files during restore? (YES/NO):
  155.         7z x -y "%backup_path%" -o"%restore_location%" > %log_file%
  156.         echo Backup at "%backup_path%" restored to "%restore_location%" with overwrite set to %overwrite%. >> %log_file%
  157.         notepad %log_file%
  158.         goto backup
  159.     ) else if "%backup_choice%"=="3" (
  160.         goto menu
  161.     ) else {
  162.         echo Invalid choice. Please select a valid option.
  163.         pause
  164.         goto backup
  165.     }
  166. ) else if "%choice%"=="9" (
  167.     echo Launching Windows Registry Editor...
  168.     regedit
  169.     goto menu
  170. ) else if "%choice%"=="10" (
  171.     echo Generating Comprehensive System Report with hardware details...
  172.     msinfo32 /report "%cd%\SystemReport.txt" > %log_file%
  173.     echo System Report generated and saved to %cd%\SystemReport.txt. >> %log_file%
  174.     notepad %log_file%
  175.     goto menu
  176. ) else if "%choice%"=="11" (
  177.     echo Cleaning Temporary Files and Cached Data...
  178.     del /s /q /f "%temp%\*" > %log_file%
  179.     del /s /q /f "%localappdata%\Temp\*" >> %log_file%
  180.     echo Temporary files and cached data cleaned. >> %log_file%
  181.     notepad %log_file%
  182.     goto menu
  183. ) else if "%choice%"=="12" (
  184.     :eventlogs
  185.     echo View Application and System Event Logs:
  186.     echo 1. View Application Event Logs
  187.     echo 2. View System Event Logs
  188.     echo 3. Go back to the main menu
  189.  
  190.     set /p event_choice=Enter your choice:
  191.  
  192.     if "%event_choice%"=="1" (
  193.         eventvwr.exe /c:Application > %log_file%
  194.         notepad %log_file%
  195.         goto eventlogs
  196.     ) else if "%event_choice%"=="2" (
  197.         eventvwr.exe /c:System > %log_file%
  198.         notepad %log_file%
  199.         goto eventlogs
  200.     ) else if "%event_choice%"=="3" (
  201.         goto menu
  202.     ) else {
  203.         echo Invalid choice. Please select a valid option.
  204.         pause
  205.         goto eventlogs
  206.     }
  207. ) else if "%choice%"=="13" (
  208.     :startup
  209.     echo Manage Startup Programs and Delay Timers:
  210.     echo 1. View Startup Programs
  211.     echo 2. Disable a Startup Program
  212.     echo 3. Enable a Startup Program
  213.     echo 4. Change delay timer for a Startup Program
  214.     echo 5. Go back to the main menu
  215.  
  216.     set /p startup_choice=Enter your choice:
  217.  
  218.     if "%startup_choice%"=="1" (
  219.         wmic startup get Caption, Command > %log_file%
  220.         notepad %log_file%
  221.         goto startup
  222.     ) else if "%startup_choice%"=="2" (
  223.         set /p program_name=Enter the name of the program to disable:
  224.         wmic startup where "Caption='!program_name!'" call disable > %log_file%
  225.         echo Startup program "%program_name%" disabled successfully. >> %log_file%
  226.         notepad %log_file%
  227.         goto startup
  228.     ) else if "%startup_choice%"=="3" (
  229.         set /p program_name=Enter the name of the program to enable:
  230.         wmic startup where "Caption='!program_name!'" call enable > %log_file%
  231.         echo Startup program "%program_name%" enabled successfully. >> %log_file%
  232.         notepad %log_file%
  233.         goto startup
  234.     ) else if "%startup_choice%"=="4" (
  235.         set /p program_name=Enter the name of the program to change delay timer:
  236.         set /p delay_time=Enter the new delay time in seconds:
  237.         reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupDelayInMSec" /v "%program_name%" /t REG_DWORD /d %delay_time% /f > %log_file%
  238.         echo Delay timer for "%program_name%" changed to %delay_time% seconds. >> %log_file%
  239.         notepad %log_file%
  240.         goto startup
  241.     ) else if "%startup_choice%"=="5" (
  242.         goto menu
  243.     ) else {
  244.         echo Invalid choice. Please select a valid option.
  245.         pause
  246.         goto startup
  247.     }
  248. ) else if "%choice%"=="14" (
  249.     echo Running Comprehensive Hardware Diagnostic Tests...
  250.     echo Running memory test and hard drive check... > %log_file%
  251.     mdsched.exe >> %log_file%
  252.     chkdsk C: /f /r >> %log_file%
  253.     echo Diagnostic tests completed. >> %log_file%
  254.     notepad %log_file%
  255.     goto menu
  256. ) else if "%choice%"=="15" (
  257.     echo Checking Disk Space Usage and File Distribution...
  258.     wmic logicaldisk get Caption, FreeSpace, Size, VolumeName > %log_file%
  259.     dir /s /a > %log_file%
  260.     notepad %log_file%
  261.     goto menu
  262. ) else if "%choice%"=="16" (
  263.     :uninstall
  264.     echo Uninstall Software and Remove Residual Data:
  265.     echo 1. List installed software
  266.     echo 2. Uninstall a program and remove residual data
  267.     echo 3. Go back to the main menu
  268.  
  269.     set /p uninstall_choice=Enter your choice:
  270.  
  271.     if "%uninstall_choice%"=="1" (
  272.         wmic product get Name, Version > %log_file%
  273.         notepad %log_file%
  274.         goto uninstall
  275.     ) else if "%uninstall_choice%"=="2" (
  276.         set /p program_name=Enter the name of the program to uninstall:
  277.         wmic product where "Name='!program_name!'" call uninstall > %log_file%
  278.         rmdir /s /q "C:\Program Files\!program_name!" > %log_file%
  279.         echo Program "%program_name%" uninstalled and residual data removed. >> %log_file%
  280.         notepad %log_file%
  281.         goto uninstall
  282.     ) else if "%uninstall_choice%"=="3" (
  283.         goto menu
  284.     ) else {
  285.         echo Invalid choice. Please select a valid option.
  286.         pause
  287.         goto uninstall
  288.     }
  289. ) else if "%choice%"=="17" (
  290.     echo Checking Detailed Driver Information...
  291.     driverquery /v > %log_file%
  292.     notepad %log_file%
  293.     goto menu
  294. ) else if "%choice%"=="18" (
  295.     echo Executing Custom Script...
  296.     set /p script_path=Enter the path to the script:
  297.     call "%script_path%" > %log_file%
  298.     echo Custom script executed. >> %log_file%
  299.     notepad %log_file%
  300.     goto menu
  301. ) else if "%choice%"=="19" (
  302.     echo Accessing Remote Command Line...
  303.     set /p remote_ip=Enter the IP address of the remote machine:
  304.     set /p remote_user=Enter the username:
  305.     set /p remote_password=Enter the password:
  306.     psexec \\%remote_ip% -u %remote_user% -p %remote_password% cmd
  307.     goto menu
  308. ) else if "%choice%"=="20" (
  309.     echo Analyzing Network Traffic...
  310.     netstat -ano > %log_file%
  311.     notepad %log_file%
  312.     goto menu
  313. ) else if "%choice%"=="21" (
  314.     echo Monitoring CPU and Memory Usage...
  315.     typeperf "\Processor(_Total)\% Processor Time" "\Memory\Available MBytes" -si 5 -sc 10 > %log_file%
  316.     notepad %log_file%
  317.     goto menu
  318. ) else if "%choice%"=="22" (
  319.     echo Controlling Power Settings...
  320.     powercfg /L > %log_file%
  321.     notepad %log_file%
  322.     goto menu
  323. ) else if "%choice%"=="23" (
  324.     echo Exiting Advanced Debug Mode.
  325.     exit
  326. ) else {
  327.     echo Invalid choice. Please select a valid option.
  328.     pause
  329.     goto menu
  330. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement