Batch, Bezpečnost, Skriptování

Automount TrueCrypt Volume using Batch

Script prompt for password and automatically mount encrypted file into free drive letter volume. By default truecrypt.exe is stored in %FlashDiskDrive%:\truecrypt\truecrypt.exe and encrypted file is on root.

echo off
 
set TrueCryptPath=\truecrypt\truecrypt.exe
set TrueCryptFile=\vault01.tc
 
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
cd %%a: 1>> nul 2>&1
if errorlevel 1 (
set FreeDrive=%%a:
 )
)
 
Set Dir=%cd:~0%
Set Drive=%Dir:~0,2%
 
%Drive%%TrueCryptPath% /q /a /l%FreeDrive% /v %Drive%%TrueCryptFile%

Napsat komentář

*

*povinné položky - email nebude zobrazen