Created
August 8, 2019 03:24
-
-
Save psrdotcom/8350f1469a7a396a886e86b3f29ef38a to your computer and use it in GitHub Desktop.
Truecrypt Mount and Unmount in Windows Batch file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set TrueSource=E:\ProgramFiles\TrueCrypt\truecrypt | |
set Source=E:\ProgramFiles\TrueCrypt\test | |
set Drive=P: | |
set KeyFile=E:\ProgramFiles\TrueCrypt\keyfile1 | |
set Password=abcd1234ABCD!@#$ | |
set BrowserPath="C:\Program Files (x86)\Internet Explorer\iexplore.exe" | |
set WebSite=ELS | |
set URL="http://localhost:86" | |
set PATH=%PATH%;C:\Windows\System32\inetsrv | |
echo %PATH% | |
IF EXIST %Drive% goto unmount | |
:mount | |
cls | |
%TrueSource% /v %Source% /l %Drive% /m /a /k %KeyFile% /p %Password% /q | |
REM explorer.exe %Drive% | |
cls | |
net start wmsvc | |
appcmd start apppool /apppool.name:%WebSite% | |
appcmd start site /site.name:%WebSite% | |
%BrowserPath% %URL% | |
goto end | |
:unmount | |
cls | |
%TrueSource% /d %Drive% /f /s /q | |
appcmd stop site /site.name:%WebSite% | |
appcmd stop apppool /apppool.name:%WebSite% | |
net stop wmsvc | |
cls | |
goto end | |
:end | |
cls |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment