Advertisement
Guest User

Untitled

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