Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :: Title card
- title Simple.cmd
- :: Clear screen
- cls
- :: Disable batch text output to screen, @ disables output of indiviual lines
- @echo off
- :: Outputs message to screen/sends user a message
- :: %value% means "go find variable value and show it" (from cmd.exe set)
- echo Hello %username%
- :: : is label, :: is comment, neither will process
- :Menu
- cls
- echo Press 1 to generate a power report
- echo Press 2 to defragment hard drives
- echo Press 3 to open Google
- echo Press 4 to check NTFS status
- echo Press 5 to update virus definition files
- echo Press 6 to perform full computer virus scan
- echo Press 7 to schedule memory test at next restart
- echo Press 0 to exit
- set input=
- set /p input=Select an option:
- :: = is set value/assign to, == is compare value/check for equal
- if %input%==1 goto Power
- if %input%==2 goto Defrag
- if %input%==3 goto Google
- if %input%==4 goto NTFS
- if %input%==5 goto VirusDef
- if %input%==6 goto VirusScan
- if %input%==7 goto MemTest
- if %input%==0 goto End
- goto Menu
- :Power
- cls
- echo Generating power report...
- :: Generate energy report
- powercfg/energy
- :: Open report in default browser
- start energy-report.html
- set /p Progress1=Press enter to return to menu.
- goto Menu
- :Defrag
- cls
- echo Defragmenting C:\ drive...
- :: Defrags C:\ drive and displays progress to user
- defrag C:\ /u
- echo Defragmenting D:\ drive... press ctrl+c to cancel.
- defrag D:\ /u
- set /p Progress2=Press enter to return to menu.
- goto Menu
- :Google
- cls
- echo Opening google.com...
- :: Opens target website in default browser
- start www.google.com
- set /p Progress3=Press enter to return to menu.
- goto Menu
- :NTFS
- cls
- echo Checking NTFS status of C:\...
- chkntfs C:
- echo Checking NTFS status of D:\...
- chkntfs D:
- set /p Progress4=Press enter to return to menu.
- goto Menu
- :VirusDef
- cls
- echo Updating virus definition files...
- :: Places command prompt in the correct directory
- cd %ProgramFiles%\Windows Defender
- :: Tells Windows Defender to update virus signatures
- mpcmdrun.exe -signatureupdate
- set /p Progress5=Press enter to return to menu.
- goto Menu
- :VirusScan
- cls
- echo Initiating full virus scan...
- :: Places command prompt in correct directory
- cd %ProgramFiles%\Windows Defender
- :: Tells Windows Defender to scan and to do a full system scan
- mpcmdrun.exe -scan -scantype 2
- set /p Progress6=Press enter to return to menu.
- goto Menu
- :MemTest
- cls
- echo Initialising memory test tool...
- :: Places command prompt in correct directory
- cd C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools
- :: Opens memory test dialogue box
- mdsched.exe
- set /p Progress7=Press enter to return to menu.
- goto Menu
- :End
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement