@ECHO OFF&& SETLOCAL&& PUSHD "%~dp0"&& SETLOCAL ENABLEDELAYEDEXPANSION&& SETLOCAL ENABLEEXTENSIONS&& SET V=5&& IF NOT "!V!"=="5" (ECHO DelayedExpansion Failed&& GOTO :EOF) REM ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ REM ++ ++ REM ++ SCRIPT LOCAL VARIABLES ++ REM ++ ++ REM ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ REM ** Various vars for output used by functions SET P1=^^^>^^^>^^^> SET P2=++ SET P3=:: SET L1=+==============================================================================================================+ SET L2=+--------------------------------------------------------------------------------------------------------------+ REM ** administrator username, unless changed for more security, its Administrator SET ADMINUSER=admin REM ** runuser is the username you use when running this script SET RUNUSER=life REM ** Custom COMSPEC for running cmd.exe SET _SCOM=%COMSPEC% /E:ON /F:ON /D /Q /T:0C /C REM ** Custom START command SET _START=START /WAIT /MIN /B %_SCOM% REM ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ REM ++ ++ REM ++ MAIN PROGRAM EXECUTION ++ REM ++ ++ REM ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ :: Only allow certain users to run this script or die (prevents global STARTup or service running it) CALL :CHECKUSERVALID %RUNUSER% %ADMINUSER% :: Mount the truecrypt container CALL :CRYPTMOUNT "L" "%SYSTEMDRIVE%\CRYPT\LEONARDO" "%SYSTEMDRIVE%\CRYPT\LEONARDO_KEY" :: Start Mozilla Firefox CALL :RUNONE "C:\Program Files\Mozilla Firefox\firefox.exe" :: Start Thunderbird Portable CALL :RUNONE "L:\P\PP\putty.exe" "/MIN" -load 1 :: Start Thunderbird Portable CALL :RUNONE "L:\P\TB\ThunderbirdPortable.exe" "/MIN" :: Start Adobe Dreamweaver CS4 CALL :RUNONE "C:\Program Files\Adobe\Adobe Dreamweaver CS4\Dreamweaver.exe" "/MIN" :: Start LightScreen Portable CALL :RUNONE "L:\P\LP\LightscreenPortable.exe" /B /B :: Start Google Chrome Portable ( GREAT to use for pandora/last.fm as its so low mem ) CALL :RUNONE "L:\P\GC\GC.exe" "/NORMAL" :: Start Adobe Photoshop CS4 CALL :RUNONE "%ProgramFiles%\Adobe\Adobe Photoshop CS4\Photoshop.exe" "/MAX" REM ** EXIT Script CALL :MDYE "EOF" && POPD && ENDLOCAL && GOTO :EOF REM ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ REM ++ ++ REM ++ SCRIPT FUNCTIONS ++ REM ++ ++ REM ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ REM ========================================================================================================================================================================= REM = CRYPTMOUNT - mounts a truecrypt container and returns to CALLer. On fail, quit REM ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- REM REM CALL :CRYPTMOUNT "%LEONARDO%" "%LEONARDO_FILE%" "%LEONARDO_KEY%" REM CALL :CRYPTMOUNT "L" "%SYSTEMDRIVE%\CRYPT\LEONARDO" "%SYSTEMDRIVE%\CRYPT\LEONARDO_KEY" REM REM :: print the settings REM :: CALL :MP 3 "DRIVE: %DRIVE%"&&CALL :MP 3 " FILE: %FILE%"&&CALL :MP 3 " KEY: %KEY%"&&CALL :MP 3 " VOL: %VOL%" REM ========================================================================================================================================================================= :CRYPTMOUNT SET DRIVE=%~1&& SET FILE=%~2&& SET KEY=%~3&& SET VOL=!FILE:~0,3! CALL :MP 1 "Mounting TrueCrypt on %DRIVE% from %FILE%" :: Check for Truecrypt or die CALL :EXISTORQUIT "%ProgramFiles%\TrueCrypt\TrueCrypt.exe" && CALL :EXISTORQUIT "%FILE%" && CALL :EXISTORQUIT "%KEY%" :: checks that MOUNTVOL works and the drive containing the truecrypt container file is present or dies MOUNTVOL %VOL% /L 2>NUL | FIND "\\?\Volume{" >NUL 2>&1 IF ERRORLEVEL 1 CALL :MDYE "%VOL% NOT FOUND" REM ** Converts G:\ to its \\?\Volume{234234}\ equivalent for greater portability FOR /F %%i IN ('MOUNTVOL %VOL% /L') DO @SET VOL=%%i%FILE:~3% :: IF the drive is already mounted then continue, otherwise try to mount MOUNTVOL %DRIVE%:\ /L >NUL 2>&1 IF NOT ERRORLEVEL 1 ( CALL :MP 2 "%DRIVE% ALREADY MOUNTED" && EXIT /B) ELSE (START "Mounting TrueCrypt" /D"%ProgramFiles%\TrueCrypt" /MIN /B TrueCrypt.exe /c n /b /q background /h n /k %KEY% /l %DRIVE% /p /v %VOL% && SLEEP 10) :: try again in case of bad password and accidental keypress MOUNTVOL %DRIVE%:\ /L >NUL 2>&1 IF ERRORLEVEL 1 (START "Mounting TrueCrypt" /D"%ProgramFiles%\TrueCrypt" /MIN /B TrueCrypt.exe /c n /b /q background /h n /k %KEY% /l %DRIVE% /p /v %VOL% && SLEEP 10) :: IF it still doesnt exist then quit MOUNTVOL %DRIVE%:\ /L >NUL 2>&1 IF ERRORLEVEL 1 CALL :MDYE "Failed to mount %FILE% on %DRIVE%" CALL :MF && ENDLOCAL && EXIT /B EXIT /B REM ========================================================================================================================================================================= REM = RUNONE - Starts one instance of executable after verifying it exists and is not already running. REM ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- REM %~1 is location of executatable REM %~2 is optional (unless %~3 is used) START parameters REM %~3 is optional parameters for executable REM REM CALL :RUNONE "L:\P\LP\LightscreenPortable.exe" "/MAX" "/HIDE" REM ========================================================================================================================================================================= :RUNONE SETLOCAL CALL :MP 1 "Starting %~n1" :: SLEEP FOR NICENESS, LOCAL VARS _P2 and _P3 SLEEP 2 && SETLOCAL SET P=%~1 ECHO %P%|FIND " " >NUL 2>&1 IF NOT ERRORLEVEL 1 ( PUSHD "%~dp1" && SET P=%~nx1 ) :: SET _P2 TO DEFAULT TO "/MIN" IF EMPTY SET _P2=/MIN IF NOT " %~2" == " " SET _P2=%~2 IF NOT " %~3" == " " SET _P3=%~3 IF NOT " %~4" == " " SET _P4=%~4 :: CHECK THAT EXECUTABLE EXISTS CALL :EXISTORQUIT "%~1" REM ECHO START %_P2% /D"%~dp1" %P% %_P3% %_P4%&& PAUSE&& :: CHECK FOR EXISTING PROCESSNAME ( %~n1 is file name without ext, %~nx1 is the file name and extension. ) pslist.exe /e %~n1 >NUL 2>&1 IF ERRORLEVEL 1 (START %_P2% /D"%~dp1" %P% %_P3% %_P4% ) ELSE (CALL :MP 2 "%~n1 already running!" ) ENDLOCAL && EXIT /B REM ========================================================================================================================================================================= REM = ADMINRUNONE - Runs %1 with admin rights IF neccessary REM ========================================================================================================================================================================= :ADMINRUNONE CALL :MP 3 "Exec %~1 as %ADMINUSER%" :: Check that file exists CALL :EXISTORQUIT "%~1" :: test for rights to the task scheduler :: %SYSTEMDRIVE%\WINDOWS\system32\cmd.exe /E:ON /D /Q /T:0C /C START /WAIT /MIN /B %SYSTEMDRIVE%\WINDOWS\system32\cmd.exe /E:ON /D /Q /T:0C /C %~1 AT >NUL 2>&1 IF ERRORLEVEL 1 ( RUNAS /noprofile /user:%USERDOMAIN%\%ADMINUSER% "%~1" ) ELSE ( %COMSPEC% /E:ON /D /Q /T:0C /C "%~1" ) SLEEP 2 && CALL :MF && EXIT /B REM ========================================================================================================================================================================= REM = CHECKUSERVALID - checks that defined username equals %ADMINUSER% or %RUNUSER%, then returns to CALLer REM ========================================================================================================================================================================= :CHECKUSERVALID :: EXIT IF USERNAME IS NOT DEFINED, CATCHES SYSTEM ACCOUNTS TRYING TO RUN WHEN IN GLOBAL STARTUP IF NOT DEFINED USERNAME EXIT SETLOCAL SET UP=no SET _P1= %~1 SET _P2= %~2 IF NOT "%_P1%" == " " ( IF /I "%~1" == "%USERNAME%" SET UP=yes) IF NOT "%_P1%" == " " ( IF /I "%~1" == "%USERNAME%" SET UP=yes) IF NOT "%_P1%" == " " ( IF /I "%~1" == "%USERNAME%" SET UP=yes) IF /I "%RUNUSER%" == "%USERNAME%" SET UP=yes IF /I "%ADMINUSER%" == "%USERNAME%" SET UP=yes IF /I "max" == "%USERNAME%" SET UP=yes IF /I NOT "%UP%" == "yes" EXIT ENDLOCAL EXIT /B REM ========================================================================================================================================================================= REM = SETPROMPT - sets prompt, then returns to CALLer REM ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- REM REM = [user@MACHINE] [C:\DR\PEPPER\SCRIPTS] REM = > REG /? REM REM ========================================================================================================================================================================= :SETPROMPT set PROMPT=$_[%USERNAME%@%USERDOMAIN%]$S[$P]$_$M$G && EXIT /B REM ========================================================================================================================================================================= REM = BEEP - beeps once, then returns to CALLer REM ========================================================================================================================================================================= :BEEP @ECHO  && EXIT /B REM ========================================================================================================================================================================= REM = MSETCOLOR - SET colors for screen, then returns to CALLer REM ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- REM REM 0 = Black 8 = Gray REM 1 = Blue 9 = Light Blue REM 2 = Green A = Light Green REM 3 = Aqua B = Light Aqua REM 4 = Red C = Light Red REM 5 = Purple D = Light Purple REM 6 = Yellow E = Light Yellow REM 7 = White F = Bright White REM REM ========================================================================================================================================================================= :MSETCOLOR COLOR %~1 && EXIT /B REM ========================================================================================================================================================================= REM = MSETCONSOLE - sets the cols and lines of current screen buffer, then returns to CALLer REM ========================================================================================================================================================================= :MSETCONSOLE MODE CON COLS=%~1 LINES=%~2 && EXIT /B REM ========================================================================================================================================================================= REM = PARAMTEST - tests params, then returns to CALLer REM ========================================================================================================================================================================= :PARAMTEST ECHO. && CALL :MP 1 "PARAMTEST CALLED WITH: %*" && ECHO %L1% SET _P= %~1 IF NOT "%_P%" == " " ( ECHO %%1 = %1 && ECHO %%~f1 = %~f1 && ECHO %%~d1 = %~d1 && ECHO %%~p1 = %~p1 ECHO %%~n1 = %~n1 && ECHO %%~x1 = %~x1 && ECHO %%~s1 = %~s1 && ECHO %%~dp1 = %~dp1 ECHO %%~nx1 = %~nx1 && ECHO %%~$PATH:1 = %~$PATH:1 && ECHO %%~dp$PATH:1 = %~dp$PATH:1 && ECHO %L1% ) SET _P= %~2 IF NOT "%_P%" == " " ( ECHO %%2 = %2 && ECHO %%~f2 = %~f2 && ECHO %%~d2 = %~d2 && ECHO %%~p2 = %~p2 ECHO %%~n2 = %~n2 && ECHO %%~x2 = %~x2 && ECHO %%~s2 = %~s2 && ECHO %%~dp2 = %~dp2 ECHO %%~nx2 = %~nx2 && ECHO %%~$PATH:2 = %~$PATH:2 && ECHO %%~dp$PATH:2 = %~dp$PATH:2 && ECHO %L1% ) SET _P= %~3 IF NOT "%_P%" == " " ( ECHO %%3 = %3 && ECHO %%~f3 = %~f3 && ECHO %%~d3 = %~d3 && ECHO %%~p3 = %~p3 ECHO %%~n3 = %~n3 && ECHO %%~x3 = %~x3 && ECHO %%~s3 = %~s3 && ECHO %%~dp3 = %~dp3 ECHO %%~nx3 = %~nx3 && ECHO %%~$PATH:3 = %~$PATH:3 && ECHO %%~dp$PATH:3 = %~dp$PATH:3 && ECHO %L1% ) SET _P= %~4 IF NOT "%_P%" == " " ( ECHO %%4 = %4 && ECHO %%~f4 = %~f4 && ECHO %%~d4 = %~d4 && ECHO %%~p4 = %~p4 ECHO %%~n4 = %~n4 && ECHO %%~x4 = %~x4 && ECHO %%~s4 = %~s4 && ECHO %%~dp4 = %~dp4 ECHO %%~nx4 = %~nx4 && ECHO %%~$PATH:4 = %~$PATH:4 && ECHO %%~dp$PATH:4 = %~dp$PATH:4 && ECHO %L1% ) SET _P= %~5 IF NOT "%_P%" == " " ( ECHO %%5 = %5 && ECHO %%~f5 = %~f5 && ECHO %%~d5 = %~d5 && ECHO %%~p5 = %~p5 ECHO %%~n5 = %~n5 && ECHO %%~x5 = %~x5 && ECHO %%~s5 = %~s5 && ECHO %%~dp5 = %~dp5 ECHO %%~nx5 = %~nx5 && ECHO %%~$PATH:5 = %~$PATH:5 && ECHO %%~dp$PATH:5 = %~dp$PATH:5 && ECHO %L1% ) SET _P= %~6 IF NOT "%_P%" == " " ( ECHO %%6 = %6 && ECHO %%~f6 = %~f6 && ECHO %%~d6 = %~d6 && ECHO %%~p6 = %~p6 ECHO %%~n6 = %~n6 && ECHO %%~x6 = %~x6 && ECHO %%~s6 = %~s6 && ECHO %%~dp6 = %~dp6 ECHO %%~nx6 = %~nx6 && ECHO %%~$PATH:6 = %~$PATH:6 && ECHO %%~dp$PATH:6 = %~dp$PATH:6 && ECHO %L1% ) SET _P= %~7 IF NOT "%_P%" == " " ( ECHO %%7 = %7 && ECHO %%~f7 = %~f7 && ECHO %%~d7 = %~d7 && ECHO %%~p7 = %~p7 ECHO %%~n7 = %~n7 && ECHO %%~x7 = %~x7 && ECHO %%~s7 = %~s7 && ECHO %%~dp7 = %~dp7 ECHO %%~nx7 = %~nx7 && ECHO %%~$PATH:7 = %~$PATH:7 && ECHO %%~dp$PATH:7 = %~dp$PATH:7 && ECHO %L1% ) SLEEP 3 CALL :MF EXIT /B REM ========================================================================================================================================================================= REM = PARAMTESTHELP - show params help, then returns to CALLer REM ========================================================================================================================================================================= :PARAMTESTHELP ECHO %%~1 Expands %%1 and removes any surrounding quotation marks ECHO %%~f1 Expands %%1 to a fully qualified path name. ECHO %%~d1 Expands %%1 to a drive letter. ECHO %%~p1 Expands %%1 to a path. ECHO %%~n1 Expands %%1 to a file name. ECHO %%~x1 Expands %%1 to a file extension. ECHO %%~s1 Expanded path contains short names only. ECHO %%~a1 Expands %%1 to file attributes. ECHO %%~t1 Expands %%1 to date and time of file. ECHO %%~z1 Expands %%1 to size of file. ECHO %%~dp1 Expands %%1 to a drive letter and path. ECHO %%~nx1 Expands %%1 to a file name and extension. ECHO %%~ftza1 Expands %%1 to a dir-like output line. ECHO %%~$PATH:1 Searches the dirs in PATH expanding %%1 to fully qualified name of first found. If var name isn't defined or the files not found, expands to empty string. ECHO %%~dp$PATH:1 Searches the directories listed in the PATH environment variable for %%1 and expands to the drive letter and path of the first one found. CALL :MF EXIT /B REM ========================================================================================================================================================================= REM = EXAMINEFILE - FINDs useful strings in file, then returns to CALLer REM ========================================================================================================================================================================= :EXAMINEFILE CALL :MP 1 "Examine File %~1" CALL :EXISTORQUIT "%~1" STRINGS "%~1" | FINDSTR /R /C:"[A-Z][A-Z]\=" CALL :MF EXIT /B REM ========================================================================================================================================================================= REM = ADMINSHELL - sets prompt, then returns to CALLer REM ========================================================================================================================================================================= :ADMINSHELL CALL :MP 1 "Creating Admin Shell" CALL :EXISTORQUIT "%SYSTEMROOT%\system32\runas.exe" START %SYSTEMROOT%\system32\runas.exe /profile /savecred /user:%ADMINUSER% "%COMSPEC% /T:0C /E:ON /F:ON /K cmd.exe /K cd C:\CRYPT\BIN" CALL :MF EXIT /B REM ========================================================================================================================================================================= REM = EXISTORQUIT - checks %~1 exists, IF it does returns to CALLer, otherwise, quit REM ========================================================================================================================================================================= :EXISTORQUIT :: CALL :MP 1 "Checking for %~1" IF NOT EXIST "%~1" CALL :MDYE "%~1 NOT FOUND" EXIT /B REM ========================================================================================================================================================================= REM = RR - IF file %1 EXISTs then :MT "Removing %1" then :MF, then ( or IF %1 not EXISTs) returns to CALLer REM ========================================================================================================================================================================= :RR CALL :MP 1 "Removing %~1" IF EXIST "%~1" ERASE /q "%~1" CALL :MF && EXIT /B REM ========================================================================================================================================================================= REM = LOCKDOWN - locks workstation, then returns to CALLer (pointless) REM ========================================================================================================================================================================= :LOCKDOWN RUNDLL32 USER32.DLL,LockWorkStation && EXIT /B REM ========================================================================================================================================================================= REM = SHUTDOWNIN - initiates shutdown, then returns to CALLer (pointless) REM ========================================================================================================================================================================= REM shutdown /a aborts :SHUTDOWNIN SHUTDOWN -r -t "%~1" && EXIT /B REM ========================================================================================================================================================================= REM = LISTSERVICES - lists services, then returns to CALLer REM ========================================================================================================================================================================= :LISTSERVICES SC query state= all type= all | FOR /F "tokens=2" %%i IN ('FIND /I "SERVICE_NAME"') DO @ECHO %%i SC query | FOR /F "tokens=2" %%i IN ('FIND /I "SERVICE_NAME"') DO @ECHO %%i EXIT /B REM ========================================================================================================================================================================= REM = TASKS - REM ========================================================================================================================================================================= :TASKS SET _P=%~1 SET _PP= %~1 IF "%_PP%" == " " EXIT /B REM SORTABLES IF /I "%_P%" == "pid" ( tasklist.exe /V /NH | SORT /+29 && EXIT /B ) IF /I "%_P%" == "size" ( tasklist.exe /V /NH | SORT /+59 && EXIT /B ) IF /I "%_P%" == "user" ( tasklist.exe /V /NH | SORT /+89 && EXIT /B ) IF /I "%_P%" == "time" ( tasklist.exe /V /NH | SORT /+138 && EXIT /B ) IF /I "%_P%" == "window" ( tasklist.exe /V /NH | SORT /+152 && EXIT /B ) REM FILTERS IF /I "%_P%" == "image" ( tasklist.exe /V /NH /FI "IMAGENAME eq %~2" && EXIT /B ) IF /I "%_P%" == "username" ( tasklist.exe /V /NH /FI "USERNAME eq %~2" && EXIT /B ) IF /I "%_P%" == "running" ( tasklist.exe /V /NH /FI "STATUS eq Running" && EXIT /B ) IF /I "%_P%" == "status" ( tasklist.exe /V /NH /FI "STATUS eq %~2" && EXIT /B ) CALL :MF EXIT /B REM ======================================================================================= REM = SPEAK - Speak text REM ======================================================================================= :SPEAK REM ECHO "%~1" nircmd.exe speak text "%~1" 5 60 && EXIT /B REM ========================================================================================================================================================================= REM = MF - SLEEPs for 1 second, then prints out completed message, followed by 2 blank lines, then returns to CALLer REM ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- REM REM [COMPLETED] REM REM ========================================================================================================================================================================= :MF SLEEP 1 && ECHO [COMPLETED] && ECHO. && ECHO. && EXIT /B REM ========================================================================================================================================================================= REM = MM - prints blank line, L1, changes title of the interpreter window to %~1, prints >>> %~1..., L2, blank line, then returns to CALLer REM ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- REM REM +==============================================================================================================+ REM >>> Title Changed To This... REM +--------------------------------------------------------------------------------------------------------------+ REM REM ========================================================================================================================================================================= :MM SLEEP 1 && ECHO. && ECHO %L1% && title +++ %~1... && ECHO %P1% %~1... && ECHO %L2% && ECHO. && EXIT /B REM ========================================================================================================================================================================= REM = MT - prints blank line, L1, changes title of the interpreter window to %~1, prints >>> %~1..., L2, blank line, then returns to CALLer REM ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- REM REM +==============================================================================================================+ REM >>> Title Changed To This... REM +--------------------------------------------------------------------------------------------------------------+ REM REM ========================================================================================================================================================================= :MT CALL :MM "%~1" && CALL :SPEAK "%~1" && EXIT /B REM ========================================================================================================================================================================= REM = MP - , then returns to CALLer REM ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- REM REM P1=>>> REM P2=++ REM P3=:: REM REM ========================================================================================================================================================================= :MP IF "%~1" == "1" ECHO %P1% %~2 && EXIT /B IF "%~1" == "2" ECHO %P2% %~2 && ECHO. && EXIT /B IF "%~1" == "3" ECHO %P3% %~2 && EXIT /B EXIT /B REM ========================================================================================================================================================================= REM = MP3 - ECHO %~1, speak %~1 with nircmd.exe, then returns to CALLer REM ========================================================================================================================================================================= :MP3 CALL :MP 1 "%~1" && CALL :SPEAK "%~1" && EXIT /B REM ========================================================================================================================================================================= REM = MDYE - exit script with message %~1, then returns to CALLer REM ========================================================================================================================================================================= :MDYE SETLOCAL SET _M= %~1 IF NOT "%_M%" == " " SET _M=REASON: %~1 CALL :MP 1 "EXITING SCRIPT... %_M%" && ECHO. && ECHO. ENDLOCAL && EXIT /B REM ========================================================================================================================================================================= REM = MKILL - exit cmd processor with message %~1 REM ========================================================================================================================================================================= :MKILL SETLOCAL SET _M= %~1 IF NOT "%_M%" == " " SET _M=REASON: %~1 ECHO. && ECHO. && CALL :MP 1 "EXITING CMD WINDOW IN 3 SECONDS... %_M%" && ECHO. && ECHO. && SLEEP 3 ENDLOCAL && EXIT && EXIT && EXIT REM ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ REM ++ ++ REM ++ HELP AND SYNTAX FOR MISC COMMANDS ++ REM ++ ++ REM ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ REM ---- START ------------------------------------------------- REM START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED] [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL] [/WAIT] [/B] [cmd/program] [parameters] REM REM "title" Title to display in window title bar. REM path Starting directory REM B Start application without creating a new window. REM I The new environment will be the original environment passed to the cmd.exe and not the current environment. REM MIN Start window minimized REM MAX Start window maximized REM SEPARATE Start 16-bit Windows program in separate memory space REM SHARED Start 16-bit Windows program in shared memory space REM LOW Start application in the IDLE priority class REM NORMAL Start application in the NORMAL priority class REM HIGH Start application in the HIGH priority class REM REALTIME Start application in the REALTIME priority class REM ABOVENORMAL Start application in the ABOVENORMAL priority class REM BELOWNORMAL Start application in the BELOWNORMAL priority class REM WAIT Start application and wait for it to terminate REM cmd/program IF it is an internal cmd command or a batch file then the command processor is run with the /K switch to cmd.exe. Window REMains after command is run. REM parameters These are the parameters passed to the command/program REM ---- cmd ----------------------------------------------------------------- REM CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF] [[/S] [/C | /K] string] REM REM /C Carries out the command specified by string and then terminates REM /K Carries out the command specified by string but REMains REM /S Modifies the treatment of string after /C or /K (see below) REM /Q Turns ECHO off REM /D Disable execution of AutoRun commands from registry (see below) REM /A Causes the output of internal commands to a pipe or file to be ANSI REM /U Causes the output of internal commands to a pipe or file to be Unicode REM /T:fg Sets the foreground/background colors (see COLOR /? for more info) REM /E:ON Enable command extensions (see below) REM /E:OFF Disable command extensions (see below) REM /F:ON Enable file and directory name completion characters (see below) REM /F:OFF Disable file and directory name completion characters (see below) REM /V:ON Enable delayed environment variable expansion using ! as the delimiter. REM /V:OFF Disable delayed environment expansion. REM REM IF /D was NOT specified, then when CMD.EXE STARTs, it looks for the following registry variables, and executes them first. REM HKLM\Software\Microsoft\Command Processor\AutoRun and/or HKCU\Software\Microsoft\Command Processor\AutoRun REM ---- TrueCrypt ------------------------------------------------- REM TrueCrypt.exe [/a [devices|favorites]] [/b] [/c [y|n]] [/d [drive letter]] [/e] [/f] [/h [y|n]] [/k keyfile or search path] REM [/l drive letter] [/m {bk|rm|recovery|ro|sm|ts}] [/p password] [/q [background|preferences]] REM [/s] [/tokenlib path] [/v volume] [/w] REM REM TrueCrypt.exe [/a [devices|favorites]] REM [/b] REM [/c [y|n]] REM [/d [drive letter]] REM [/e] REM [/f] REM [/h [y|n]] REM [/k keyfile or search path] REM [/l drive letter] REM [/m {rm|ro|sm|ts}] REM [/p password] REM [/q [background|preferences]] REM [/s] REM [/v volume] REM [/w] REM REM /help or /? Display command line help. REM /volume or /v File and path name of a TrueCrypt volume to mount (do not use when dismounting). REM /letter or /l Driver letter to mount the volume as. When /l is omitted and when /a is used, the first free drive letter is used. REM /explore or /e Open an Explorer window after a volume has been mounted. REM /beep or /b Beep after a volume has been successfully mounted or dismounted. REM /auto or /a If no parameter, automount the volume. (/a devices), auto-mount all device/partition volumes. (/a favorites), auto-mount favorite REM /force or /f Forces dismount (IF the volume to be dismounted contains files being used) REM /keyfile or /k Specifies a keyfile or a keyfile search path. (/k c:\keyfile1.dat /k token://slot/SLOT_NUMBER/file/FILE_NAME) REM /tokenlib Use the specified PKCS #11 library for security tokens and smart cards. REM /cache or /c y or no parameter: enable password cache; n: disable password cache (e.g., /c n). REM /history or /h y or no parameter: enables saving history of mounted volumes; n: disables saving history of mounted volumes (e.g., /h n). REM /wipecache or /w Wipes any passwords cached in the driver memory. REM /password or /p The volume password. If the password contains spaces, use quotations (/p "My Pass"). Use (/p "") for empty password. REM /quit or /q Perform requested actions and exit (main TrueCrypt window not displayed). If preferences is specified as the parameter load/save options overriding command line. REM /q background launches the TrueCrypt Background Task (tray icon) unless it is disabled in the Preferences. REM /silent or /s If /q is specified, suppresses interaction with the user (prompts, error messages, warnings, etc.). If /q is not specified, this option has no effect. REM /mountoption or /m REM ro or readonly: Mount volume as read-only. REM rm or removable: Mount volume as removable medium. REM ts or timestamp: Do not preserve container modification timestamp REM sm or system: Without pre-boot authentication, mount a partition within system encryption (partition located on the encrypted system drive of another OS not running). REM bk or headerbak: Mount volume using embedded backup header. REM recovery: Do not verify checksums in the volume header. Should be used only when the volume header is damaged and cannot be mounted even with headerbak option. REM REM ---- plink ------------------------------------------------- REM plink [options] [user@]host [command] ("host" can also be a PuTTY saved session name) REM REM Options: REM -V Print version information and EXIT REM -v Show verbose messages (up to 3 times) REM -batch Disable all interactive prompts REM -ssh Force use of a ssh protocol REM -telnet Force use of a telnet protocol REM -rlogin Force use of a rlogin protocol REM -raw Force use of a raw protocol REM -load sessname Load settings from saved session 'sessname' REM -P port Connect to specified port REM -l user Connect with specified username REM -pw passwd Login with specified password REM -pgpfp Print PGP key fingerprints and EXIT REM -noagent Disable use of Pageant REM -agent Enable use of Pageant REM -D [listen-IP:]listen-port Dynamic SOCKS-based port forwarding REM -L [listen-IP:]listen-port:host:port Forward local port to REMote address REM -R [listen-IP:]listen-port:host:port Forward REMote port to local address REM -nc host:port Open tunnel in place of session (SSH-2 only) REM -X Enable X11 forwarding REM -x Disable X11 forwarding REM -A Enable agent forwarding REM -a Disable agent forwarding REM -t Enable pty allocation REM -T Disable pty allocation REM -1 Force use of SSH1 REM -2 Force use of SSH2 REM -4 Force use of IPv4 REM -6 Force use of IPv6 REM -C Enable compression REM -s Remote command is an SSH subsystem (SSH-2 only) REM -N Don't START a shell/command (SSH-2 only) REM -i key Private key file for authentication REM -m file Read REMote command(s) from file REM ---- attrib ------------------------------------------------- REM ATTRIB [+R | -R] [+A | -A ] [+S | -S] [+H | -H] [drive:][path][filename] [/S [/D]] REM REM + Sets an attribute. REM - Clears an attribute. REM R Read-only file attribute. REM A Archive file attribute. REM S System file attribute. REM H Hidden file attribute. REM [drive:][path][filename] Specifies a file or files for attrib to process. REM /S Processes matching files in the current folder and all subfolders. REM /D Processes folders as well. REM ---- ERASE ------------------------------------------------- REM ERASE [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names REM REM names Specifies a list of one or more files or directories. IF a directory is specified, all files within will be deleted. REM REM /P Prompts for confirmation before deleting each file. REM /F Force deleting of read-only files. REM /S Delete specified files from all subdirectories. REM /Q Quiet mode, do not ask IF ok to delete on global wildcard REM /A Selects files to delete based on attributes REM attributes R Read-only files REM S System files REM H Hidden files REM A Files ready for archiving REM - Prefix meaning not REM ---- sc ------------------------------------------------- REM sc [ServerName] REM config [ServiceName] REM [type= {own | share | kernel | filesys | rec | adapt | interact type= {own | share}}] REM [START= {boot | system | auto | demand | disabled}] REM [error= {normal | severe | critical | ignore}] REM [binpath= BinaryPathName] REM [group= LoadOrderGroup] REM [tag= {yes | no}] REM [depend= dependencies] REM [obj= {AccountName | ObjectName}] REM [displayname= DisplayName] REM [password= Password] REM ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- REM - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- REM ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------