Recently, the management of the unit has been stricter, and there can be nothing in the computer that is not related to work. In order to prevent the private files in the computer from being easily found during the inspection, I wrote a batch file to hide the disk drive.
@echo off :menu echo [H] hide [S] show [X] exit set /p yn= Please enter the selection and press Enter to confirm: if /i "%yn%"=="h" goto hide if /i " %yn%"=="s" goto show if /i "%yn%"=="x" exit rem ping 0 -n "2">nul ping 0 this address 2 times, the output is redirected to nul echo error ! &ping 0 -n "2">nul& cls & goto menu :hide ( echo select disk 0 echo select partition 4 echo set id=12)>temp.temp. $ pause exit : show ( echo select disk 0 echo select partition 4 echo set id = 7)> temp. $ diskpart /s temp. $ del temp. $ pause exit
The above command implements partition4 that hides disk0, in which set id=7 is to display the drive letter, id=12 is to hide the drive letter, and other similar operations can be hidden.