Created
January 17, 2015 03:32
-
-
Save PsychoData/1ce3aced5f59311d6039 to your computer and use it in GitHub Desktop.
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 | |
::CheckForDF here | |
ECHO We will now test for DeepFreeze ether not installed or is thawed | |
Pause | |
ECHO. | |
set flagfile=C:\testjava.txt | |
::Flagfile variable should already be defined before calling this function | |
Goto :CheckForDF | |
:DFNotFrozen | |
ECHO DeepFreeze wasn't installed or is currently thawed | |
ECHO **Continue with the rest of the script** | |
ECHO. | |
PAUSE | |
GOTO:eof | |
::*************************** | |
::********Subroutines******** | |
::*************************** | |
:CheckForDF | |
WHERE dfc >nul 2>&1 | |
::ErrorLEvel 0 means file was found, which means DF is installed | |
IF %ERRORLEVEL% EQU 0 ( | |
dfc get /ISFROZEN | |
ECHO %errorlevel% | |
::ErrorLevel 0 - THAWED and ready to install | |
::ErrorLevel 1 - FROZEN and pointless to try | |
IF %errorlevel% EQU 1 ( | |
::Echo out what WOULD have been installed to a file so we could check that the | |
:: script still ran (and get an idea of how bad we need to unfreeze and log into each computer) | |
ECHO %flagfile% %date%%time% >> C:\BRCCIT\ScriptsSkippedByDeepFreeze.txt | |
ECHO ****DeepFreeze is currently frozen**** | |
ECHO. | |
PAUSE | |
::Else - DeepFreeze is thawed. return to normal script | |
goto :EOF | |
) | |
::DeepFreeze is thawed, but is installed. We'll just fall through to the not installed result | |
) | |
::DeepFreeze Installation not found. Okay to return to normal script | |
ECHO DeepFreeze is not installed | |
goto :DFNotFrozen |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment