Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.63 KB | None | 0 0
  1. :: Title card
  2. title Simple.cmd
  3. :: Clear screen
  4. cls
  5. :: Disable batch text output to screen, @ disables output of indiviual lines
  6. @echo off
  7. :: Outputs message to screen/sends user a message
  8. :: %value% means "go find variable value and show it" (from cmd.exe set)
  9. echo Hello %username%
  10. :: : is label, :: is comment, neither will process
  11. :Menu
  12. cls
  13. echo Press 1 to generate a power report
  14. echo Press 2 to defragment hard drives
  15. echo Press 3 to open Google
  16. echo Press 4 to check NTFS status
  17. echo Press 5 to update virus definition files
  18. echo Press 6 to perform full computer virus scan
  19. echo Press 7 to schedule memory test at next restart
  20. echo Press 0 to exit
  21. set input=
  22. set /p input=Select an option:
  23. :: = is set value/assign to, == is compare value/check for equal
  24. if %input%==1 goto Power
  25. if %input%==2 goto Defrag
  26. if %input%==3 goto Google
  27. if %input%==4 goto NTFS
  28. if %input%==5 goto VirusDef
  29. if %input%==6 goto VirusScan
  30. if %input%==7 goto MemTest
  31. if %input%==0 goto End
  32. goto Menu
  33. :Power
  34. cls
  35. echo Generating power report...
  36. :: Generate energy report
  37. powercfg/energy
  38. :: Open report in default browser
  39. start energy-report.html
  40. set /p Progress1=Press enter to return to menu.
  41. goto Menu
  42. :Defrag
  43. cls
  44. echo Defragmenting C:\ drive...
  45. :: Defrags C:\ drive and displays progress to user
  46. defrag C:\ /u
  47. echo Defragmenting D:\ drive... press ctrl+c to cancel.
  48. defrag D:\ /u
  49. set /p Progress2=Press enter to return to menu.
  50. goto Menu
  51. :Google
  52. cls
  53. echo Opening google.com...
  54. :: Opens target website in default browser
  55. start www.google.com
  56. set /p Progress3=Press enter to return to menu.
  57. goto Menu
  58. :NTFS
  59. cls
  60. echo Checking NTFS status of C:\...
  61. chkntfs C:
  62. echo Checking NTFS status of D:\...
  63. chkntfs D:
  64. set /p Progress4=Press enter to return to menu.
  65. goto Menu
  66. :VirusDef
  67. cls
  68. echo Updating virus definition files...
  69. :: Places command prompt in the correct directory
  70. cd %ProgramFiles%\Windows Defender
  71. :: Tells Windows Defender to update virus signatures
  72. mpcmdrun.exe -signatureupdate
  73. set /p Progress5=Press enter to return to menu.
  74. goto Menu
  75. :VirusScan
  76. cls
  77. echo Initiating full virus scan...
  78. :: Places command prompt in correct directory
  79. cd %ProgramFiles%\Windows Defender
  80. :: Tells Windows Defender to scan and to do a full system scan
  81. mpcmdrun.exe -scan -scantype 2
  82. set /p Progress6=Press enter to return to menu.
  83. goto Menu
  84. :MemTest
  85. cls
  86. echo Initialising memory test tool...
  87. :: Places command prompt in correct directory
  88. cd C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools
  89. :: Opens memory test dialogue box
  90. mdsched.exe
  91. set /p Progress7=Press enter to return to menu.
  92. goto Menu
  93. :End
  94. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement