Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :: Creates a tmp file, with the code needed
- :: This is then the input file to the diskpart command
- :: Run this bat file with admin privliges
- :: 'maximum' is storage size in MB
- :: Always ist ERRORLEVELS in decreasing order
- :: https://isc.sans.edu/diary/Virtual+Bitlocker+Containers
- @ECHO OFF
- SET Fname="C:\Users\user\Desktop\EncrVol.vhd"
- ECHO 1. Mount
- ECHO 2. UNmount
- ECHO 3. Create New Volume
- ECHO 4. Exit
- ECHO.
- CHOICE /C 1234 /M "Enter your choice:"
- IF ERRORLEVEL 4 GOTO End
- IF ERRORLEVEL 3 GOTO NewVol
- IF ERRORLEVEL 2 GOTO UNmount
- IF ERRORLEVEL 1 GOTO Mount
- :Mount
- echo select vdisk file=%Fname% > tmp
- echo attach vdisk >> tmp
- echo select partition 1 >> tmp
- echo assign letter=k >> tmp
- diskpart /s tmp
- GOTO End
- :UNmount
- echo select vdisk file=%Fname% > tmp
- echo detach vdisk >> tmp
- diskpart /s tmp
- GOTO End
- :NewVol
- echo create vdisk file=%Fname% maximum=5000 type=fixed > tmp
- echo select vdisk file=%Fname% >> tmp
- echo attach vdisk >> tmp
- echo create partition primary >> tmp
- echo select partition 1 >> tmp
- echo format fs=ntfs label="Secret" >> tmp
- echo active >> tmp
- echo assign letter=k >> tmp
- echo exit >> tmp
- diskpart /s tmp
- Echo.
- Echo Remember to encrypt the new volume
- pause
- GOTO End
- :End
- Del tmp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement