daily pastebin goal
47%
SHARE
TWEET

Bootless Star - v1.5.3

Siberian_Tiger Sep 1st, 2013 (edited) 440 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @REM Created by Nicholas "Tiger" Gautier
  2. @REM Contact: SibTiger_And_Life@Hotmail.com
  3. @REM Website: http://tigersfiles.webs.com/
  4. @REM Details: This program [the core], is designed as a front-end program that sets the environment for any compatible module.  This program depends on external scripts to carry out any specific task or operations the user requests, such external modules can depend on the environment that this program provides to make life easier for both the end-user and the programmer.
  5. @REM ==========================================
  6.  
  7. @ECHO OFF
  8. ECHO Executing %0...
  9. ECHO.
  10. REM Before we begin the initial program, check the host operating system.
  11. GOTO :IncompatibilityOS_Check
  12.  
  13.  
  14.  
  15.  
  16. REM =====================================================================
  17. REM Terms of Agreement (AKA Legal Crap)
  18. REM ----------------------------
  19. REM Self explanatory....
  20. REM =====================================================================
  21.  
  22.  
  23. REM I have removed the code and the terms of agreement wording from this section.  I am sure that it is not accurate and I am not a lawyer, but instead I am just a creator.  I have created this program for several reasons:
  24. REM    A} To make some tedious tasks - less tedious and expeditious
  25. REM    B} To help others get the job[s] finished
  26. REM    C} Allow everyone to use this program and even further expand it for their reasons or purposes
  27. REM
  28. REM In exchange all that I ask for those wanting to create a script or module [I can't force anyone to follow these]:
  29. REM    A} When you create a module or script that is designed for this program, do NOT mislead the user.  Thus, do not cause intentional harm to the user our their system.
  30. REM    B} Modules and scripts source code should always be available.  With batch, that shouldn't be much of a problem as the scripts are already readable.
  31. REM
  32. REM If someone wishes to take this entire program and up[date|grade] it or change it for whatever reasons, feel free to-do so.  Do not, however, charge users (currency wise) for using and retrieving the program.  I [the creator of this program] would like _some_ credit for the main work, the meaning of _some_ can be a simple comment within the program.
  33.  
  34.  
  35.  
  36.  
  37. REM =====================================================================
  38. REM Startup Driver
  39. REM ----------------------------
  40. REM When starting the program, this section will help aid the program to start up correctly and properly set the environment before allowing the user to take control.
  41. REM =====================================================================
  42.  
  43.  
  44. REM # =============================================================================================
  45. REM # Documentation: Startup procedure function; this will help guide the program to startup correctly.
  46. REM # =============================================================================================
  47. :Startup_Driver
  48. REM Change the users working directory, if necessary.
  49. CALL :ClientWorkingDirectorySetup_Driver
  50. IF %ERRORLEVEL% GEQ 1 (GOTO :Startup_ManageErrHook)
  51. REM ---- ---- ----
  52. REM Pass through the Environment setup
  53. CALL :EnvironmentSetup_Switch StartUp
  54. REM ---- ---- ----
  55. CALL :ClearBuffer 1
  56. GOTO :MainScreen
  57.  
  58.  
  59.  
  60. REM # =============================================================================================
  61. REM # Documentation: When the Environment Hooking reaches an error, this function will call the 'Kill' function.
  62. REM # =============================================================================================
  63. :Startup_ManageErrHook
  64. IF %ErrorLevel% EQU 1 CALL :Kill Hook_Operation ExtCMD
  65. IF %ErrorLevel% EQU 2 CALL :Kill Hook_Operation WDFailure
  66.  
  67.  
  68.  
  69.  
  70. REM =====================================================================
  71. REM Host System Compatibility Check
  72. REM ----------------------------
  73. REM Windows 9x\ME batch version will _NOT_ work correctly with this program, and as such - if this program detects that the OS is Windows 9x or Windows ME, the program will terminate.
  74. REM
  75. REM Notes:
  76. REM MS_DOS == Possibly earlier releases before Windows 95, Windows 95, Windows 98, Windows ME
  77. REM Windows_NT == Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 8.1
  78. REM =====================================================================
  79.  
  80.  
  81. REM # =============================================================================================
  82. REM # Documentation: This function will check the host system's variable [ %OS% - System Variable ] and determine if the host system is compatible with the program.  As a safety precaution, if the OS is not compatible, immediately stop the program from running any further.  However, if the OS is in fact compatible the program, then start the execution process.
  83. REM # =============================================================================================
  84. :IncompatibilityOS_Check
  85. IF "%OS%" EQU "Windows_NT" (
  86.     SET IncompatibleOS=False
  87.    REM Begin the initial program.
  88.     GOTO :Startup_Driver
  89. ) ELSE (
  90.    REM MS_DOS or not supported
  91.    REM Host is not compatible
  92.     SET IncompatibleOS=True
  93.     GOTO :Kill
  94. )
  95.  
  96.  
  97.  
  98.  
  99. REM =====================================================================
  100. REM Global Functions
  101. REM ----------------------------
  102. REM These functions listed below is used to reduce redundancy within the program by having these functions to be generally used within the code.
  103. REM =====================================================================
  104.  
  105.  
  106. REM # =============================================================================================
  107. REM # Parameters: [{Bool} FlushData]
  108. REM # Documentation: This function simply clears the terminal buffer, and depending on the parameter this can also clear the StandardIn [STDIN] identifier.
  109. REM # =============================================================================================
  110. :ClearBuffer
  111. CLS
  112. REM Clear the STDIN
  113. IF %1 EQU 1 SET STDIN=
  114. GOTO :EOF
  115.  
  116.  
  117. REM # =============================================================================================
  118. REM # Documentation: This function will simply clear the STDIN variable
  119. REM # =============================================================================================
  120. :ClearSTDIN
  121. SET STDIN=
  122. GOTO :EOF
  123.  
  124.  
  125.  
  126. REM # =============================================================================================
  127. REM # Documentation: This function captures the user's input from the keyboard.
  128. REM # =============================================================================================
  129. :UserInput
  130. ECHO.
  131. ECHO %SeparatorSmall%
  132. SET /P STDIN=^>^>^>^>
  133. GOTO :EOF
  134.  
  135.  
  136.  
  137. REM # =============================================================================================
  138. REM # Documentation: This function will call the main Dashboard function directly, this is if the user has enabled the Dashboard functionality within the program.
  139. REM # =============================================================================================
  140. :DashboardDisplay
  141. IF %DashboardViewerTool% EQU True CALL :Dashboard
  142. GOTO :EOF
  143.  
  144.  
  145.  
  146. REM # =============================================================================================
  147. REM # Parameters: [{String} Target]
  148. REM # Documentation: This function will call the Windows Explorer and open the destination that is given when calling this function with a parameter.
  149. REM # =============================================================================================
  150. :Call_WindowsExplorer
  151. EXPLORER "%~1"
  152. GOTO :EOF
  153.  
  154.  
  155.  
  156. REM # =============================================================================================
  157. REM # Parameters: [{String} File]
  158. REM # Documentation: This function will update the title of the core and display what script is being executed.
  159. REM # =============================================================================================
  160. :UpdateCoreTitleExecutingScript
  161. SET "ProcessVarA=%core.Title% [Running: %~n1]"
  162. TITLE %ProcessVarA%
  163. REM ProcessVarA is left as is so the caller (that called this function) can utilize it if needed
  164. GOTO :EOF
  165.  
  166.  
  167.  
  168. REM # =============================================================================================
  169. REM # Documentation: This function will only display a read error message when the user requests to install a script.
  170. REM # =============================================================================================
  171. :CantInstallScriptErrorMessage
  172. ECHO The directory could not be found!  It is not possible to install or even execute any scripts!
  173. ECHO.
  174. ECHO Possible Solutions:
  175. ECHO 1) Check user permissions on the system.
  176. ECHO 2) The program [%ProgramName%] is not in a tightly limited permissive directory
  177. ECHO 3) Hardware faults; check for File System corruptions and health of the Secondary Storage device [HDD and\or SDD]
  178. GOTO :EOF
  179.  
  180.  
  181.  
  182. REM # =============================================================================================
  183. REM # Documentation: This function will be called when the user's input does not meet the criteria that the program was wanting.  This is typically used when using the menu selections.
  184. REM # =============================================================================================
  185. :BadInput
  186. ECHO.&ECHO.
  187. ECHO ^<!^>    Invalid Input    ^<!^>
  188. ECHO %Separator%
  189. ECHO.
  190. ECHO !ERR: Incorrect feedback from the user.
  191. ECHO User Feedback: "%STDIN%"
  192. ECHO.
  193. PAUSE
  194. CALL :ClearBuffer 1
  195. GOTO :EOF
  196.  
  197.  
  198.  
  199.  
  200. REM =====================================================================
  201. REM Dashboard
  202. REM ----------------------------
  203. REM The dashboard here is to only highlight important and display what the user needs to know for the program to work correctly.
  204. REM The idea of this dashboard, is to NOT be so verbose or full of details, but only display quick and brief details.
  205. REM This feature - within the core - does not require so much intensive work as there is not write into memory, but only reads.  Turning this feature off will not really help aid the program performance sakes.
  206. REM =====================================================================
  207.  
  208.  
  209. REM # =============================================================================================
  210. REM # Documentation: This function is the central point for the Dashboard Viewer tool.
  211. REM # =============================================================================================
  212. :Dashboard
  213. CALL :Dashboard_HeaderBorder
  214. ECHO                  Dashboard Viewer
  215. ECHO Ver: %ProgramVersion%                           %ProgramReleaseDate%
  216. ECHO Preset: %UserConfigurationLoaded%
  217. CALL :Dashboard_FooterBorder
  218. CALL :Dashboard_ExtraLineBreaks
  219. GOTO :EOF
  220.  
  221.  
  222.  
  223. REM # =============================================================================================
  224. REM # Documentation: After displaying the dashboard, this will add a few extra lines.  This will help keep the dashboard's contents from being smashed against other content.
  225. REM # =============================================================================================
  226. :Dashboard_ExtraLineBreaks
  227. ECHO.&ECHO.&ECHO.
  228. GOTO :EOF
  229.  
  230.  
  231.  
  232. REM # =============================================================================================
  233. REM # Documentation: Display the header for the Dashboard Viewer tool
  234. REM # =============================================================================================
  235. :Dashboard_HeaderBorder
  236. ECHO %SeparatorLong%
  237. GOTO :EOF
  238.  
  239.  
  240.  
  241. REM # =============================================================================================
  242. REM # Documentation: Display the footer for the Dashboard Viewer tool
  243. REM # =============================================================================================
  244. :Dashboard_FooterBorder
  245. ECHO %SeparatorLong%
  246. ECHO %SeparatorLong%
  247. GOTO :EOF
  248.  
  249.  
  250.  
  251.  
  252. REM =====================================================================
  253. REM Environment Hooking
  254. REM ----------------------------
  255. REM Hook the client's working directory to be exactly the same as the program's absolute path.
  256. REM This entire feature is necessary if in case the program is executed with Root access (Administrator access) which the user's working directory will be exactly: %SystemRoot%\system32.  Additionally, for those that use the terminal on Windows and invoke the program from a different working directory that is not the program's path.  In order for this program to work efficiently, we simply must alter the users current working directory to match with the program's working directory.  Once the program has be terminated [safely], the previous working directory is restored -- The user will never know that their working directory has been changed while using this program.
  257. REM =====================================================================
  258.  
  259.  
  260. REM # =============================================================================================
  261. REM # Documentation: This function manages the entire 'Environment Hooking' functionality.
  262. REM # =============================================================================================
  263. :ClientWorkingDirectorySetup_Driver
  264. REM Cache the directory locations for processing
  265. CALL :ClientWorkingDirectorySetup_SetupPathVariables
  266. REM Compare the working dir. and program dir.
  267. CALL :ClientWorkingDirectorySetup_ComparePaths
  268. IF %ERRORLEVEL% EQU 0 (
  269.    REM Hooking passed
  270.     GOTO :ClientWorkingDirectorySetup_Successful
  271. )
  272. REM From here, there was a mismatch.
  273. REM -----
  274. REM when we need update the users WD, this driver is going to manage the entire procedure.
  275. CALL :ClientWorkingDirectorySetup_ChangeUserWD
  276. IF %ERRORLEVEL% EQU 1 (
  277.     EXIT /B 1
  278. )
  279. CALL :ClientWorkingDirectorySetup_ComparePaths
  280. IF %ERRORLEVEL% EQU 0 (
  281.    REM Hooking passed
  282.     GOTO :ClientWorkingDirectorySetup_Successful
  283. ) ELSE (
  284.    REM Kill the program
  285.     CALL :ClientWorkingDirectorySetup_Failed
  286.     EXIT /B 2
  287. )
  288.  
  289.  
  290.  
  291. REM # =============================================================================================
  292. REM # Documentation: Cache the directory locations into variables that will be used for processing.
  293. REM # =============================================================================================
  294. :ClientWorkingDirectorySetup_SetupPathVariables
  295. REM cache the current Program Directory.
  296. SET Hook_ProgramDir=%~dp0
  297. REM This caches the filename of the program.
  298. SET ProgramFileName=%~n0
  299. REM Set the users current working directory to memory, regardless if necessary.
  300. SET HookingUserWDCache=%CD%
  301. GOTO :EOF
  302.  
  303.  
  304.  
  305. REM # =============================================================================================
  306. REM # Documentation: Display the stored contents on the terminal when a serious error occurs.  Ideally, this function is meant to be displayed before the program completely terminates due to a failed hooking operation.
  307. REM # =============================================================================================
  308. :ClientWorkingDirectorySetup_DisplayPaths
  309. ECHO Current Directory Path Setup
  310. ECHO ----------------------------------------
  311. ECHO %ProgramFileName% Directory is:
  312. ECHO   %Hook_ProgramDir%
  313. ECHO %UserName%'s Working Directory is:
  314. ECHO   %CD%\
  315. ECHO.
  316. GOTO :EOF
  317.  
  318.  
  319.  
  320. REM # =============================================================================================
  321. REM # Documentation: Compare the users working directory against the program's directory.
  322. REM # =============================================================================================
  323. :ClientWorkingDirectorySetup_ComparePaths
  324. ECHO ^> Comparing the user's working directory with the program's directory...
  325. REM Do we need to change the users working directory?
  326. IF "%CD%\" EQU "%Hook_ProgramDir%" (
  327.    REM Match
  328.     ECHO The user's working directory matches with the program's working directory!
  329.     EXIT /B 0
  330. ) ELSE (
  331.    REM Mismatch
  332.     ECHO !ERR: The user's working directory does not match with the program's directory!
  333.     EXIT /B 1
  334. )
  335.  
  336.  
  337.  
  338. REM # =============================================================================================
  339. REM # Documentation: Change the user's working directory to match with the program's directory.
  340. REM # =============================================================================================
  341. :ClientWorkingDirectorySetup_ChangeUserWD
  342. ECHO ^> Changing the user's working directory...
  343. CD /D "%Hook_ProgramDir%" || EXIT /B 1
  344. EXIT /B 0
  345.  
  346.  
  347.  
  348. REM # =============================================================================================
  349. REM # Documentation: This function will notify the parent function that this operation was successful.
  350. REM # =============================================================================================
  351. :ClientWorkingDirectorySetup_Successful
  352. SET Hook_Operation=1
  353. ECHO Operation Successful!
  354. EXIT /B 0
  355.  
  356.  
  357.  
  358. REM # =============================================================================================
  359. REM # Documentation: This function will notify the parent function that this operation failed.
  360. REM # =============================================================================================
  361. :ClientWorkingDirectorySetup_Failed
  362. SET Hook_Operation=0
  363. GOTO :EOF
  364.  
  365.  
  366.  
  367.  
  368. REM =====================================================================
  369. REM Environment Setup Manager
  370. REM ----------------------------
  371. REM This entire section sets the programs environment as well as declarations that is used within this program, this will also set a default configuration for the user.  Within this section, it is also possible to write the identifiers information in to a file, which is specifically for saving the user configuration, and also printing the current value within the terminal.
  372. REM When passing through this section, it is crucially important to look over the EnvironmentSetup_Switch.  This function demands a parameter to work correctly, otherwise the return result will be an error.
  373. REM =====================================================================
  374.  
  375.  
  376. REM # =============================================================================================
  377. REM # Parameters: [{int} Mode]
  378. REM # Documentation: This driver determines the action to take within the initialization field.
  379. REM # Parameter details:
  380. REM # 0 = Initialize
  381. REM # 1 = Save User Variables
  382. REM # 2 = Debug
  383. REM # =============================================================================================
  384. :EnvironmentSetup_Switch
  385. IF "%1" EQU "StartUp" (
  386.    REM When the program is starting up
  387.     CALL :EnvironmentSetup_Core
  388.     CALL :EnvironmentSetup_TerminalUpdates
  389.     CALL :EnvironmentSetup_UserSettings 0
  390.     CALL :EnvironmentSetup_DirectoryCheck
  391.     CALL :EnvironmentSetup_Find_dotNETFoundations
  392.     CALL :EnvironmentSetup_CheckEnvironmentPrivileges
  393.     CALL :EnvironmentSetup_Setup_Time-and-Date
  394.     EXIT /B 0
  395. )
  396. IF "%1" EQU "Restart" (
  397.    REM When the program is requested to reset its already declared and assigned variables
  398.     CALL :EnvironmentSetup_TerminalUpdates
  399.     CALL :EnvironmentSetup_UserSettings 0
  400.     CALL :EnvironmentSetup_DirectoryCheck
  401.     CALL :EnvironmentSetup_Find_dotNETFoundations
  402.     CALL :EnvironmentSetup_Setup_Time-and-Date
  403.     EXIT /B 0
  404. )
  405. REM ----
  406. IF "%1" EQU "UserConfigSave" (
  407.    REM Save user configuration
  408.     CALL :EnvironmentSetup_UserSettings 1 "%DirSavePresets%\%STDIN%"
  409.     EXIT /B 0
  410. )
  411. REM ----
  412. IF "%1" EQU "DebugUser" (
  413.    REM Display the user's variables on screen
  414.     CALL :EnvironmentSetup_UserSettings 2
  415.     EXIT /B 0
  416. )
  417. IF "%1" EQU "Thrash" (
  418.    REM When the program terminates, clear some sensitive variables.
  419.     CALL :EnvironmentSetup_UninitializeVars
  420.     EXIT /B 0
  421. )
  422. IF "%1" EQU "PathRestore" (
  423.    REM When the user wishes to restore a program path to the original state
  424.     CALL :EnvironmentSetup_UserSettings "%~2"
  425.     EXIT /B 0
  426. )
  427. IF "%1" EQU "PartialReset" (
  428.    REM When a script finishes, this will reset some of the environment that could have changed.
  429.     CALL :EnvironmentSetup_TerminalUpdates
  430.     EXIT /B 0
  431. )
  432. IF "%1" EQU "UserConfigLoad" (
  433.    REM When loading a configuration, check wither the directory and program targets can still be detected.
  434.     CALL :EnvironmentSetup_DirectoryCheck
  435.     EXIT /B 0
  436. )
  437. IF "%1" EQU "CheckExternalResources" (
  438.    REM Check the directory and program targets and determine if they exist.
  439.     CALL :EnvironmentSetup_DirectoryCheck
  440.     EXIT /B 0
  441. )
  442. REM ----
  443. REM Error; Either the parameter wasn't correct or there was no parameter.
  444. CALL :EnvironmentSetup_SwitchError
  445. EXIT /B 1
  446.  
  447.  
  448.  
  449. REM # =============================================================================================
  450. REM # Documentation: If the EnvironmentSetup_Switch reaches an error, this function will merely return an error.
  451. REM # =============================================================================================
  452. :EnvironmentSetup_SwitchError
  453. REM The Switch method was invoked with an improper or unsupported parameter type.
  454. ECHO !ERR: The Environment Switch was called with an improper setting!
  455. PAUSE
  456. GOTO :EOF
  457.  
  458.  
  459.  
  460. REM # =============================================================================================
  461. REM # Documentation: This function houses static declarations for the core environment.
  462. REM # =============================================================================================
  463. :EnvironmentSetup_Core
  464. SET ProgramName=Bootless Star
  465. SET ProgramVersion=1.5.3
  466. SET ProgramReleaseDate=7.October.2014
  467. SET CodeName=Aditi
  468. REM Program Title
  469. SET core.Title=%ProgramName% %ProgramVersion% ^(%CodeName%^)
  470. REM Borders
  471. SET Separator=-------------------------
  472. SET SeparatorLong=--------------------------------------------------
  473. SET SeparatorSmall=-------------
  474. REM Bell Character
  475. SET SND_BELL=
  476. REM User Input
  477. SET STDIN=NULL
  478. REM Set the ExitCode to 3; This value means: unexpected error or crash-out
  479. SET ExitCode=3
  480. REM Modules ExitCode
  481. SET scriptExitCode=0
  482. REM Working Variables - adjacent to Intel's CISC working registries [AX, BX, CX, DX]
  483. SET ProcessVarA=NULL
  484. SET ProcessVarB=NULL
  485. SET ProcessVarC=NULL
  486. SET ProcessVarD=NULL
  487. REM Dedicated Directories
  488. REM  User Configurations
  489. SET DirSavePresets=.\Presets
  490. REM  Stand-alone scripts
  491. SET DirSubScripts=.\Scripts
  492. REM  Documentation
  493. SET DirDocuments=.\Documents
  494. REM  Core Compatible scripts [Designed to work with this program]
  495. SET DirProjects=.\Projects
  496. REM  Preset Configuration Name
  497. SET UserConfigurationLoaded=coreDefault
  498. REM  Preset Configuration Unique Key Chain Token
  499. REM    When the user saves a configuration, they will gain a new token number - which should remain unique to the user.  The token number is what is going to be the filename for all of the modules that the user executes with this program.
  500. SET UserConfigurationKeyChainToken=0
  501. REM  Is the OS compatible with this program?
  502. SET IncompatibleOS=False
  503. REM  Toggle ECHO mode; view all of the code in Real Time
  504. SET DebugMode=False
  505. REM Detection identifiers
  506. SET Detect_SVN=False
  507. SET Detect_7Zip=False
  508. SET Detect_InnoSetup=False
  509. SET Detect_MinGW=False
  510. SET Detect_MSHTMLWorkShop=False
  511. SET Detect_MSVS120COMMTOOLS=False
  512. SET Detect_MSVS110COMMTOOLS=False
  513. SET Detect_MSVS100COMMTOOLS=False
  514. SET Detect_MSVS90COMMTOOLS=False
  515. SET Detect_MSVS80COMMTOOLS=False
  516. SET Detect_MicrosoftVisualStudio=False
  517. SET Detect_dotNET1=False
  518. SET Detect_dotNET1.1=False
  519. SET Detect_dotNET2=False
  520. SET Detect_dotNET2-64=False
  521. SET Detect_dotNET3=False
  522. SET Detect_dotNET3-64=False
  523. SET Detect_dotNET3.5=False
  524. SET Detect_dotNET3.5-64=False
  525. SET Detect_dotNET4=False
  526. SET Detect_dotNET4-64=False
  527. REM NOTE: Robocopy was never included into Windows [officially] until Vista [6.0]; Windows XP [5.1] and earlier never had Robocopy.
  528. SET Detect_Robocopy=False
  529. SET Detect_Python3=False
  530. SET Detect_Python2=False
  531. GOTO :EOF
  532.  
  533.  
  534.  
  535. REM # =============================================================================================
  536. REM # Documentation: This function houses settings that are to be part of the environment.
  537. REM # =============================================================================================
  538. :EnvironmentSetup_TerminalUpdates
  539. TITLE %core.Title%
  540. GOTO :EOF
  541.  
  542.  
  543.  
  544. REM # =============================================================================================
  545. REM # Parameters: [{string} Mode]
  546. REM # Documentation: This function houses the users configuration.  This function also has multiple purposes within the user declaration field.
  547. REM # Parameter details:
  548. REM # 0 = Set the default Value
  549. REM # 1 = Save the information into a preset configuration.
  550. REM # 2 = Display the value on the terminal screen.
  551. REM # =============================================================================================
  552. :EnvironmentSetup_UserSettings
  553. REM Dashboard Viewer Functionality
  554. IF %1 EQU 0 SET DashboardViewerTool=True
  555. IF %1 EQU 1 (ECHO REM When true, this will allow the Dashboard Viewer tool to be displayed in the program.)>> "%~2"
  556. IF %1 EQU 1 (ECHO SET DashboardViewerTool=%DashboardViewerTool%)>> "%~2"
  557. IF %1 EQU 2 ECHO DashboardViewerTool -^> %DashboardViewerTool%
  558. REM ----
  559. REM Open Windows File Manager and perform simple tasks [highlight an object, for example]
  560. IF %1 EQU 0 SET CallExplorerCommands=True
  561. IF %1 EQU 1 (ECHO REM When true, this will allow modules to call Windows Explorer.  This can allow modules to open windows and highlight objects within the desktop environment.)>> "%~2"
  562. IF %1 EQU 1 (ECHO SET CallExplorerCommands=%CallExplorerCommands%)>> "%~2"
  563. IF %1 EQU 2 ECHO CallExplorerCommands -^> %CallExplorerCommands%
  564. REM ----
  565. REM Default duplicating software
  566. IF %1 EQU 0 SET CopyMethod=XCOPY
  567. IF %1 EQU 1 (ECHO REM Default copying software to use within the program and modules.)>> "%~2"
  568. IF %1 EQU 1 (ECHO SET CopyMethod=%CopyMethod%)>> "%~2"
  569. IF %1 EQU 2 ECHO CopyMethod -^> %CopyMethod%
  570. REM ----
  571. REM XCOPY Argument Set
  572. IF %1 EQU 0 SET XCopyArg=/V /C /Y /Z
  573. IF %1 EQU 1 (ECHO REM XCopy's parameters.)>> "%~2"
  574. IF %1 EQU 1 (ECHO SET XCopyArg=%XCopyArg%)>> "%~2"
  575. IF %1 EQU 2 ECHO XCopyArg -^> %XCopyArg%
  576. REM ----
  577. REM XCopy Switch: Verify
  578. IF %1 EQU 0 SET ParametersXCopy.Verify=True
  579. IF %1 EQU 1 (ECHO REM Batch External Command XCopy; Switch: Verify)>> "%~2"
  580. IF %1 EQU 1 (ECHO SET ParametersXCopy.Verify=%ParametersXCopy.Verify%)>> "%~2"
  581. IF %1 EQU 2 ECHO ParametersXCopy.Verify -^> %ParametersXCopy.Verify%
  582. REM ----
  583. REM XCopy Switch: Continue operation regardless of errors
  584. IF %1 EQU 0 SET ParametersXCopy.Continue=True
  585. IF %1 EQU 1 (ECHO REM Batch External Command XCopy; Switch: Continue even with errors)>> "%~2"
  586. IF %1 EQU 1 (ECHO SET ParametersXCopy.Continue=%ParametersXCopy.Continue%)>> "%~2"
  587. IF %1 EQU 2 ECHO ParametersXCopy.Continue -^> %ParametersXCopy.Continue%
  588. REM ----
  589. REM XCopy Switch: Encrypt files to destination even if destination does not support it
  590. IF %1 EQU 0 SET ParametersXCopy.Encrypt=False
  591. IF %1 EQU 1 (ECHO REM Batch External Command XCopy; Switch: Encrypt files to destination)>> "%~2"
  592. IF %1 EQU 1 (ECHO SET ParametersXCopy.Encrypt=%ParametersXCopy.Encrypt%)>> "%~2"
  593. IF %1 EQU 2 ECHO ParametersXCopy.Encrypt -^> %ParametersXCopy.Encrypt%
  594. REM ----
  595. REM XCopy Switch: Suppress warning messages
  596. IF %1 EQU 0 SET ParametersXCopy.Suppress=True
  597. IF %1 EQU 1 (ECHO REM Batch External Command XCopy; Suppress warning messages)>> "%~2"
  598. IF %1 EQU 1 (ECHO SET ParametersXCopy.Suppress=%ParametersXCopy.Suppress%)>> "%~2"
  599. IF %1 EQU 2 ECHO ParametersXCopy.Suppress -^> %ParametersXCopy.Suppress%
  600. REM ----
  601. REM XCopy Switch: Network Restartable Mode
  602. IF %1 EQU 0 SET ParametersXCopy.Restart=True
  603. IF %1 EQU 1 (ECHO REM Batch External Command XCopy; Switch: Network Restartable Mode)>> "%~2"
  604. IF %1 EQU 1 (ECHO SET ParametersXCopy.Restart=%ParametersXCopy.Restart%)>> "%~2"
  605. IF %1 EQU 2 ECHO ParametersXCopy.Restart -^> %ParametersXCopy.Restart%
  606. REM ----
  607. REM Robocopy Switch: Network Restart Mode (Backup Mode if failure)
  608. IF %1 EQU 0 SET ParametersRobocopy.RestartBackup=True
  609. IF %1 EQU 1 (ECHO REM Batch External Command Robocopy; Switch: Network Restart Mode - Backup Mode if Permission Failure)>> "%~2"
  610. IF %1 EQU 1 (ECHO SET ParametersRobocopy.RestartBackup=%ParametersRobocopy.RestartBackup%)>> "%~2"
  611. IF %1 EQU 2 ECHO ParametersRobocopy.RestartBackup -^> %ParametersRobocopy.RestartBackup%
  612. REM ----
  613. REM Robocopy Switch: Restrict Deep Paths
  614. IF %1 EQU 0 SET ParametersRobocopy.RestrictDeepPaths=False
  615. IF %1 EQU 1 (ECHO REM Batch External Command Robocopy; Switch: Restrict Deep Paths)>> "%~2"
  616. IF %1 EQU 1 (ECHO SET ParametersRobocopy.RestrictDeepPaths=%ParametersRobocopy.RestrictDeepPaths%)>> "%~2"
  617. IF %1 EQU 2 ECHO ParametersRobocopy.RestrictDeepPaths -^> %ParametersRobocopy.RestrictDeepPaths%
  618. REM ----
  619. REM Robocopy Switch: No Junction Pointers
  620. IF %1 EQU 0 SET ParametersRobocopy.NoJunctionPoints=True
  621. IF %1 EQU 1 (ECHO REM Batch External Command Robocopy; Switch: No Junction Pointers)>> "%~2"
  622. IF %1 EQU 1 (ECHO SET ParametersRobocopy.NoJunctionPoints=%ParametersRobocopy.NoJunctionPoints%)>> "%~2"
  623. IF %1 EQU 2 ECHO ParametersRobocopy.NoJunctionPoints -^> %ParametersRobocopy.NoJunctionPoints%
  624. REM ----
  625. REM Robocopy Switch: Display Full Path Location
  626. IF %1 EQU 0 SET ParametersRobocopy.FullPath=True
  627. IF %1 EQU 1 (ECHO REM Batch External Command Robocopy; Switch: Display Full Path Location)>> "%~2"
  628. IF %1 EQU 1 (ECHO SET ParametersRobocopy.FullPath=%ParametersRobocopy.FullPath%)>> "%~2"
  629. IF %1 EQU 2 ECHO ParametersRobocopy.FullPath -^> %ParametersRobocopy.FullPath%
  630. REM ----
  631. REM Robocopy Switch: Verbose Mode
  632. IF %1 EQU 0 SET ParametersRobocopy.Verbose=True
  633. IF %1 EQU 1 (ECHO REM Batch External Command Robocopy; Switch: Verbose Mode)>> "%~2"
  634. IF %1 EQU 1 (ECHO SET ParametersRobocopy.Verbose=%ParametersRobocopy.Verbose%)>> "%~2"
  635. IF %1 EQU 2 ECHO ParametersRobocopy.Verbose -^> %ParametersRobocopy.Verbose%
  636. REM ----
  637. REM Robocopy Switch: Display File Sizes in Bytes
  638. IF %1 EQU 0 SET ParametersRobocopy.BytesFileSize=False
  639. IF %1 EQU 1 (ECHO REM Batch External Command Robocopy; Switch: Show File Size in Bytes)>> "%~2"
  640. IF %1 EQU 1 (ECHO SET ParametersRobocopy.BytesFileSize=%ParametersRobocopy.BytesFileSize%)>> "%~2"
  641. IF %1 EQU 2 ECHO ParametersRobocopy.BytesFileSize -^> %ParametersRobocopy.BytesFileSize%
  642. REM ----
  643. REM Robocopy Switch: Do Not Display Progress
  644. IF %1 EQU 0 SET ParametersRobocopy.NoProgress=False
  645. IF %1 EQU 1 (ECHO REM Batch External Command Robocopy; Switch: Do Not Display Progress)>> "%~2"
  646. IF %1 EQU 1 (ECHO SET ParametersRobocopy.NoProgress=%ParametersRobocopy.NoProgress%)>> "%~2"
  647. IF %1 EQU 2 ECHO ParametersRobocopy.NoProgress -^> %ParametersRobocopy.NoProgress%
  648. REM ----
  649. REM Robocopy Switch: Display Estimated Time of Arrival
  650. IF %1 EQU 0 SET ParametersRobocopy.ETA=True
  651. IF %1 EQU 1 (ECHO REM Batch External Command Robocopy; Switch: Display Estimated Time of Arrival)>> "%~2"
  652. IF %1 EQU 1 (ECHO SET ParametersRobocopy.ETA=%ParametersRobocopy.ETA%)>> "%~2"
  653. IF %1 EQU 2 ECHO ParametersRobocopy.ETA -^> %ParametersRobocopy.ETA%
  654. REM ----
  655. REM Robocopy Switch: Maximum Retries
  656. IF %1 EQU 0 SET ParametersRobocopy.Retry=20
  657. IF %1 EQU 1 (ECHO REM Batch External Command Robocopy; Switch: Max Retries)>> "%~2"
  658. IF %1 EQU 1 (ECHO SET ParametersRobocopy.Retry=%ParametersRobocopy.Retry%)>> "%~2"
  659. IF %1 EQU 2 ECHO ParametersRobocopy.Retry -^> %ParametersRobocopy.Retry%
  660. REM ----
  661. REM Robocopy Switch: Maximum Wait Time
  662. IF %1 EQU 0 SET ParametersRobocopy.Wait=30
  663. IF %1 EQU 1 (ECHO REM Batch External Command Robocopy; Switch: Maximum Wait Time)>> "%~2"
  664. IF %1 EQU 1 (ECHO SET ParametersRobocopy.Wait=%ParametersRobocopy.Wait%)>> "%~2"
  665. IF %1 EQU 2 ECHO ParametersRobocopy.Wait -^> %ParametersRobocopy.Wait%
  666. REM ----
  667. REM Robocopy Switch: Multithreading
  668. IF %1 EQU 0 SET ParametersRobocopy.Multithread=2
  669. IF %1 EQU 1 (ECHO REM Batch External Command Robocopy; Switch: Multithreading)>> "%~2"
  670. IF %1 EQU 1 (ECHO SET ParametersRobocopy.Multithread=%ParametersRobocopy.Multithread%)>> "%~2"
  671. IF %1 EQU 2 ECHO ParametersRobocopy.Multithread -^> %ParametersRobocopy.Multithread%
  672. REM ----
  673. REM Robocopy Argument Set
  674. IF %1 EQU 0 SET RoboCopyArg=/ZB /XD /FP /V /BYTES /ETA /R:%ParametersRobocopy.Retry% /W:%ParametersRobocopy.Wait% /MT:%ParametersRobocopy.Multithread%
  675. IF %1 EQU 1 (ECHO REM ROBOCOPY's paramenters.)>> "%~2"
  676. IF %1 EQU 1 (ECHO SET RoboCopyArg=%RoboCopyArg%)>> "%~2"
  677. IF %1 EQU 2 ECHO RoboCopyArg -^> %RoboCopyArg%
  678. REM ----
  679. REM IntCMD Copy Argument Set Compiled
  680. IF %1 EQU 0 SET CopyIntCMDArg=/V /Y /Z
  681. IF %1 EQU 1 (ECHO REM Batch Internal Command - Copy's parameters [compiled].)>> "%~2"
  682. IF %1 EQU 1 (ECHO SET CopyIntCMDArg=%CopyIntCMDArg%)>> "%~2"
  683. IF %1 EQU 2 ECHO CopyIntCMDArg -^> %CopyIntCMDArg%
  684. REM ----
  685. REM IntCMD Copy Switch: Decrypt
  686. IF %1 EQU 0 SET ParametersCopy.Decrypt=False
  687. IF %1 EQU 1 (ECHO REM Batch Internal Command Copy; Switch: Decrypt)>> "%~2"
  688. IF %1 EQU 1 (ECHO SET ParametersCopy.Decrypt=%ParametersCopy.Decrypt%)>> "%~2"
  689. IF %1 EQU 2 ECHO ParametersCopy.Decrypt -^> %ParametersCopy.Decrypt%
  690. REM ----
  691. REM IntCMD Copy Switch: Verify
  692. IF %1 EQU 0 SET ParametersCopy.Verify=True
  693. IF %1 EQU 1 (ECHO REM Batch Internal Command Copy; Switch: Verify)>> "%~2"
  694. IF %1 EQU 1 (ECHO SET ParametersCopy.Verify=%ParametersCopy.Verify%)>> "%~2"
  695. IF %1 EQU 2 ECHO ParametersCopy.Verify -^> %ParametersCopy.Verify%
  696. REM ----
  697. REM IntCMD Copy Switch: Suppress Overwrite Prompts
  698. IF %1 EQU 0 SET ParametersCopy.Suppress=True
  699. IF %1 EQU 1 (ECHO REM Batch Internal Command Copy; Switch: Suppress)>> "%~2"
  700. IF %1 EQU 1 (ECHO SET ParametersCopy.Suppress=%ParametersCopy.Suppress%)>> "%~2"
  701. IF %1 EQU 2 ECHO ParametersCopy.Suppress -^> %ParametersCopy.Suppress%
  702. REM ----
  703. REM IntCMD Copy Switch: Network Restart Mode
  704. IF %1 EQU 0 SET ParametersCopy.Restart=True
  705. IF %1 EQU 1 (ECHO REM Batch Internal Command Copy; Switch: Network Restart Mode)>> "%~2"
  706. IF %1 EQU 1 (ECHO SET ParametersCopy.Restart=%ParametersCopy.Restart%)>> "%~2"
  707. IF %1 EQU 2 ECHO ParametersCopy.Restart -^> %ParametersCopy.Restart%
  708. REM ----
  709. REM Default Copying duplicating software parameter set.
  710. IF %1 EQU 0 SET CopyArg=%XCopyArg%
  711. IF %1 EQU 1 (ECHO REM Default parameters that should be used when calling the default copying software.)>> "%~2"
  712. IF %1 EQU 1 (ECHO SET CopyArg=%CopyArg%)>> "%~2"
  713. IF %1 EQU 2 ECHO CopyArg -^> %CopyArg%
  714. REM ----
  715. REM Default arguments to be used with MSBuild
  716. IF %1 EQU 0 SET "MSVSArg=/t:Rebuild /p:Configuration=Release;Platform=x86 /v:quiet"
  717. IF %1 EQU 1 (ECHO REM Parameters to be used when using MSBuild from Microsoft Visual Studio packages.)>> "%~2"
  718. IF %1 EQU 1 (ECHO SET "MSVSArg=%MSVSArg%")>> "%~2"
  719. IF %1 EQU 2 ECHO MSVSArg -^> %MSVSArg%
  720. REM ----
  721. REM Default arguments to be used with VCUpgrade
  722. IF %1 EQU 0 SET "MSVSArgVPO=/p:Configuration=Release;Platform=Win32 /v:quiet"
  723. IF %1 EQU 1 (ECHO REM Parameters to be used when using VCUpgrade from Microsoft Visual Studio packages.)>> "%~2"
  724. IF %1 EQU 1 (ECHO SET "MSVSArgVPO=%MSVSArgVPO%")>> "%~2"
  725. IF %1 EQU 2 ECHO MSVSArgVPO -^> %MSVSArgVPO%
  726. REM ----
  727. REM Module logging
  728. IF %1 EQU 0 SET ToggleLog=False
  729. IF %1 EQU 1 (ECHO REM When true, this will allow modules to log their activity or progress to a logfile.)>> "%~2"
  730. IF %1 EQU 1 (ECHO SET ToggleLog=%ToggleLog%)>> "%~2"
  731. IF %1 EQU 2 ECHO ToggleLog -^> %ToggleLog%
  732. REM ----
  733. REM Logfile Name [NUL == NULL]
  734. IF %1 EQU 0 SET STDOUT=NUL
  735. IF %1 EQU 1 (ECHO REM Logfile name)>> "%~2"
  736. IF %1 EQU 1 (ECHO SET STDOUT=%STDOUT%)>> "%~2"
  737. IF %1 EQU 2 ECHO STDOUT -^> %STDOUT%
  738. REM ----
  739. REM Terminal Alarm [BELL]
  740. REM {0=Disable|1=One beep compile & Two beeps for errors|2=Two beeps for errors only}
  741. IF %1 EQU 0 SET UseBell=1
  742. IF %1 EQU 1 (ECHO REM Terminal Alarm or Bell.)>> "%~2"
  743. IF %1 EQU 1 (ECHO SET UseBell=%UseBell%)>> "%~2"
  744. IF %1 EQU 2 ECHO UseBell -^> %UseBell%
  745. REM ----
  746. REM Microsoft's 'Help' compiling tool.
  747. IF %1 EQU 0 CALL :EnvironmentSetup_FindDefault_HTMLWorkshop
  748. IF %1 EQU 1 (ECHO REM Directory path to Microsoft's HTML Workshop software.  Do NOT include the extension, the software itself dislikes that....)>> "%~2"
  749. IF %1 EQU 1 (ECHO SET "PathMSHTMLWorkShop=%PathMSHTMLWorkShop%")>> "%~2"
  750. IF %1 EQU 2 ECHO PathMSHTMLWorkShop -^> %PathMSHTMLWorkShop%
  751. IF "%~1" EQU "HTML Workshop" CALL :EnvironmentSetup_FindDefault_HTMLWorkshop
  752. REM ----
  753. REM General Kernel request Priority.
  754. IF %1 EQU 0 SET PriorityGeneral=Normal
  755. IF %1 EQU 1 (ECHO REM General priority for operations.  When the priority is higher, the system may become unstable or will have performance issues)>> "%~2"
  756. IF %1 EQU 1 (ECHO SET PriorityGeneral=%PriorityGeneral%)>> "%~2"
  757. IF %1 EQU 2 ECHO PriorityGeneral -^> %PriorityGeneral%
  758. REM ----
  759. REM Here, we are looking for 'common tools' that is included with Visual Studio 2005.
  760. IF %1 EQU 0 SET "PathMSVS2005=%VS80COMNTOOLS%"
  761. IF %1 EQU 1 (ECHO REM Directory path to: Microsoft Visual Studio 2005' VSVars32.bat)>> "%~2"
  762. IF %1 EQU 1 (ECHO SET "PathMSVS2005=%PathMSVS2005%")>> "%~2"
  763. IF %1 EQU 2 ECHO PathMSVS2005 -^> %PathMSVS2005%
  764. IF %1 EQU "Visual Studio 2005" SET "PathMSVS2005=%VS80COMNTOOLS%"
  765. REM ----
  766. REM Here, we are looking for 'common tools' that is included with Visual Studio 2008.
  767. IF %1 EQU 0 SET "PathMSVS2008=%VS90COMNTOOLS%"
  768. IF %1 EQU 1 (ECHO REM Directory path to: Microsoft Visual Studio 2008' VSVars32.bat)>> "%~2"
  769. IF %1 EQU 1 (ECHO SET "PathMSVS2008=%PathMSVS2008%")>> "%~2"
  770. IF %1 EQU 2 ECHO PathMSVS2008 -^> %PathMSVS2008%
  771. IF %1 EQU "Visual Studio 2008" SET "PathMSVS2008=%VS90COMNTOOLS%"
  772. REM ----
  773. REM Here, we are looking for 'common tools' that is included with Visual Studio 2010.
  774. IF %1 EQU 0 SET "PathMSVS2010=%VS100COMNTOOLS%"
  775. IF %1 EQU 1 (ECHO REM Directory path to: Microsoft Visual Studio 2010' VSVars32.bat)>> "%~2"
  776. IF %1 EQU 1 (ECHO SET "PathMSVS2010=%PathMSVS2010%")>> "%~2"
  777. IF %1 EQU 2 ECHO PathMSVS2010 -^> %PathMSVS2010%
  778. IF %1 EQU "Visual Studio 2010" SET "PathMSVS2010=%VS100COMNTOOLS%"
  779. REM ----
  780. REM Here, we are looking for 'common tools' that is included with Visual Studio 2012.
  781. IF %1 EQU 0 SET "PathMSVS2012=%VS110COMNTOOLS%"
  782. IF %1 EQU 1 (ECHO REM Directory path to: Microsoft Visual Studio 2012' VSVars32.bat)>> "%~2"
  783. IF %1 EQU 1 (ECHO SET "PathMSVS2012=%PathMSVS2012%")>> "%~2"
  784. IF %1 EQU 2 ECHO PathMSVS2012 -^> %PathMSVS2012%
  785. IF %1 EQU "Visual Studio 2012" SET "PathMSVS2012=%VS110COMNTOOLS%"
  786. REM ----
  787. REM Here, we are looking for 'common tools' that is included with Visual Studio 2013.
  788. IF %1 EQU 0 SET "PathMSVS2013=%VS120COMNTOOLS%"
  789. IF %1 EQU 1 (ECHO REM Directory path to: Microsoft Visual Studio 2013' VSVars32.bat)>> "%~2"
  790. IF %1 EQU 1 (ECHO SET "PathMSVS2013=%PathMSVS2013%")>> "%~2"
  791. IF %1 EQU 2 ECHO PathMSVS2013 -^> %PathMSVS2013%
  792. IF %1 EQU "Visual Studio 2013" SET "PathMSVS2013=%VS120COMNTOOLS%"
  793. REM ----
  794. REM MinGW path, for those that prefer or need MinGW support.
  795. IF %1 EQU 0 SET "PathMinGW=.\MinGW\"
  796. IF %1 EQU 1 (ECHO REM Directory path for MinGW)>> "%~2"
  797. IF %1 EQU 1 (ECHO SET "PathMinGW=%PathMinGW%")>> "%~2"
  798. IF %1 EQU 2 ECHO PathMinGW -^> %PathMinGW%
  799. IF %1 EQU "MinGW" SET "PathMinGW=.\MinGW\"
  800. REM ----
  801. REM Inno Setup
  802. IF %1 EQU 0 CALL :EnvironmentSetup_FindDefault_InnoSetup
  803. IF %1 EQU 1 (ECHO REM Directory path to Inno Setup Builder)>> "%~2"
  804. IF %1 EQU 1 (ECHO SET "PathInnoSetup=%PathInnoSetup%")>> "%~2"
  805. IF %1 EQU 2 ECHO PathInnoSetup -^> %PathInnoSetup%
  806. IF %1 EQU "Inno Installer" CALL :EnvironmentSetup_FindDefault_InnoSetup
  807. REM ----
  808. REM Python v3
  809. IF %1 EQU 0 CALL :EnvironmentSetup_FindDefault_Python3
  810. IF %1 EQU 1 (ECHO REM Directory path to Python v3)>> "%~2"
  811. IF %1 EQU 1 (ECHO SET "PathPython3=%PathPython3%")>> "%~2"
  812. IF %1 EQU 2 ECHO PathPython3 -^> %PathPython3%
  813. IF %1 EQU "Python3" CALL :EnvironmentSetup_FindDefault_Python3
  814. REM ----
  815. REM Python v2.7
  816. IF %1 EQU 0 CALL :EnvironmentSetup_FindDefault_Python2
  817. IF %1 EQU 1 (ECHO REM Directory path to Python v2.7)>> "%~2"
  818. IF %1 EQU 1 (ECHO SET "PathPython2=%PathPython2%")>> "%~2"
  819. IF %1 EQU 2 ECHO PathPython2 -^> %PathPython2%
  820. IF %1 EQU "Python2" CALL :EnvironmentSetup_FindDefault_Python2
  821. REM ----
  822. REM 7Zip
  823. IF %1 EQU 0 CALL :EnvironmentSetup_FindDefault_7Zip
  824. IF %1 EQU 1 (ECHO REM Directory path to 7zip)>> "%~2"
  825. IF %1 EQU 1 (ECHO SET "Path7Zip=%Path7Zip%")>> "%~2"
  826. IF %1 EQU 2 ECHO Path7Zip -^> %Path7Zip%
  827. IF %1 EQU "Seven Zip" CALL :EnvironmentSetup_FindDefault_7Zip
  828. REM ----
  829. REM 7Zip Archive Password
  830. IF %1 EQU 0 SET SevZipKey=
  831. IF %1 EQU 1 (ECHO REM 7Zip: Archive password to use with 7zip. [NOT ENCRYPTED])>> "%~2"
  832. IF %1 EQU 1 (ECHO SET SevZipKey=%SevZipKey%)>> "%~2"
  833. IF %1 EQU 2 ECHO SevZipKey -^> %SevZipKey%
  834. REM ----
  835. REM 7Zip Archive Password Toggle
  836. IF %1 EQU 0 SET SevZipUseKey=False
  837. IF %1 EQU 1 (ECHO REM 7Zip: When true, this will allow 7Zip [if called] to enable the use of encrypting the archive file with a password.)>> "%~2"
  838. IF %1 EQU 1 (ECHO SET SevZipUseKey=%SevZipUseKey%)>> "%~2"
  839. IF %1 EQU 2 ECHO SevZipUseKey -^> %SevZipUseKey%
  840. REM ----
  841. REM 7Zip Archive Format
  842. IF %1 EQU 0 SET SevZipArchiveFormat=7z
  843. IF %1 EQU 1 (ECHO REM 7Zip: Archive format)>> "%~2"
  844. IF %1 EQU 1 (ECHO SET SevZipArchiveFormat=%SevZipArchiveFormat%)>> "%~2"
  845. IF %1 EQU 2 ECHO SevZipArchiveFormat -^> %SevZipArchiveFormat%
  846. REM ----
  847. REM 7Zip file extension
  848. IF %1 EQU 0 SET SevZipFileExtension=7z
  849. IF %1 EQU 1 (ECHO REM 7Zip: Archive filename extension)>> "%~2"
  850. IF %1 EQU 1 (ECHO SET SevZipFileExtension=%SevZipFileExtension%)>> "%~2"
  851. IF %1 EQU 2 ECHO SevZipFileExtension -^> %SevZipFileExtension%
  852. REM ----
  853. REM 7Zip Compression
  854. IF %1 EQU 0 SET SevZipCompressionPass=5
  855. IF %1 EQU 1 (ECHO REM 7Zip: Compression rate to be used when compacting the data.  Higher the compression rate, the slower it builds.)>> "%~2"
  856. IF %1 EQU 1 (ECHO SET SevZipCompressionPass=%SevZipCompressionPass%) >> "%~2"
  857. IF %1 EQU 2 ECHO SevZipCompressionPass -^> %SevZipCompressionPass%
  858. REM ----
  859. REM 7Zip Copy algorithm
  860. IF %1 EQU 0 SET SevZipCopyFormat=Deflate
  861. IF %1 EQU 1 (ECHO REM 7Zip: Copy Format)>> "%~2"
  862. IF %1 EQU 1 (ECHO SET SevZipCopyFormat=%SevZipCopyFormat%)>> "%~2"
  863. IF %1 EQU 2 ECHO SevZipCopyFormat -^> %SevZipCopyFormat%
  864. REM ----
  865. REM 7Zip CPU Multithreading
  866. IF %1 EQU 0 CALL :EnvironmentSetup_CheckCPULogicalProcessors
  867. IF %1 EQU 1 (ECHO REM 7Zip: When on, this will allow the 7Zip program to use more than one thread from the CPU, which will allow the program to finish expeditiously.  DO NOT enable this if the CPU one has one core and one thread!)>> "%~2"
  868. IF %1 EQU 1 (ECHO SET SevZipMultiThreadingCPU=%SevZipMultiThreadingCPU%)>> "%~2"
  869. IF %1 EQU 2 ECHO SevZipMultiThreadingCPU -^> %SevZipMultiThreadingCPU%
  870. REM ----
  871. REM 7Zip Encryption
  872. IF %1 EQU 0 SET SevZipEncryptionAlgorithm=ZipCrypto
  873. IF %1 EQU 1 (ECHO REM 7Zip: When password protecting the archive file, these algorithms will strengthen the encryption of the file.)>> "%~2"
  874. IF %1 EQU 1 (ECHO SET SevZipEncryptionAlgorithm=%SevZipEncryptionAlgorithm%)>> "%~2"
  875. IF %1 EQU 2 ECHO SevZipEncryptionAlgorithm -^> %SevZipEncryptionAlgorithm%
  876. REM ----
  877. REM 7Zip Testing
  878. IF %1 EQU 0 SET SevZipVerify=True
  879. IF %1 EQU 1 (ECHO REM 7Zip: When true, this will allow modules to verify the archive file contents to assure that everything was generated accurately.)>> "%~2"
  880. IF %1 EQU 1 (ECHO SET SevZipVerify=%SevZipVerify%)>> "%~2"
  881. IF %1 EQU 2 ECHO SevZipVerify -^> %SevZipVerify%
  882. REM ----
  883. REM Modules Execute in a shared window with the core.
  884. IF %1 EQU 0 SET ModuleExecuteSharingWindow=True
  885. IF %1 EQU 1 (ECHO REM When false, this will allow modules to be executed in their own window environment -- this allows multitasking.)>> "%~2"
  886. IF %1 EQU 1 (ECHO SET ModuleExecuteSharingWindow=%ModuleExecuteSharingWindow%)>> "%~2"
  887. IF %1 EQU 2 ECHO ModuleExecuteSharingWindow -^> %ModuleExecuteSharingWindow%
  888. REM ----
  889. REM Finished
  890. GOTO :EOF
  891.  
  892.  
  893.  
  894. REM # =============================================================================================
  895. REM # Documentation: Within this function, this will check wither the targets can be found within the filesystem.  If the target can not be found, simply change the target status to false.
  896. REM # =============================================================================================
  897. :EnvironmentSetup_DirectoryCheck
  898. REM Visual Studio 2005
  899. IF EXIST "%PathMSVS2005%" (
  900.     SET Detect_MSVS80COMMTOOLS=True
  901.     IF %Detect_MicrosoftVisualStudio% EQU False SET Detect_MicrosoftVisualStudio=True
  902. ) ELSE (
  903.     SET Detect_MSVS80COMMTOOLS=False
  904. )
  905.  
  906. REM Visual Studio 2008
  907. IF EXIST "%PathMSVS2008%" (
  908.     SET Detect_MSVS90COMMTOOLS=True
  909.     IF %Detect_MicrosoftVisualStudio% EQU False SET Detect_MicrosoftVisualStudio=True
  910. ) ELSE (
  911.     SET Detect_MSVS90COMMTOOLS=False
  912. )
  913.  
  914. REM Visual Studio 2010
  915. IF EXIST "%PathMSVS2010%" (
  916.     SET Detect_MSVS100COMMTOOLS=True
  917.     IF %Detect_MicrosoftVisualStudio% EQU False SET Detect_MicrosoftVisualStudio=True
  918. ) ELSE (
  919.     SET Detect_MSVS100COMMTOOLS=False
  920. )
  921.  
  922. REM Visual Studio 2012
  923. IF EXIST "%PathMSVS2012%" (
  924.     SET Detect_MSVS110COMMTOOLS=True
  925.     IF %Detect_MicrosoftVisualStudio% EQU False SET Detect_MicrosoftVisualStudio=True
  926. ) ELSE (
  927.     SET Detect_MSVS110COMMTOOLS=False
  928. )
  929.  
  930. REM Visual Studio 2013
  931. IF EXIST "%PathMSVS2013%" (
  932.     SET Detect_MSVS120COMMTOOLS=True
  933.     IF %Detect_MicrosoftVisualStudio% EQU False SET Detect_MicrosoftVisualStudio=True
  934. ) ELSE (
  935.     SET Detect_MSVS120COMMTOOLS=False
  936. )
  937.  
  938. REM Microsoft HTML Workshop
  939. IF EXIST "%PathMSHTMLWorkShop%.exe" (
  940.     SET Detect_MSHTMLWorkShop=True
  941. ) ELSE (
  942.     SET Detect_MSHTMLWorkShop=False
  943. )
  944.  
  945. REM MinGW
  946. IF EXIST "%PathMinGW%" (
  947.     SET Detect_MinGW=True
  948. ) ELSE (
  949.     SET Detect_MinGW=False
  950. )
  951.  
  952. REM Inno Setup
  953. IF EXIST "%PathInnoSetup%" (
  954.     SET Detect_InnoSetup=True
  955. ) ELSE (
  956.     SET Detect_InnoSetup=False
  957. )
  958.  
  959. REM 7Zip
  960. IF EXIST "%Path7Zip%" (
  961.     SET Detect_7Zip=True
  962. ) ELSE (
  963.     SET Detect_7Zip=False
  964. )
  965.  
  966. REM This is treated differently as it could be invoked while in %PATH%
  967. REM Python v3
  968. IF %Detect_Python3% EQU False (
  969.     IF EXIST "%PathPython3%" SET Detect_Python3=True
  970. )
  971.  
  972. REM Python v2
  973. IF EXIST "%PathPython2%" (
  974.     SET Detect_Python2=True
  975. ) ELSE (
  976.     SET Detect_Python2=False
  977. )
  978.  
  979. REM SVN
  980. REM Besides checking the filesystem, just do an invoke check.
  981. SVN 2> NUL 1> NUL
  982. IF %ERRORLEVEL% EQU 1 (
  983.     SET Detect_SVN=True
  984. ) ELSE (
  985.     SET Detect_SVN=False
  986. )
  987.  
  988. REM Robocopy
  989. REM Besides checking the filesystem, just do an invoke check.
  990. REM   Robocopy was never officially added into Windows until Windows Vista and later.
  991. REM   To avoid conflicts with Windows XP and Windows 2000 users, run a check.
  992. ROBOCOPY 2> NUL 1> NUL
  993. IF %ERRORLEVEL% EQU 16 (
  994.     SET Detect_Robocopy=True
  995. ) ELSE (
  996.     SET Detect_Robocopy=False
  997. )
  998. REM Finished
  999. REM ----
  1000. GOTO :EOF
  1001.  
  1002.  
  1003.  
  1004. REM # =============================================================================================
  1005. REM # Documentation: Try to automatically detect the HTML Workshop software.
  1006. REM # =============================================================================================
  1007. :EnvironmentSetup_FindDefault_HTMLWorkshop
  1008. IF EXIST "%ProgramFiles%\HTML Help Workshop\hhc.exe" (
  1009.     SET "PathMSHTMLWorkShop=%ProgramFiles%\HTML Help Workshop\hhc"
  1010. ) ELSE (
  1011.     SET "PathMSHTMLWorkShop=%ProgramFiles(x86)%\HTML Help Workshop\hhc"
  1012. )
  1013. GOTO :EOF
  1014.  
  1015.  
  1016.  
  1017. REM # =============================================================================================
  1018. REM # Documentation: Try to automatically detect the 7Zip software.
  1019. REM # =============================================================================================
  1020. :EnvironmentSetup_FindDefault_7Zip
  1021. IF EXIST "%ProgramFiles%\7-Zip\7z.exe" (
  1022.     SET "Path7Zip=%ProgramFiles%\7-Zip\7z.exe"
  1023. ) ELSE (
  1024.     SET "Path7Zip=%ProgramFiles(x86)%\7-Zip\7z.exe"
  1025. )
  1026. GOTO :EOF
  1027.  
  1028.  
  1029.  
  1030. REM # =============================================================================================
  1031. REM # Documentation: Try to automatically detect the Inno Setup software.
  1032. REM # =============================================================================================
  1033. :EnvironmentSetup_FindDefault_InnoSetup
  1034. IF EXIST %programfiles%\Inno Setup 5\iscc.exe (
  1035.     SET "PathInnoSetup=%programfiles%\Inno Setup 5\iscc.exe"
  1036. ) ELSE (
  1037.     SET "PathInnoSetup=%programfiles(x86)%\Inno Setup 5\iscc.exe"
  1038. )
  1039. GOTO :EOF
  1040.  
  1041.  
  1042.  
  1043. REM # =============================================================================================
  1044. REM # Documentation: Try to automatically detect Python version 3.x
  1045. REM # =============================================================================================
  1046. :EnvironmentSetup_FindDefault_Python3
  1047. REM If incase the user allowed Python (or did it themselves) to be included in $PATH.
  1048. py --help 2> NUL 1> NUL
  1049. IF %ERRORLEVEL% EQU 0 (
  1050.     SET PathPython3=py
  1051.     SET Detect_Python3=True
  1052. ) ELSE (
  1053.     SET "PathPython3=%SYSTEMDRIVE%\Python33\python.exe"
  1054. )
  1055. GOTO :EOF
  1056.  
  1057.  
  1058.  
  1059. REM # =============================================================================================
  1060. REM # Documentation: Try to automatically detect Python version 2.7.x
  1061. REM # =============================================================================================
  1062. :EnvironmentSetup_FindDefault_Python2
  1063. IF EXIST "%SYSTEMDRIVE%\Python27\python.exe" (
  1064.     SET Detect_Python2=True
  1065. )
  1066. SET "PathPython2=%SYSTEMDRIVE%\Python27\python.exe"
  1067. GOTO :EOF
  1068.  
  1069.  
  1070.  
  1071. REM # =============================================================================================
  1072. REM # Documentation: Try to automatically detect all of the .NET framework foundation software.
  1073. REM # =============================================================================================
  1074. :EnvironmentSetup_Find_dotNETFoundations
  1075. REM Check to see if the user has the specified .NET foundations installed within the system
  1076. REM ----
  1077. REM .NET Framework v1
  1078. IF EXIST "%WINDIR%\Microsoft.NET\Framework\v1.0.3705" SET Detect_dotNET1=True
  1079. REM ----
  1080. REM .NET Framework v1.1
  1081. IF EXIST "%WINDIR%\Microsoft.NET\Framework\v1.1.4322" SET Detect_dotNET1.1=True
  1082. REM ----
  1083. REM .NET Framework v2
  1084. IF EXIST "%WINDIR%\Microsoft.NET\Framework\v2.0.50727" SET Detect_dotNET2=True
  1085. IF EXIST "%WINDIR%\Microsoft.NET\Framework64\v2.0.50727" SET Detect_dotNET2-64=True
  1086. REM ----
  1087. REM .NET Framework v3
  1088. IF EXIST "%WINDIR%\Microsoft.NET\Framework\v3.0" SET Detect_dotNET3=True
  1089. IF EXIST "%WINDIR%\Microsoft.NET\Framework64\v3.0" SET Detect_dotNET3-64=True
  1090. REM ----
  1091. REM .NET Framework v3.5
  1092. IF EXIST "%WINDIR%\Microsoft.NET\Framework\v3.5" SET Detect_dotNET3.5=True
  1093. IF EXIST "%WINDIR%\Microsoft.NET\Framework64\v3.5" SET Detect_dotNET3.5-64=True
  1094. REM ----
  1095. REM .NET Framework v4
  1096. IF EXIST "%WINDIR%\Microsoft.NET\Framework\v4.0.30319" SET Detect_dotNET4=True
  1097. IF EXIST "%WINDIR%\Microsoft.NET\Framework64\v4.0.30319" SET Detect_dotNET4-64=True
  1098. GOTO :EOF
  1099.  
  1100.  
  1101.  
  1102. REM # =============================================================================================
  1103. REM # Documentation: Determine wither or not the program is executed with administrative access
  1104. REM # =============================================================================================
  1105. :EnvironmentSetup_CheckEnvironmentPrivileges
  1106. REM This merely checks if the program has enough privileges to access a certain directory.
  1107. "%SYSTEMROOT%\System32\icacls.exe" "%SYSTEMROOT%\System32\Config\System" > NUL 2>&1
  1108. IF %ERRORLEVEL% NEQ 0 (
  1109.    REM Executed without Root access
  1110.     SET Detect_RootAccess=False
  1111. ) ELSE (
  1112.    REM Executed with Root access
  1113.     SET Detect_RootAccess=True
  1114. )
  1115. GOTO :EOF
  1116.  
  1117.  
  1118.  
  1119. REM # =============================================================================================
  1120. REM # Documentation: Filter the date and time and store their filtered value into variables.  This will allow other programs to use date and time as filenames.
  1121. REM # =============================================================================================
  1122. :EnvironmentSetup_Setup_Time-and-Date
  1123. REM These are special statements that are used to clean up the date string so that information can be used within the filesystem as a file or directory.
  1124. REM Date
  1125. FOR /F "tokens=1-3 delims=/." %%a IN ("%DATE%") DO SET "core.Date=%%a_%%b_%%c"
  1126. REM Time
  1127. FOR /F "tokens=1-3 delims=:." %%a IN ("%TIME%") DO SET "core.Time=%%a-%%b-%%c"
  1128. GOTO :EOF
  1129.  
  1130.  
  1131.  
  1132. REM # =============================================================================================
  1133. REM # Documentation: This function clears out sensitive identifiers from the program.  As Batch does not clear out the identifiers after the program has been terminated, this function will house variables that need to be cleared out before the session ends.
  1134. REM # =============================================================================================
  1135. :EnvironmentSetup_UninitializeVars
  1136. REM 7Zip key
  1137. SET SevZipKey=
  1138. GOTO :EOF
  1139.  
  1140.  
  1141.  
  1142. REM # =============================================================================================
  1143. REM # Documentation: This function will check to see how many logical cores the host system has available.  This function is dedicated for 7Zip program, Multithreading functionality.  If the host system does NOT have any multithreading capabilities available, this program will disable the multithreading functionality when 7Zip is being called.
  1144. REM # =============================================================================================
  1145. :EnvironmentSetup_CheckCPULogicalProcessors
  1146. IF %Number_Of_Processors% EQU 0 (
  1147.     SET SevZipMultiThreadingCPU=off
  1148. ) ELSE (
  1149.     SET SevZipMultiThreadingCPU=on
  1150. )
  1151. GOTO :EOF
  1152.  
  1153.  
  1154.  
  1155.  
  1156. REM =====================================================================
  1157. REM Main Menu
  1158. REM ----------------------------
  1159. REM The main menu and the main navigation central point of the program.
  1160. REM =====================================================================
  1161.  
  1162.  
  1163. REM # =============================================================================================
  1164. REM # Documentation: Display the main menu screen.
  1165. REM # =============================================================================================
  1166. :MainScreen
  1167. CALL :DashboardDisplay
  1168. ECHO Main Menu
  1169. ECHO.
  1170. ECHO Select the following options:
  1171. ECHO %Separator%
  1172. ECHO [1] Run Project Modules
  1173. ECHO [2] Run External Scripts
  1174. ECHO [3] User Configuration
  1175. ECHO [4] Documentation
  1176. ECHO.
  1177. ECHO Other Options
  1178. ECHO %SeparatorSmall%
  1179. ECHO [S] Settings
  1180. ECHO [U] Check for Updates
  1181. ECHO [R] Restart Program
  1182. ECHO [X] Exit
  1183. REM Allow the user to input their request into the program.
  1184. CALL :UserInput
  1185. REM Inspect their input.
  1186. GOTO :MainScreen_UserInput
  1187.  
  1188.  
  1189.  
  1190. REM # =============================================================================================
  1191. REM # Documentation: Inspect the user's input.
  1192. REM # =============================================================================================
  1193. :MainScreen_UserInput
  1194. REM Read the STDIN and process it
  1195. IF "%STDIN%" EQU "1" GOTO :MainScreen_ChoiceRunProjectModule
  1196. IF "%STDIN%" EQU "2" GOTO :MainScreen_ChoiceRunExternalScript
  1197. IF "%STDIN%" EQU "3" GOTO :MainScreen_ChoiceUserConfiguration
  1198. IF "%STDIN%" EQU "4" GOTO :MainScreen_ChoiceDocumentation
  1199. IF /I "%STDIN%" EQU "S" GOTO :MainScreen_ChoiceSettings
  1200. IF /I "%STDIN%" EQU "U" GOTO :MainScreen_ChoiceUpdates
  1201. IF /I "%STDIN%" EQU "R" GOTO :MainScreen_ChoiceRestartProgram
  1202. IF /I "%STDIN%" EQU "Restart" GOTO :MainScreen_ChoiceRestartProgram
  1203. IF /I "%STDIN%" EQU "X" GOTO :MainScreen_ChoiceExit
  1204. IF /I "%STDIN%" EQU "Exit" GOTO :MainScreen_ChoiceExit
  1205. IF /I "%STDIN%" EQU "Quit" GOTO :MainScreen_ChoiceExit
  1206. CALL :BadInput& GOTO :MainScreen
  1207.  
  1208.  
  1209.  
  1210. REM # =============================================================================================
  1211. REM # Documentation: This function calls a feature that allows the user to launch scripts that is compatible with the core's environment.
  1212. REM # =============================================================================================
  1213. :MainScreen_ChoiceRunProjectModule
  1214. REM Compile projects
  1215. CALL :ClearBuffer 1
  1216. CALL :ProjectLoader
  1217. CALL :ClearBuffer 1
  1218. GOTO :MainScreen
  1219.  
  1220.  
  1221.  
  1222. REM # =============================================================================================
  1223. REM # Documentation: This function calls the external module and script feature -- these are not core compatible scripts.
  1224. REM # =============================================================================================
  1225. :MainScreen_ChoiceRunExternalScript
  1226. CALL :ClearBuffer 1
  1227. CALL :LoadExtScripts
  1228. CALL :ClearBuffer 1
  1229. GOTO :MainScreen
  1230.  
  1231.  
  1232.  
  1233. REM # =============================================================================================
  1234. REM # Documentation: Allow the user to manage their own personal saved preset configuration files.
  1235. REM # =============================================================================================
  1236. :MainScreen_ChoiceUserConfiguration
  1237. CALL :ClearBuffer 1
  1238. CALL :UserConfiguration
  1239. CALL :ClearBuffer 1
  1240. GOTO :MainScreen
  1241.  
  1242.  
  1243.  
  1244. REM # =============================================================================================
  1245. REM # Documentation: Call the Document Viewer tool.
  1246. REM # =============================================================================================
  1247. :MainScreen_ChoiceDocumentation
  1248. CALL :ClearBuffer 1
  1249. CALL :Documents
  1250. CALL :ClearBuffer 1
  1251. GOTO :MainScreen
  1252.  
  1253.  
  1254.  
  1255. REM # =============================================================================================
  1256. REM # Documentation: Allow the user to make adjustments within the program.
  1257. REM # =============================================================================================
  1258. :MainScreen_ChoiceSettings
  1259. CALL :ClearBuffer 1
  1260. CALL :ControlPanel
  1261. CALL :ClearBuffer 1
  1262. GOTO :MainScreen
  1263.  
  1264.  
  1265.  
  1266. REM # =============================================================================================
  1267. REM # Documentation: Allows the user to check for program updates; requires an internet connection!
  1268. REM # =============================================================================================
  1269. :MainScreen_ChoiceUpdates
  1270. CALL :ClearBuffer 1
  1271. CALL :Updates
  1272. CALL :ClearBuffer 1
  1273. GOTO :MainScreen
  1274.  
  1275.  
  1276.  
  1277. REM # =============================================================================================
  1278. REM # Documentation: Restart the program or specifically - refresh the environment variables.
  1279. REM # =============================================================================================
  1280. :MainScreen_ChoiceRestartProgram
  1281. CALL :ClearBuffer 1
  1282. CALL :EnvironmentSetup_Switch Restart
  1283. CALL :ClearBuffer 1
  1284. GOTO :MainScreen
  1285.  
  1286.  
  1287.  
  1288. REM # =============================================================================================
  1289. REM # Documentation: Terminate the program.
  1290. REM # =============================================================================================
  1291. :MainScreen_ChoiceExit
  1292. CALL :ClearBuffer 1
  1293. CALL :KillPrompt
  1294. CALL :ClearBuffer 1
  1295. GOTO :MainScreen
  1296.  
  1297.  
  1298.  
  1299.  
  1300. REM =====================================================================
  1301. REM Document Viewer
  1302. REM ----------------------------
  1303. REM Document Viewer allows the user to open simple text files that is located in the documents directory [ "%DirDocuments%" variable ] and display the contents right in the terminal.
  1304. REM This feature by itself is limited and most likely is least used, but it is here for those that may need it.
  1305. REM =====================================================================
  1306.  
  1307.  
  1308. REM # =============================================================================================
  1309. REM # Documentation: This function checks to make sure that the document directory exists.  If the directory does not exist, then simply create it in the filesystem.
  1310. REM # =============================================================================================
  1311. :DocumentsDirectoryInspect
  1312. IF NOT EXIST "%DirDocuments%" MKDIR "%DirDocuments%" || ECHO !ERR_CRIT!: Could not create directory [ %DirDocuments% ] within the local filesystem!
  1313. GOTO :EOF
  1314.  
  1315.  
  1316.  
  1317. REM # =============================================================================================
  1318. REM # Documentation: This function will scan the documents directory and output all of the contents that end with '.txt' as the _whole_ filename.
  1319. REM # =============================================================================================
  1320. :DocumentsDirectoryViewer
  1321. DIR /B "%DirDocuments%" | FINDSTR /E /I ".txt" || ECHO !ERR: Could not find the directory!&
  1322. GOTO :EOF
  1323.  
  1324.  
  1325.  
  1326. REM # =============================================================================================
  1327. REM # Parameters: [{String} ASCIIFile]
  1328. REM # Documentation: Display the text file that the user requested.
  1329. REM # =============================================================================================
  1330. :DocumentViewer_Reader
  1331. MORE /E "%~1"
  1332. GOTO :EOF
  1333.  
  1334.  
  1335.  
  1336. REM # =============================================================================================
  1337. REM # Documentation: This function displays the document viewer menu.  This will also do a preview of what files where found within the document directory.
  1338. REM # =============================================================================================
  1339. :Documents
  1340. CALL :DashboardDisplay
  1341. CALL :DocumentsDirectoryInspect
  1342. ECHO Documents Folder
  1343. ECHO.
  1344. ECHO Document Directory: %DirDocuments%
  1345. ECHO %SeparatorLong%
  1346. REM Display a preview of what files were found within the document directory.
  1347. CALL :DocumentsDirectoryViewer
  1348. ECHO %SeparatorLong%
  1349. ECHO.&ECHO.
  1350. ECHO Other Options:
  1351. ECHO %SeparatorSmall%
  1352. ECHO [R] Refresh the list
  1353. ECHO [X] Cancel
  1354. ECHO %Separator%
  1355. ECHO.
  1356. ECHO Enter a document filename:
  1357. CALL :UserInput
  1358. GOTO :Documents_UserInput
  1359.  
  1360.  
  1361.  
  1362. REM # =============================================================================================
  1363. REM # Documentation: Inspect the user's input and determine wither the document exists or if the user chooses another option.
  1364. REM # =============================================================================================
  1365. :Documents_UserInput
  1366. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  1367. IF /I "%STDIN%" EQU "X" GOTO :EOF
  1368. IF /I "%STDIN%" EQU "Exit" GOTO :EOF
  1369. IF /I "%STDIN%" EQU "R" (
  1370.     CALL :ClearBuffer 1
  1371.     GOTO :Documents
  1372. )
  1373. IF /I "%STDIN%" EQU "Refresh" (
  1374.     CALL :ClearBuffer 1
  1375.     GOTO :Documents
  1376. )
  1377.  
  1378. IF /I EXIST "%DirDocuments%\%STDIN%" CALL :DocumentViewer 0& GOTO :Documents
  1379. IF /I EXIST "%DirDocuments%\%STDIN%.txt" CALL :DocumentViewer 1& GOTO :Documents
  1380.  
  1381. ECHO Filename could not be found!
  1382. PAUSE
  1383. CALL :ClearBuffer 1
  1384. GOTO :Documents
  1385.  
  1386.  
  1387.  
  1388. REM # =============================================================================================
  1389. REM # Parameters: [{Int} IncludeFileExtension]
  1390. REM # Documentation: Prepare to display the ascii file.
  1391. REM # =============================================================================================
  1392. :DocumentViewer
  1393. IF %1 EQU 1 SET "STDIN=%STDIN%.txt"
  1394. CALL :ClearBuffer 0
  1395. CALL :DocumentViewer_Body "%STDIN%" "%DirDocuments%\%STDIN%"
  1396. CALL :ClearBuffer 1
  1397. GOTO :EOF
  1398.  
  1399.  
  1400.  
  1401. REM # =============================================================================================
  1402. REM # Parameters: [{String} FileName] [{String} FullPathFileName]
  1403. REM # Documentation: Display the Document Viewer outlook and call the function to display the actual text file within the terminal.
  1404. REM # =============================================================================================
  1405. :DocumentViewer_Body
  1406. ECHO Opening file named '%~1'...
  1407. ECHO.
  1408. ECHO %SeparatorLong%
  1409. ECHO.
  1410. CALL :DocumentViewer_Reader "%~2"
  1411. ECHO.
  1412. ECHO %SeparatorLong%
  1413. ECHO.
  1414. ECHO Reached end of file marker from '%~1'!
  1415. PAUSE > NUL
  1416. GOTO :EOF
  1417.  
  1418.  
  1419.  
  1420.  
  1421. REM =====================================================================
  1422. REM Check for Updates
  1423. REM ----------------------------
  1424. REM To make things for the end-user, this allows the user to quickly check for available updates with ease.  Despite there's limitations with Batch, we can not really automatically fetch information and append them.  However, instead, this will open Windows Explorer's functionality to open website pages.  This functionality alone will help the user to determine if there is new updates or if the program that they currently have is still the current latest version.
  1425. REM =====================================================================
  1426.  
  1427.  
  1428. REM # =============================================================================================
  1429. REM # Documentation: This function is a small driver for checking updates.
  1430. REM # =============================================================================================
  1431. :Updates
  1432. CALL :DashboardDisplay
  1433. CALL :Updates_InternalInformation
  1434. CALL :Updates_OpenWeb
  1435. PAUSE
  1436. GOTO :EOF
  1437.  
  1438.  
  1439.  
  1440. REM # =============================================================================================
  1441. REM # Documentation: This will display all of the information necessary to help the user determine if the program is up to date or is outdated.
  1442. REM # =============================================================================================
  1443. :Updates_InternalInformation
  1444. ECHO Current Module Information:
  1445. ECHO %Separator%
  1446. ECHO Core Name:
  1447. ECHO    %ProgramName% [%CodeName%]
  1448. ECHO Version:
  1449. ECHO    %ProgramVersion%
  1450. ECHO Released:
  1451. ECHO    %ProgramReleaseDate%
  1452. ECHO.&ECHO.
  1453. GOTO :EOF
  1454.  
  1455.  
  1456.  
  1457. REM # =============================================================================================
  1458. REM # Documentation: This function will call Windows Explorer - regardless of the CallExplorer variable from the core -, and go to an official website or forum that will contain information and resources of newer updates and recent changes.
  1459. REM # =============================================================================================
  1460. :Updates_OpenWeb
  1461. CALL :Call_WindowsExplorer "http://forum.drdteam.org/viewtopic.php?p=53914#p53914"
  1462. GOTO :EOF
  1463.  
  1464.  
  1465.  
  1466.  
  1467. REM =====================================================================
  1468. REM Project Loader
  1469. REM ----------------------------
  1470. REM This feature allows the core to be expandable and execute script modules to perform tedious tasks and to get various operations accomplished - such as compiling software or compiling a game project into a pk3 file.  As script modules are allowed to use Bootless Star's environment, this will allow the script modules to quickly use the end user's programs and settings without having to write the same information again.  For those that remember Bootless Star Beta 7 and before, it used to be hard coded to only compile specific software and nothing further -- Can not easily be expanded and required having to change the core's code.  But, however, now this has changed to allow more tasks to be done and less changes within the core.  The core essentially allows the modules to expand the programs capabilities.
  1471. REM Script module directory is managed by this variable [ %DirProjects% ]
  1472. REM Scripts that are executed from this environment are allowed to use the core's environment.
  1473. REM =====================================================================
  1474.  
  1475.  
  1476. REM # =============================================================================================
  1477. REM # Documentation: If the script modules directory does not exist, then attempt to create the directory.
  1478. REM # =============================================================================================
  1479. :ProjectLoaderInspect
  1480. IF NOT EXIST "%DirProjects%" MKDIR "%DirProjects%" || ECHO !ERR_CRIT!: Could not create directory [ %DirProjects% ] within the local filesystem!
  1481. GOTO :EOF
  1482.  
  1483.  
  1484.  
  1485. REM # =============================================================================================
  1486. REM # Documentation: Display what scripts can be found and can be used within the script module directory
  1487. REM # =============================================================================================
  1488. :ProjectLoaderDirectoryViewer
  1489. DIR /B %DirProjects% | FINDSTR /E /I ".bat" || ECHO !ERR: Could not find the directory or files!&
  1490. GOTO :EOF
  1491.  
  1492.  
  1493.  
  1494. REM # =============================================================================================
  1495. REM # Documentation: Script Module menu screen
  1496. REM # =============================================================================================
  1497. :ProjectLoader
  1498. CALL :DashboardDisplay
  1499. CALL :ProjectLoaderInspect
  1500. ECHO Run Project Module
  1501. ECHO.
  1502. ECHO Projects Directory: %DirProjects%
  1503. ECHO %SeparatorLong%
  1504. REM Display what contents exist within the script module directory
  1505. CALL :ProjectLoaderDirectoryViewer
  1506. ECHO %SeparatorLong%
  1507. ECHO.&ECHO.
  1508. ECHO Select the following options:
  1509. ECHO %Separator%
  1510. ECHO [I] Install a Project Module
  1511. ECHO [R] Refresh lists
  1512. ECHO [X] Return to Main Menu
  1513. CALL :ProjectLoader_ChoicePrep
  1514. GOTO :ProjectLoader_UserInput
  1515.  
  1516.  
  1517.  
  1518. REM # =============================================================================================
  1519. REM # Documentation: Inspect the users input
  1520. REM # =============================================================================================
  1521. :ProjectLoader_UserInput
  1522. IF /I "%STDIN%" EQU "R" (
  1523.     CALL :ClearBuffer 1
  1524.     GOTO :ProjectLoader
  1525. )
  1526. IF /I "%STDIN%" EQU "Refresh" (
  1527.     CALL :ClearBuffer 1
  1528.     GOTO :ProjectLoader
  1529. )
  1530. IF /I "%STDIN%" EQU "I" (
  1531.     CALL :ClearBuffer 1
  1532.     CALL :ProjectLoader_Install
  1533.     CALL :ClearBuffer 1
  1534.     GOTO :ProjectLoader
  1535. )
  1536. IF /I "%STDIN%" EQU "Install" (
  1537.     CALL :ClearBuffer 1
  1538.     CALL :ProjectLoader_Install
  1539.     CALL :ClearBuffer 1
  1540.     GOTO :ProjectLoader
  1541. )
  1542. IF /I "%STDIN%" EQU "X" GOTO :EOF
  1543. CALL :ProjectLoader_ExecuteProject
  1544. CALL :ClearBuffer 1
  1545. GOTO :ProjectLoader
  1546.  
  1547.  
  1548.  
  1549. REM # =============================================================================================
  1550. REM # Documentation: Install a compatible script.  To make things easier for the user, this will forcefully open a new window allowing the user to simply drag and drop a batch script into the directory.
  1551. REM # =============================================================================================
  1552. :ProjectLoader_Install
  1553. IF EXIST "%DirProjects%" (
  1554.     CALL :ProjectLoader_Install_Message
  1555.     CALL :ProjectLoader_Install_ExplorerDirectory
  1556. ) ELSE (
  1557.     CALL :ProjectLoader_Install_ErrorMessage
  1558. )
  1559. PAUSE
  1560. GOTO :EOF
  1561.  
  1562.  
  1563.  
  1564. :ProjectLoader_Install_Message
  1565. ECHO Instructions:
  1566. ECHO With the newly pop-up directory window, simply drag and drop the project module into that directory.
  1567. ECHO This program only accepts 'Batch' [.bat] program scripts!
  1568. ECHO.
  1569. ECHO.
  1570. ECHO Compatibility Notice:
  1571. ECHO Be sure that the project module is able to work with %ProgramName% version %ProgramReleaseDate% environment!  Outdated scripts may not function properly or will not be able to take advantage of newer improvements and additions that is offered in the later versions!
  1572. ECHO.
  1573. ECHO.
  1574. ECHO Safety Notice:
  1575. ECHO Please insure that the script file _is_safe_before_using_it_!  It is always possible for a script file remove the users data or perform various other malicious executions.  Thus, as a safety precaution, _always_check_user_reviews_and_inspect_the_code_before_blindly_using_them_!
  1576. ECHO Make sure that the script is designed for %ProgramName% [version: %ProgramReleaseDate%]!  When a project module is loaded in %ProgramName% environment, the script is not only sharing %ProgramName% environment settings but also the users settings!  Thus, as a result, any sensitive data that was stored from the user, will be accessible to the script!
  1577. ECHO.
  1578. GOTO :EOF
  1579.  
  1580.  
  1581.  
  1582. :ProjectLoader_Install_ExplorerDirectory
  1583. CALL :Call_WindowsExplorer "%DirProjects%"
  1584. GOTO :EOF
  1585.  
  1586.  
  1587.  
  1588. :ProjectLoader_Install_ErrorMessage
  1589. CALL :CantInstallScriptErrorMessage
  1590. GOTO :EOF
  1591.  
  1592.  
  1593.  
  1594. REM # =============================================================================================
  1595. REM # Documentation: Select a script module to execute within the environment.
  1596. REM # =============================================================================================
  1597. :ProjectLoader_ChoicePrep
  1598. ECHO.
  1599. ECHO %Separator%
  1600. ECHO.
  1601. ECHO Enter a filename:
  1602. CALL :UserInput
  1603. GOTO :EOF
  1604.  
  1605.  
  1606.  
  1607. REM # =============================================================================================
  1608. REM # Documentation: Pass the script module to the ExecuteScript function and cache the exitcode for processing later.  If incase the file was not found, nothing is executed.
  1609. REM # =============================================================================================
  1610. :ProjectLoader_ExecuteProject
  1611. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  1612. IF /I EXIST "%DirProjects%\%STDIN%" (
  1613.     CALL :ProjectLoader_ExecuteScript "%DirProjects%\%STDIN%"
  1614.     SET scriptExitCode=%ERRORLEVEL%
  1615.     CALL :ProjectLoader_Finished
  1616.     GOTO :EOF
  1617. )
  1618. IF /I EXIST "%DirProjects%\%STDIN%.bat" (
  1619.     CALL :ProjectLoader_ExecuteScript "%DirProjects%\%STDIN%.bat"
  1620.     SET scriptExitCode=%ERRORLEVEL%
  1621.     CALL :ProjectLoader_Finished
  1622.     GOTO :EOF
  1623. )
  1624. ECHO Filename could not be found!
  1625. PAUSE
  1626. CALL :ClearBuffer 1
  1627. GOTO :EOF
  1628.  
  1629.  
  1630.  
  1631. REM # =============================================================================================
  1632. REM # Parameters: [{String} FullPathFileName]
  1633. REM # Documentation: Execute the script file into a new process.
  1634. REM # =============================================================================================
  1635. :ProjectLoader_ExecuteScript
  1636. REM Update the title to include the script name that is going to be executed
  1637. CALL :UpdateCoreTitleExecutingScript "%~1"
  1638. REM Determine the parameters for START if the user enabled or disabled the Window Sharing
  1639. IF %ModuleExecuteSharingWindow% EQU False (
  1640.     SET ProcessVarB=
  1641. ) ELSE (
  1642.     SET "ProcessVarB=/B /WAIT"
  1643. )
  1644. REM The working variable 'ProcessVarA' is captured from the function :UpdateCoreTitleExecutingScript
  1645. START "Batch Fork: %ProcessVarA%" %ProcessVarB% CMD /Q /C CALL "%~1"
  1646. GOTO :EOF
  1647.  
  1648.  
  1649.  
  1650. REM # =============================================================================================
  1651. REM # Documentation: After the module has been closed, do the final procedures: checking the exit code of the execution, and resetting some of the core's settings.
  1652. REM # =============================================================================================
  1653. :ProjectLoader_Finished
  1654. REM Check to see if there was an error first
  1655. ECHO.&ECHO.
  1656. ECHO %SeparatorLong%
  1657. ECHO Script has been closed!
  1658. ECHO %SeparatorLong%
  1659. REM Reset some of the cores environment settings.
  1660. CALL :EnvironmentSetup_Switch PartialReset
  1661. IF %scriptExitCode% NEQ 0 GOTO :ProjectLoader_ExitWithError
  1662. PAUSE
  1663. GOTO :EOF
  1664.  
  1665.  
  1666.  
  1667. REM # =============================================================================================
  1668. REM # Documentation: When the module has been terminated prematurely, then tell the user that the script closed with an error.
  1669. REM # =============================================================================================
  1670. :ProjectLoader_ExitWithError
  1671. ECHO !ERR: A module has been terminated with an error....
  1672. PAUSE
  1673. GOTO :EOF
  1674.  
  1675.  
  1676.  
  1677.  
  1678. REM =====================================================================
  1679. REM External Module Launcher
  1680. REM ----------------------------
  1681. REM This allows the user to utilize outside tools to get the job done that isn't normally provided in the program core.  This functionality gives the user the ability to use customized scripts to either get a few extra jobs finished or even to expand into more operations.  The modules, however, are not code checked.  Thus, if someone wrote 'del %systemdrive%' - then that'll happen.
  1682. REM External scripts directory is managed by this variable [ %DirSubScripts% - variable ]
  1683. REM Scripts that are executed from this environment are not allowed to use the core's environment.
  1684. REM =====================================================================
  1685.  
  1686.  
  1687. REM # =============================================================================================
  1688. REM # Documentation: If the external scripts directory does not exist within the filesystem, then try to create it.
  1689. REM # =============================================================================================
  1690. :LoadExtScriptsInspect
  1691. IF NOT EXIST "%DirSubScripts%" MKDIR "%DirSubScripts%" || ECHO !ERR_CRIT!: Could not create directory [ %DirSubScripts% ] within the local filesystem!
  1692. GOTO :EOF
  1693.  
  1694.  
  1695.  
  1696. REM # =============================================================================================
  1697. REM # Documentation: Display what scripts can be executed from the external scripts library.
  1698. REM # =============================================================================================
  1699. :LoadExtScriptsDirectoryViewer
  1700. DIR /B "%DirSubScripts%" | FINDSTR /E /I ".bat" || ECHO !ERR: Could not find the directory or files!&
  1701. GOTO :EOF
  1702.  
  1703.  
  1704.  
  1705. REM # =============================================================================================
  1706. REM # Documentation: External scripts menu
  1707. REM # =============================================================================================
  1708. :LoadExtScripts
  1709. CALL :DashboardDisplay
  1710. CALL :LoadExtScriptsInspect
  1711. ECHO Run External Scripts
  1712. ECHO.
  1713. ECHO Preset Directory: %DirSubScripts%
  1714. ECHO %SeparatorLong%
  1715. REM Display what scripts can be executed.
  1716. CALL :LoadExtScriptsDirectoryViewer
  1717. ECHO %SeparatorLong%
  1718. ECHO.&ECHO.
  1719. ECHO Other Options:
  1720. ECHO %SeparatorSmall%
  1721. ECHO [I] Install a External Script
  1722. ECHO [R] Refresh the list
  1723. ECHO [X] Cancel
  1724. ECHO %Separator%
  1725. ECHO.
  1726. ECHO Enter filename to launch an external module:
  1727. CALL :UserInput
  1728. GOTO :LoadExtScripts_UserInput
  1729.  
  1730.  
  1731.  
  1732. REM # =============================================================================================
  1733. REM # Documentation: Inspect the user's input and check if the script file can be executed.  If the latter is true, then simply allow it to be executed by calling the execute script function.
  1734. REM # =============================================================================================
  1735. :LoadExtScripts_UserInput
  1736. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  1737. IF /I "%STDIN%" EQU "X" GOTO :EOF
  1738. IF /I "%STDIN%" EQU "R" (
  1739.     CALL :ClearBuffer 1
  1740.     GOTO :LoadExtScripts
  1741. )
  1742. IF /I "%STDIN%" EQU "Refresh" (
  1743.     CALL :ClearBuffer 1
  1744.     GOTO :LoadExtScripts
  1745. )
  1746. IF /I "%STDIN%" EQU "I" (
  1747.     CALL :ClearBuffer 1
  1748.     CALL :LoadExtScripts_Install
  1749.     CALL :ClearBuffer 1
  1750.     GOTO :LoadExtScripts
  1751. )
  1752. IF /I "%STDIN%" EQU "Install" (
  1753.     CALL :ClearBuffer 1
  1754.     CALL :LoadExtScripts_Install
  1755.     CALL :ClearBuffer 1
  1756.     GOTO :LoadExtScripts
  1757. )
  1758. IF EXIST "%DirSubScripts%\%STDIN%" (
  1759.     CALL :LoadExtScripts_ProjectLoader_ExecuteScript "%DirSubScripts%\%STDIN%"
  1760.     CALL :LoadExtScripts_LastStage
  1761.     GOTO :LoadExtScripts
  1762. )
  1763. IF EXIST "%DirSubScripts%\%STDIN%.bat" (
  1764.     CALL :LoadExtScripts_ProjectLoader_ExecuteScript "%DirSubScripts%\%STDIN%.bat"
  1765.     CALL :LoadExtScripts_LastStage
  1766.     GOTO :LoadExtScripts
  1767. )
  1768. ECHO Filename could not be found!
  1769. PAUSE
  1770. CALL :ClearBuffer 1
  1771. GOTO :LoadExtScripts
  1772.  
  1773.  
  1774.  
  1775. REM # =============================================================================================
  1776. REM # Documentation: Install a generalized script.  To make things easier for the user, this will forcefully open a new window allowing the user to simply drag and drop a batch script into the directory.
  1777. REM # =============================================================================================
  1778. :LoadExtScripts_Install
  1779. IF EXIST "%DirSubScripts%" (
  1780.     CALL :LoadExtScripts_Install_Message
  1781.     CALL :LoadExtScripts_Install_ExplorerDirectory
  1782. ) ELSE (
  1783.     CALL :LoadExtScripts_Install_ErrorMessage
  1784. )
  1785. PAUSE
  1786. GOTO :EOF
  1787.  
  1788.  
  1789.  
  1790. :LoadExtScripts_Install_Message
  1791. ECHO Instructions:
  1792. ECHO With the newly pop-up directory window, simply drag and drop the project module into that directory.
  1793. ECHO This program only accepts 'Batch' [.bat] program scripts!
  1794. ECHO.
  1795. ECHO.
  1796. ECHO Safety Notice:
  1797. ECHO Please insure that the script file _is_safe_before_using_it_!  It is always possible for a script file remove the users data or perform various other malicious executions.  Thus, as a safety precaution, _always_check_user_reviews_and_inspect_the_code_before_blindly_using_them_!
  1798. ECHO.
  1799. GOTO :EOF
  1800.  
  1801.  
  1802.  
  1803. :LoadExtScripts_Install_ExplorerDirectory
  1804. CALL :Call_WindowsExplorer "%DirSubScripts%"
  1805. GOTO :EOF
  1806.  
  1807.  
  1808.  
  1809. :LoadExtScripts_Install_ErrorMessage
  1810. CALL :CantInstallScriptErrorMessage
  1811. GOTO :EOF
  1812.  
  1813.  
  1814.  
  1815. REM # =============================================================================================
  1816. REM # Parameters: [{String} FullPathFileName]
  1817. REM # Documentation: Execute the external script file into a new process.
  1818. REM # =============================================================================================
  1819. :LoadExtScripts_ProjectLoader_ExecuteScript
  1820. REM Update the title to include the script name that is going to be executed
  1821. CALL :UpdateCoreTitleExecutingScript "%~1"
  1822. REM Determine the parameters for START if the user enabled or disabled the Window Sharing
  1823. IF %ModuleExecuteSharingWindow% EQU False (
  1824.     SET ProcessVarB=
  1825. ) ELSE (
  1826.     SET "ProcessVarB=/B /WAIT"
  1827. )
  1828. REM The working variable 'ProcessVarA' is captured from the function :UpdateCoreTitleExecutingScript
  1829. START "Batch External Fork: %ProcessVarA%" %ProcessVarB% /I CMD /C CALL "%~1"
  1830. GOTO :EOF
  1831.  
  1832.  
  1833.  
  1834. REM # =============================================================================================
  1835. REM # Documentation: After a script has been terminated, this will print a notification that the script ended.  Additionally, this will also reset some of the core's environment settings that could have been altered, title - for example.
  1836. REM # =============================================================================================
  1837. :LoadExtScripts_LastStage
  1838. ECHO %SeparatorLong%
  1839. ECHO External Module has been closed!
  1840. ECHO %SeparatorLong%
  1841. PAUSE
  1842. REM Reset some of the environment settings
  1843. CALL :EnvironmentSetup_Switch PartialReset
  1844. CALL :ClearBuffer 1
  1845. GOTO :EOF
  1846.  
  1847.  
  1848.  
  1849.  
  1850. REM =====================================================================
  1851. REM Control Panel Menu
  1852. REM ----------------------------
  1853. REM Main setting screen; this allows the user to expeditiously modify the program settings and make any other customizations necessary.
  1854. REM =====================================================================
  1855.  
  1856.  
  1857. REM # =============================================================================================
  1858. REM # Documentation: Settings menu
  1859. REM # =============================================================================================
  1860. :ControlPanel
  1861. CALL :DashboardDisplay
  1862. ECHO Settings Menu
  1863. ECHO.
  1864. ECHO Select the following options:
  1865. ECHO %Separator%
  1866. ECHO [1] Copy Settings
  1867. ECHO [2] Directory Setup
  1868. ECHO [3] Terminal Sounds
  1869. ECHO [4] Logging Settings
  1870. ECHO.
  1871. ECHO Other Options
  1872. ECHO %SeparatorSmall%
  1873. ECHO [A] Advanced Settings
  1874. ECHO [D] Debug %ProgramName%
  1875. ECHO [X] Exit
  1876. CALL :UserInput
  1877. GOTO :ControlPanel_UserInput
  1878.  
  1879.  
  1880.  
  1881. REM # =============================================================================================
  1882. REM # Documentation: Inspect the users input
  1883. REM # =============================================================================================
  1884. :ControlPanel_UserInput
  1885. IF "%STDIN%" EQU "1" GOTO :ControlPanel_Choice_Copy
  1886. IF "%STDIN%" EQU "2" GOTO :ControlPanel_Choice_DirectorySetup
  1887. IF "%STDIN%" EQU "3" GOTO :ControlPanel_Choice_TerminalSounds
  1888. IF "%STDIN%" EQU "4" GOTO :ControlPanel_Choice_Logging
  1889. IF /I "%STDIN%" EQU "A" GOTO :ControlPanel_Choice_ControlPanelAdvanced
  1890. IF /I "%STDIN%" EQU "D" GOTO :ControlPanel_Choice_Debug
  1891. IF /I "%STDIN%" EQU "X" GOTO :EOF
  1892. IF /I "%STDIN%" EQU "Exit" GOTO :EOF
  1893. CALL :BadInput& GOTO :ControlPanel
  1894.  
  1895.  
  1896.  
  1897. REM # =============================================================================================
  1898. REM # Documentation: Allow the ability for the user to change their preferred duplicating software.
  1899. REM # =============================================================================================
  1900. :ControlPanel_Choice_Copy
  1901. CALL :ClearBuffer 1
  1902. CALL :ControlPanel_CopyConfiguration
  1903. CALL :ClearBuffer 1
  1904. GOTO :ControlPanel
  1905.  
  1906.  
  1907.  
  1908. REM # =============================================================================================
  1909. REM # Documentation: Allow the ability for the user to change the variable target that hoses either directories or exact file locations.
  1910. REM # =============================================================================================
  1911. :ControlPanel_Choice_DirectorySetup
  1912. CALL :ClearBuffer 1
  1913. CALL :ControlPanel_DirectorySetup
  1914. CALL :ClearBuffer 1
  1915. GOTO :ControlPanel
  1916.  
  1917.  
  1918.  
  1919. REM # =============================================================================================
  1920. REM # Documentation: Terminal alarm settings.
  1921. REM # =============================================================================================
  1922. :ControlPanel_Choice_TerminalSounds
  1923. CALL :ClearBuffer 1
  1924. CALL :ControlPanel_TerminalSound
  1925. CALL :ClearBuffer 1
  1926. GOTO :ControlPanel
  1927.  
  1928.  
  1929.  
  1930. REM # =============================================================================================
  1931. REM # Documentation: Allow the user to enable or disable the ability to log.
  1932. REM # =============================================================================================
  1933. :ControlPanel_Choice_Logging
  1934. CALL :ClearBuffer 1
  1935. CALL :ControlPanel_LogSettings
  1936. CALL :ClearBuffer 1
  1937. GOTO :ControlPanel
  1938.  
  1939.  
  1940.  
  1941. REM # =============================================================================================
  1942. REM # Documentation: Call the debugger setting tool.
  1943. REM # =============================================================================================
  1944. :ControlPanel_Choice_Debug
  1945. CALL :ClearBuffer 1
  1946. CALL :DebuggerTool
  1947. CALL :ClearBuffer 1
  1948. GOTO :ControlPanel
  1949.  
  1950.  
  1951.  
  1952. REM # =============================================================================================
  1953. REM # Documentation: Call the advanced control panel.
  1954. REM # =============================================================================================
  1955. :ControlPanel_Choice_ControlPanelAdvanced
  1956. CALL :ClearBuffer 1
  1957. CALL :ControlPanelAdvanced
  1958. CALL :ClearBuffer 1
  1959. GOTO :ControlPanel
  1960.  
  1961.  
  1962.  
  1963.  
  1964. REM =====================================================================
  1965. REM Control Panel Advanced Menu
  1966. REM ----------------------------
  1967. REM This section allows the user to modify more advanced settings that most users will not generally care about.
  1968. REM =====================================================================
  1969.  
  1970.  
  1971. REM # =============================================================================================
  1972. REM # Documentation: Advanced settings menu
  1973. REM # =============================================================================================
  1974. :ControlPanelAdvanced
  1975. CALL :DashboardDisplay
  1976. ECHO Advanced Settings Menu
  1977. ECHO For the Power Users!
  1978. ECHO.
  1979. ECHO Select the following options:
  1980. ECHO %Separator%
  1981. ECHO [1] General Program Settings
  1982. ECHO [2] 7Zip Settings
  1983. ECHO [3] Copy Parameter Settings
  1984. ECHO.
  1985. ECHO Other Options
  1986. ECHO %SeparatorSmall%
  1987. ECHO [X] Exit
  1988. CALL :UserInput
  1989. GOTO :ControlPanelAdvanced_UserInput
  1990.  
  1991.  
  1992.  
  1993. REM # =============================================================================================
  1994. REM # Documentation: Inspect the users input
  1995. REM # =============================================================================================
  1996. :ControlPanelAdvanced_UserInput
  1997. IF "%STDIN%" EQU "1" GOTO :ControlPanelAdvanced_Choice_GeneralProgramConfiguration
  1998. IF "%STDIN%" EQU "2" GOTO :ControlPanelAdvanced_Choice_7ZipConfiguration
  1999. IF "%STDIN%" EQU "3" GOTO :ControlPanelAdvanced_Choice_CopyParameterConfiguration
  2000. IF /I "%STDIN%" EQU "X" GOTO :EOF
  2001. IF /I "%STDIN%" EQU "Exit" GOTO :EOF
  2002. CALL :BadInput& GOTO :ControlPanelAdvanced
  2003.  
  2004.  
  2005.  
  2006. REM # =============================================================================================
  2007. REM # Documentation: Call the Advanced Menu for: General Program Settings.
  2008. REM # =============================================================================================
  2009. :ControlPanelAdvanced_Choice_GeneralProgramConfiguration
  2010. CALL :ClearBuffer 1
  2011. CALL :ControlPanel_GeneralProgramConfiguration
  2012. CALL :ClearBuffer 1
  2013. GOTO :ControlPanelAdvanced
  2014.  
  2015.  
  2016.  
  2017. REM # =============================================================================================
  2018. REM # Documentation: Call the Advanced Menu for: 7Zip Configuration.
  2019. REM # =============================================================================================
  2020. :ControlPanelAdvanced_Choice_7ZipConfiguration
  2021. CALL :ClearBuffer 1
  2022. CALL :ControlPanel_7Zip
  2023. CALL :ClearBuffer 1
  2024. GOTO :ControlPanelAdvanced
  2025.  
  2026.  
  2027.  
  2028. REM # =============================================================================================
  2029. REM # Documentation: Call the Advanced Menu for: Copy Parameter Configurations menu.
  2030. REM # =============================================================================================
  2031. :ControlPanelAdvanced_Choice_CopyParameterConfiguration
  2032. CALL :ClearBuffer 1
  2033. CALL :ControlPanel_CopyBehaviorConfiguration
  2034. CALL :ClearBuffer 1
  2035. GOTO :ControlPanelAdvanced
  2036.  
  2037.  
  2038.  
  2039.  
  2040. REM =====================================================================
  2041. REM User Configuration Manager
  2042. REM ----------------------------
  2043. REM This script allows the user to store and manage their own preset configuration that is located in the [ %DirSavePresets% - variable ].  These configurations files contains the user's personal settings that is used within this program, and is remotely handled within the Initialization block.
  2044. REM =====================================================================
  2045.  
  2046.  
  2047. REM # =============================================================================================
  2048. REM # Documentation: Check to make sure that the Preset directory [ %DirSavePresets% ] exists within the filesystem, if it does not - then simply create the directory.
  2049. REM # =============================================================================================
  2050. :UserConfigurationDirectoryInspect
  2051. IF NOT EXIST "%DirSavePresets%" MKDIR "%DirSavePresets%" || ECHO !ERR_CRIT!: Could not create directory [ %DirSavePresets% ] within the local filesystem!
  2052. GOTO :EOF
  2053.  
  2054.  
  2055.  
  2056. REM # =============================================================================================
  2057. REM # Documentation: Display what batch scripts were detected within the preset directory.
  2058. REM # =============================================================================================
  2059. :UserConfigurationDirectoryViewer
  2060. DIR /B "%DirSavePresets%" | FINDSTR /E /I ".bat" || ECHO !ERR: Could not find the directory or files!&
  2061. GOTO :EOF
  2062.  
  2063.  
  2064.  
  2065. REM # =============================================================================================
  2066. REM # Documentation: User preset configuration menu
  2067. REM # =============================================================================================
  2068. :UserConfiguration
  2069. CALL :DashboardDisplay
  2070. REM Check the preset config. menu.
  2071. CALL :UserConfigurationDirectoryInspect
  2072. ECHO User Configuration Menu
  2073. ECHO.
  2074. ECHO Preset Directory: %DirSavePresets%
  2075. ECHO %SeparatorLong%
  2076. REM Preview of all of the scripts found
  2077. CALL :UserConfigurationDirectoryViewer
  2078. ECHO %SeparatorLong%
  2079. ECHO.&ECHO.
  2080. ECHO Select the following options:
  2081. ECHO %Separator%
  2082. ECHO [1] Load Settings
  2083. ECHO [2] Save Settings
  2084. ECHO [R] Refresh List
  2085. ECHO [D] Remove a Saved Configuration
  2086. ECHO [X] Return to Main Menu
  2087. CALL :UserInput
  2088. GOTO :UserConfiguration_UserInput
  2089.  
  2090.  
  2091.  
  2092. REM # =============================================================================================
  2093. REM # Documentation: Inspect the user's input
  2094. REM # =============================================================================================
  2095. :UserConfiguration_UserInput
  2096. REM Read the STDIN and process it
  2097. IF "%STDIN%" EQU "1" (
  2098.     CALL :UserConfiguration_SelectFile Load
  2099.     CALL :EnvironmentSetup_Switch UserConfigLoad
  2100.     CALL :ClearBuffer 1
  2101.     GOTO :UserConfiguration
  2102. )
  2103. IF /I "%STDIN%" EQU "Load" (
  2104.     CALL :UserConfiguration_SelectFile Load
  2105.     CALL :ClearBuffer 1
  2106.     GOTO :UserConfiguration
  2107. )
  2108. IF "%STDIN%" EQU "2" (
  2109.     CALL :UserConfiguration_SelectFile Save
  2110.     CALL :ClearBuffer 1
  2111.     GOTO :UserConfiguration
  2112. )
  2113. IF /I "%STDIN%" EQU "Save" (
  2114.     CALL :UserConfiguration_SelectFile Save
  2115.     CALL :ClearBuffer 1
  2116.     GOTO :UserConfiguration
  2117. )
  2118. IF /I "%STDIN%" EQU "R" (
  2119.     CALL :ClearBuffer 1
  2120.     GOTO :UserConfiguration
  2121. )
  2122. IF /I "%STDIN%" EQU "Refresh" (
  2123.     CALL :ClearBuffer 1
  2124.     GOTO :UserConfiguration
  2125. )
  2126. IF /I "%STDIN%" EQU "D" (
  2127.     CALL :UserConfiguration_SelectFile Delete
  2128.     CALL :ClearBuffer 1
  2129.     GOTO :UserConfiguration
  2130. )
  2131. IF /I "%STDIN%" EQU "Delete" (
  2132.     CALL :UserConfiguration_SelectFile Delete
  2133.     CALL :ClearBuffer 1
  2134.     GOTO :UserConfiguration
  2135. )
  2136. IF /I "%STDIN%" EQU "X" GOTO :EOF
  2137. IF /I "%STDIN%" EQU "Exit" GOTO :EOF
  2138. CALL :BadInput& GOTO :UserConfiguration
  2139.  
  2140.  
  2141.  
  2142. REM # =============================================================================================
  2143. REM # Parameters: [{String} Mode]
  2144. REM # Documentation: This is a central point when the user wants to either select a file or create a new preset configuration file.
  2145. REM # =============================================================================================
  2146. :UserConfiguration_SelectFile
  2147. ECHO.
  2148. ECHO %1 Mode Selected
  2149. ECHO %Separator%
  2150. ECHO NOTE: Do not include the ^'.bat^' file extension.
  2151. ECHO.
  2152. ECHO Other Options:
  2153. ECHO [Cancel]
  2154. ECHO.
  2155. ECHO Enter a filename:
  2156. CALL :UserInput
  2157. CALL :UserConfiguration_SelectFile_UserInput %1
  2158. GOTO :EOF
  2159.  
  2160.  
  2161.  
  2162. REM # =============================================================================================
  2163. REM # Parameters: [{String} Mode]
  2164. REM # Documentation: Inspect the user's input and determine what action to perform.
  2165. REM # =============================================================================================
  2166. :UserConfiguration_SelectFile_UserInput
  2167. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  2168. REM Cache the users input into a working variable
  2169. CALL :UserConfiguration_SelectFile_CacheFileName
  2170. REM Fix the STDIN variable if necessary
  2171. CALL :UserConfiguration_SelectFile_UpdateVariable
  2172. REM Save mode
  2173. IF %1 EQU Save CALL :UserConfiguration_ChoiceSave& GOTO :EOF
  2174. REM Load mode
  2175. IF %1 EQU Load CALL :UserConfiguration_ChoiceLoad& GOTO :EOF
  2176. REM Expunge mode
  2177. IF %1 EQU Delete CALL :UserConfiguration_ChoiceThrash& GOTO :EOF
  2178. GOTO :EOF
  2179.  
  2180.  
  2181.  
  2182. REM # =============================================================================================
  2183. REM # Documentation: If incase the user did not input the file extension, add it for them.
  2184. REM # =============================================================================================
  2185. :UserConfiguration_SelectFile_UpdateVariable
  2186. SET "STDIN=%STDIN%.bat"
  2187. GOTO :EOF
  2188.  
  2189.  
  2190.  
  2191. REM # =============================================================================================
  2192. REM # Documentation: Cache the filename in a temporary working variable; this can be used later - such as defining the filename properly.
  2193. REM # =============================================================================================
  2194. :UserConfiguration_SelectFile_CacheFileName
  2195. SET "ProcessVarA=%STDIN%"
  2196. GOTO :EOF
  2197.  
  2198.  
  2199.  
  2200. REM # =============================================================================================
  2201. REM # Documentation: Load the configuration file into the current environment.
  2202. REM # =============================================================================================
  2203. :UserConfiguration_ChoiceLoad
  2204. IF /I EXIST "%DirSavePresets%\%STDIN%" (
  2205.     CALL "%DirSavePresets%\%STDIN%"
  2206.     GOTO :EOF
  2207. ) ELSE (
  2208.     ECHO !ERR: Filename could not be found!
  2209.     PAUSE
  2210.     GOTO :EOF
  2211. )
  2212.  
  2213.  
  2214.  
  2215. REM # =============================================================================================
  2216. REM # Documentation: Save a new configuration file into the filesystem.
  2217. REM # =============================================================================================
  2218. :UserConfiguration_ChoiceSave
  2219. REM Does the file already exist within the filesystem?
  2220. IF /I EXIST "%DirSavePresets%\%STDIN%" (
  2221.     ECHO !ERR: File named '%STDIN%' already exists!
  2222.     PAUSE
  2223.     GOTO :EOF
  2224. )
  2225. CALL :UserConfiguration_CreateSave "%DirSavePresets%\%STDIN%"
  2226. REM Load the configuration, this will load the keychain ID and config name into memory.
  2227. CALL :UserConfiguration_ChoiceLoad "%DirSavePresets%\%STDIN%"
  2228. GOTO :EOF
  2229.  
  2230.  
  2231.  
  2232. REM # =============================================================================================
  2233. REM # Parameters: [{String} FullPathFileName]
  2234. REM # Documentation: Create the header information into the file.
  2235. REM # =============================================================================================
  2236. :UserConfiguration_CreateSave
  2237. REM Notice: This first statement will OVERWRITE the ASCII file!
  2238. (ECHO @ECHO OFF) > "%~1"
  2239. (ECHO ECHO User Saved Configuration Generated using %ProgramName% Version %ProgramVersion% [%CodeName%]) >> "%~1"
  2240. (ECHO ECHO Date created: %Date% - %Time% by %UserName% on system %ComputerName%) >> "%~1"
  2241. (ECHO SET UserConfigurationLoaded=%ProcessVarA%) >> "%~1"
  2242. (ECHO SET UserConfigurationKeyChainToken=%RANDOM%) >> "%~1"
  2243. ECHO REM %SeparatorLong%>> "%~1"
  2244. ECHO REM %SeparatorLong%>> "%~1"
  2245. (ECHO.) >> "%~1"
  2246. REM To avoid redundancy and mistakes of forgotten variables, we'll utilize the EnvironmentSetup functions.
  2247. CALL :EnvironmentSetup_Switch UserConfigSave
  2248. (ECHO GOTO :EOF) >> "%~1"
  2249. GOTO :EOF
  2250.  
  2251.  
  2252.  
  2253. REM # =============================================================================================
  2254. REM # Documentation: Expunge a preset configuration file from the filesystem.
  2255. REM # =============================================================================================
  2256. :UserConfiguration_ChoiceThrash
  2257. IF /I EXIST "%DirSavePresets%\%STDIN%" (
  2258.    REM Prompt the user for confirmation before deleting the file.
  2259.     DEL /P "%DirSavePresets%\%STDIN%"
  2260.     GOTO :EOF
  2261. ) ELSE (
  2262.     ECHO !ERR: Filename could not be found!
  2263.     PAUSE
  2264.     GOTO :EOF
  2265. )
  2266.  
  2267.  
  2268.  
  2269.  
  2270. REM =====================================================================
  2271. REM Control Panel: Log Settings
  2272. REM ----------------------------
  2273. REM This allows the user to toggle the Logfile functionality within this entire program.  This can be useful for debugging or viewing the output from all tasks and operations, such as MSBUILD, XCopy, moving, etc....
  2274. REM For faster performance disable this option, however, enable this if you want to know 'every' step that the compiler phase is doing.
  2275. REM =====================================================================
  2276.  
  2277.  
  2278. REM # =============================================================================================
  2279. REM # Documentation: This function is a translator which takes the variable's value and stores a nicer value name to a temporary working variable.
  2280. REM # =============================================================================================
  2281. :ControlPanel_LogSettings_Translator
  2282. IF %ToggleLog% EQU True SET ProcessVarA=Enable& GOTO :EOF
  2283. IF %ToggleLog% EQU False SET ProcessVarA=Disable
  2284. GOTO :EOF
  2285.  
  2286.  
  2287.  
  2288. REM # =============================================================================================
  2289. REM # Documentation: Logfile menu
  2290. REM # =============================================================================================
  2291. :ControlPanel_LogSettings
  2292. CALL :DashboardDisplay
  2293. REM Translate the actual variable value into another variable with a nicer value.
  2294. CALL :ControlPanel_LogSettings_Translator
  2295. ECHO Log Settings
  2296. ECHO.
  2297. ECHO Description
  2298. ECHO %SeparatorSmall%
  2299. ECHO When compiling projects or tasks are performed for a project, logging will allow the user to view exactly what is being done in the background and even more verbose information that may not be available on the terminal screen.  For faster performance, leave this setting disabled.
  2300. ECHO.
  2301. ECHO Default Value: Disable
  2302. ECHO Logging is currently: %ProcessVarA%
  2303. ECHO %Separator%
  2304. ECHO [1] Disable Logging
  2305. ECHO [2] Enable Logging
  2306. ECHO.
  2307. ECHO Other Options
  2308. ECHO %SeparatorSmall%
  2309. ECHO [X] Cancel
  2310. CALL :UserInput
  2311. GOTO :ControlPanel_LogSettings_UserInput
  2312.  
  2313.  
  2314.  
  2315. REM # =============================================================================================
  2316. REM # Documentation: Inspect the users input
  2317. REM # =============================================================================================
  2318. :ControlPanel_LogSettings_UserInput
  2319. IF /I "%STDIN%" EQU "X" GOTO :EOF
  2320. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  2321.  
  2322. IF "%STDIN%" EQU "1" (
  2323.     CALL :ControlPanel_LogSettings_Toggle False
  2324.     CALL :ClearBuffer 1
  2325.     GOTO :ControlPanel_LogSettings
  2326. )
  2327. IF "%STDIN%" EQU "2" (
  2328.     CALL :ControlPanel_LogSettings_Toggle True
  2329.     CALL :ClearBuffer 1
  2330.     GOTO :ControlPanel_LogSettings
  2331. )
  2332. CALL :BadInput& GOTO :ControlPanel_LogSettings
  2333.  
  2334.  
  2335.  
  2336. REM # =============================================================================================
  2337. REM # Parameters: [{Bool} SettingType]
  2338. REM # Documentation: Adjust the variable value as requested by the user, this will set the STDOUT variable live.
  2339. REM # =============================================================================================
  2340. :ControlPanel_LogSettings_Toggle
  2341. IF %1 EQU True (
  2342.     SET ToggleLog=True
  2343.     SET STDOUT=%ProgramName%_%core.Date%_%Project%.txt
  2344.     GOTO :EOF
  2345. ) ELSE (
  2346.     SET ToggleLog=False
  2347.     SET STDOUT=NUL
  2348.     GOTO :EOF
  2349. )
  2350.  
  2351.  
  2352.  
  2353.  
  2354. REM =====================================================================
  2355. REM Control Panel: Copy Software
  2356. REM ----------------------------
  2357. REM This allows the user to switch from one supported mass copying software to another.  This is going to be needed when transporting a file or an entire directory from one place to another within the filesystem.
  2358. REM =====================================================================
  2359.  
  2360.  
  2361.  
  2362. REM # =============================================================================================
  2363. REM # Documentation: Copy software menu
  2364. REM # =============================================================================================
  2365. :ControlPanel_CopyConfiguration
  2366. CALL :DashboardDisplay
  2367. ECHO Copying Software Selection
  2368. ECHO.
  2369. ECHO Description
  2370. ECHO %SeparatorSmall%
  2371. ECHO To transition abundance of files from one directory to another, modules can call the preferred dedicated copy software [such as the ones listed below] to accomplish the tasks efficiently.
  2372. ECHO.
  2373. ECHO Default Value: XCopy
  2374. ECHO Copying is currently: %CopyMethod%
  2375. ECHO %Separator%
  2376. ECHO [1] XCopy
  2377. ECHO [2] RoboCopy
  2378. ECHO     [Requires Administrative Privileges]
  2379. ECHO.
  2380. ECHO Other Options
  2381. ECHO %SeparatorSmall%
  2382. ECHO [X] Cancel
  2383. CALL :UserInput
  2384. GOTO :ControlPanel_CopyConfiguration_UserInput
  2385.  
  2386.  
  2387.  
  2388. REM # =============================================================================================
  2389. REM # Documentation: Inspect the users input
  2390. REM # =============================================================================================
  2391. :ControlPanel_CopyConfiguration_UserInput
  2392. IF /I "%STDIN%" EQU "X" GOTO :EOF
  2393. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  2394.  
  2395. IF "%STDIN%" EQU "1" (
  2396.     CALL :ControlPanel_CopyConfiguration_Toggle xcopy
  2397.     CALL :ClearBuffer 1
  2398.     GOTO :ControlPanel_CopyConfiguration
  2399. )
  2400. IF "%STDIN%" EQU "2" (
  2401.    REM Call an independent function that makes sure that Robocopy is selectable.
  2402.     CALL :ControlPanel_CopyConfiguration_RobocopySetup
  2403.     CALL :ClearBuffer 1
  2404.     GOTO :ControlPanel_CopyConfiguration
  2405. )
  2406. CALL :BadInput& GOTO :ControlPanel_CopyConfiguration
  2407.  
  2408.  
  2409.  
  2410. REM # =============================================================================================
  2411. REM # Parameters: [{String} SettingType]
  2412. REM # Documentation: Adjust the variable value as requested by the user.
  2413. REM # =============================================================================================
  2414. :ControlPanel_CopyConfiguration_Toggle
  2415. IF %1 EQU xcopy (
  2416.     SET CopyMethod=XCOPY
  2417.     SET CopyArg=%XCopyArg%
  2418.     GOTO :EOF
  2419. )
  2420. IF %1 EQU robocopy (
  2421.     SET CopyMethod=ROBOCOPY
  2422.     SET CopyArg=%RoboCopyArg%
  2423.     GOTO :EOF
  2424. )
  2425.  
  2426.  
  2427.  
  2428. REM # =============================================================================================
  2429. REM # Parameters: [{String} SettingType]
  2430. REM # Documentation: Check if the program has enough permissions to utilize the copy program.
  2431. REM #       ROBOCOPY can only be used with administrator\Root access.
  2432. REM # =============================================================================================
  2433. :ControlPanel_CopyConfiguration_CheckPermissions
  2434. IF %Detect_RootAccess% NEQ True (
  2435.     ECHO.&ECHO.
  2436.     ECHO ^<!^>    WARNING    ^<!^>
  2437.     ECHO %Separator%
  2438.     ECHO.
  2439.     ECHO The selected duplicating software [%~1] requires Administrative privileges!
  2440.     ECHO %ProgramName% must be restarted with Administrative privileges in order to use [%~1]!
  2441.     PAUSE
  2442. )
  2443. GOTO :EOF
  2444.  
  2445.  
  2446.  
  2447. REM # =============================================================================================
  2448. REM # Documentation: If the ROBOCOPY software does not exist, disallow the user from selecting it.
  2449. REM # =============================================================================================
  2450. :ControlPanel_CopyConfiguration_RobocopySetup_CheckExists
  2451. IF %Detect_Robocopy% NEQ True (
  2452.     ECHO.&ECHO.
  2453.     ECHO ^<!^>    Robocopy Not Found!    ^<!^>
  2454.     ECHO %SeparatorLong%
  2455.     ECHO.
  2456.     ECHO %ProgramName% was unable to detect Robocopy on the host system!
  2457.     PAUSE
  2458.     EXIT /B 1
  2459. )
  2460. EXIT /B 0
  2461.  
  2462.  
  2463.  
  2464. REM # =============================================================================================
  2465. REM # Documentation: This is an independent function that handles with Robocopy setup procedures; otherwise tieing into one grouped function will become an utter mess and pure frustration....
  2466. REM # =============================================================================================
  2467. :ControlPanel_CopyConfiguration_RobocopySetup
  2468. REM Does robocopy even exists in the system?  -- If not, leave this function
  2469. CALL :ControlPanel_CopyConfiguration_RobocopySetup_CheckExists || GOTO :EOF
  2470. REM Is the program running with adminstrative\root access?  NOTE: Robocopy requires it due to its nature.
  2471. CALL :ControlPanel_CopyConfiguration_CheckPermissions robocopy
  2472. REM If everything is okay, set it
  2473. CALL :ControlPanel_CopyConfiguration_Toggle robocopy
  2474. GOTO :EOF
  2475.  
  2476.  
  2477.  
  2478.  
  2479. REM =====================================================================
  2480. REM Control Panel: Copy Parameters and Switches Configurations Menu
  2481. REM ----------------------------
  2482. REM This section allows the user to modify the copying software's behavior and how the data is duplicated.
  2483. REM =====================================================================
  2484.  
  2485.  
  2486. REM # =============================================================================================
  2487. REM # Documentation: Mass Copy Settings Menu
  2488. REM # =============================================================================================
  2489. :ControlPanel_CopyBehaviorConfiguration
  2490. CALL :DashboardDisplay
  2491. ECHO Copy Behavior Selection
  2492. ECHO.
  2493. ECHO Select the following options:
  2494. ECHO %Separator%
  2495. ECHO [1] COPY [Internal Command]
  2496. ECHO [2] XCOPY
  2497. ECHO [3] ROBOCOPY
  2498. ECHO.
  2499. ECHO Other Options
  2500. ECHO %SeparatorSmall%
  2501. ECHO [X] Exit
  2502. CALL :UserInput
  2503. GOTO :ControlPanel_CopyBehaviorConfiguration_UserInput
  2504.  
  2505.  
  2506.  
  2507. REM # =============================================================================================
  2508. REM # Documentation: Inspect the users input
  2509. REM # =============================================================================================
  2510. :ControlPanel_CopyBehaviorConfiguration_UserInput
  2511. IF "%STDIN%" EQU "1" GOTO :ControlPanel_CopyBehaviorConfiguration_Choice_COPYintCMDConfiguration
  2512. IF "%STDIN%" EQU "2" GOTO :ControlPanel_CopyBehaviorConfiguration_Choice_XCOPYConfiguration
  2513. IF "%STDIN%" EQU "3" GOTO :ControlPanel_CopyBehaviorConfiguration_Choice_ROBOCOPYConfiguration
  2514. IF /I "%STDIN%" EQU "X" GOTO :EOF
  2515. IF /I "%STDIN%" EQU "Exit" GOTO :EOF
  2516. CALL :BadInput& GOTO :ControlPanel_CopyBehaviorConfiguration
  2517.  
  2518.  
  2519.  
  2520. REM # =============================================================================================
  2521. REM # Documentation: Call the function that allows the user to modify the intCMD COPY's parameters and switches.
  2522. REM # =============================================================================================
  2523. :ControlPanel_CopyBehaviorConfiguration_Choice_COPYintCMDConfiguration
  2524. CALL :ClearBuffer 1
  2525. CALL :ControlPanel_intCMDCopyParameterConfiguration
  2526. CALL :ClearBuffer 1
  2527. GOTO :ControlPanel_CopyBehaviorConfiguration
  2528.  
  2529.  
  2530.  
  2531. REM # =============================================================================================
  2532. REM # Documentation: Call the function that allows the user to modify XCOPY's parameters and switches.
  2533. REM # =============================================================================================
  2534. :ControlPanel_CopyBehaviorConfiguration_Choice_XCOPYConfiguration
  2535. CALL :ClearBuffer 1
  2536. CALL :ControlPanel_XCopyParameterConfiguration
  2537. CALL :ClearBuffer 1
  2538. GOTO :ControlPanel_CopyBehaviorConfiguration
  2539.  
  2540.  
  2541.  
  2542. REM # =============================================================================================
  2543. REM # Documentation: Call the function that allows the user to modify ROBOCOPY's parameters and switches.
  2544. REM # =============================================================================================
  2545. :ControlPanel_CopyBehaviorConfiguration_Choice_ROBOCOPYConfiguration
  2546. CALL :ClearBuffer 1
  2547. CALL :ControlPanel_RoboCopyParameterConfiguration
  2548. CALL :ClearBuffer 1
  2549. GOTO :ControlPanel_CopyBehaviorConfiguration
  2550.  
  2551.  
  2552.  
  2553.  
  2554. REM =====================================================================
  2555. REM Control Panel: IntCMD Copy Behavior
  2556. REM ----------------------------
  2557. REM This allows the user to change the behavioral of the internal command 'Copy'.  This section merely adjusts what parameters and switches are to be used when using the command.
  2558. REM =====================================================================
  2559.  
  2560.  
  2561.  
  2562. REM # =============================================================================================
  2563. REM # Documentation: Copy [IntCMD] software Behavior Menu
  2564. REM # =============================================================================================
  2565. :ControlPanel_intCMDCopyParameterConfiguration
  2566. CALL :DashboardDisplay
  2567. ECHO Copy [Internal Command] Switches Configuration
  2568. ECHO.
  2569. ECHO Description
  2570. ECHO %SeparatorSmall%
  2571. ECHO This allows the ability for the user to customize the switches that can be utilized when a module copies data using the internal command 'COPY'
  2572. ECHO.
  2573. ECHO %Separator%
  2574. ECHO [1] Decrypt Files
  2575. ECHO     Switch: /D
  2576. ECHO     Current: %ParametersCopy.Decrypt%
  2577. ECHO [2] Verify Data
  2578. ECHO     Switch: /V
  2579. ECHO     Current: %ParametersCopy.Verify%
  2580. ECHO [3] Suppress Overwrite Messages
  2581. ECHO     Switch: /Y
  2582. ECHO     Current: %ParametersCopy.Suppress%
  2583. ECHO [4] Network Restart Mode
  2584. ECHO     Switch: /Z
  2585. ECHO     Current: %ParametersCopy.Restart%
  2586. ECHO.
  2587. ECHO Other Options
  2588. ECHO %SeparatorSmall%
  2589. ECHO [X] Cancel
  2590. CALL :UserInput
  2591. GOTO :ControlPanel_intCMDCopyParameterConfiguration_UserInput
  2592.  
  2593.  
  2594.  
  2595. REM # =============================================================================================
  2596. REM # Documentation: Inspect the users input
  2597. REM # =============================================================================================
  2598. :ControlPanel_intCMDCopyParameterConfiguration_UserInput
  2599. IF /I "%STDIN%" EQU "X" GOTO :EOF
  2600. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  2601. REM The idea here is to change the initial value and then build the entire CopyIntCMDArg
  2602. IF "%STDIN%" EQU "1" (
  2603.     CALL :ControlPanel_intCMDCopyParameterConfiguration_Toggle_Decrypt
  2604.     CALL :ControlPanel_intCMDCopyParameterConfiguration_Builder
  2605.     CALL :ControlPanel_intCMDCopyParameterConfiguration_CopyArgUpdate
  2606.     CALL :ClearBuffer 1
  2607.     GOTO :ControlPanel_intCMDCopyParameterConfiguration
  2608. )
  2609. IF "%STDIN%" EQU "2" (
  2610.     CALL :ControlPanel_intCMDCopyParameterConfiguration_Toggle_Verify
  2611.     CALL :ControlPanel_intCMDCopyParameterConfiguration_Builder
  2612.     CALL :ControlPanel_intCMDCopyParameterConfiguration_CopyArgUpdate
  2613.     CALL :ClearBuffer 1
  2614.     GOTO :ControlPanel_intCMDCopyParameterConfiguration
  2615. )
  2616. IF "%STDIN%" EQU "3" (
  2617.     CALL :ControlPanel_intCMDCopyParameterConfiguration_Toggle_Suppress
  2618.     CALL :ControlPanel_intCMDCopyParameterConfiguration_Builder
  2619.     CALL :ControlPanel_intCMDCopyParameterConfiguration_CopyArgUpdate
  2620.     CALL :ClearBuffer 1
  2621.     GOTO :ControlPanel_intCMDCopyParameterConfiguration
  2622. )
  2623. IF "%STDIN%" EQU "4" (
  2624.     CALL :ControlPanel_intCMDCopyParameterConfiguration_Toggle_Restart
  2625.     CALL :ControlPanel_intCMDCopyParameterConfiguration_Builder
  2626.     CALL :ControlPanel_intCMDCopyParameterConfiguration_CopyArgUpdate
  2627.     CALL :ClearBuffer 1
  2628.     GOTO :ControlPanel_intCMDCopyParameterConfiguration
  2629. )
  2630. CALL :BadInput& GOTO :ControlPanel_intCMDCopyParameterConfiguration
  2631.  
  2632.  
  2633.  
  2634. REM # =============================================================================================
  2635. REM # Documentation: This function toggles the value to enable or disable Decrypt
  2636. REM # =============================================================================================
  2637. :ControlPanel_intCMDCopyParameterConfiguration_Toggle_Decrypt
  2638. IF %ParametersCopy.Decrypt% EQU True (
  2639.     SET ParametersCopy.Decrypt=False
  2640. ) ELSE (
  2641.     SET ParametersCopy.Decrypt=True
  2642. )
  2643. GOTO :EOF
  2644.  
  2645.  
  2646.  
  2647. REM # =============================================================================================
  2648. REM # Documentation: This function toggles the value to enable or disable Verify
  2649. REM # =============================================================================================
  2650. :ControlPanel_intCMDCopyParameterConfiguration_Toggle_Verify
  2651. IF %ParametersCopy.Verify% EQU True (
  2652.     SET ParametersCopy.Verify=False
  2653. ) ELSE (
  2654.     SET ParametersCopy.Verify=True
  2655. )
  2656. GOTO :EOF
  2657.  
  2658.  
  2659.  
  2660. REM # =============================================================================================
  2661. REM # Documentation: This function toggles the value to enable or disable Suppress Warnings
  2662. REM # =============================================================================================
  2663. :ControlPanel_intCMDCopyParameterConfiguration_Toggle_Suppress
  2664. IF %ParametersCopy.Suppress% EQU True (
  2665.     SET ParametersCopy.Suppress=False
  2666. ) ELSE (
  2667.     SET ParametersCopy.Suppress=True
  2668. )
  2669. GOTO :EOF
  2670.  
  2671.  
  2672.  
  2673. REM # =============================================================================================
  2674. REM # Documentation: This function toggles the value to enable or disable Restart
  2675. REM # =============================================================================================
  2676. :ControlPanel_intCMDCopyParameterConfiguration_Toggle_Restart
  2677. IF %ParametersCopy.Restart% EQU True (
  2678.     SET ParametersCopy.Restart=False
  2679. ) ELSE (
  2680.     SET ParametersCopy.Restart=True
  2681. )
  2682. GOTO :EOF
  2683.  
  2684.  
  2685.  
  2686. REM # =============================================================================================
  2687. REM # Documentation: Update the entire CopyIntCMDArg variable.  This works by simply taking all of the supported parameters and updates the main holder variable
  2688. REM # =============================================================================================
  2689. :ControlPanel_intCMDCopyParameterConfiguration_Builder
  2690. REM First, clear the entire variable by uninitializing it
  2691. SET CopyIntCMDArg=
  2692. REM Build it again with the newer changes
  2693. IF %ParametersCopy.Decrypt% EQU True (
  2694.     SET CopyIntCMDArg=%CopyIntCMDArg%/D
  2695. )
  2696.  
  2697. IF %ParametersCopy.Verify% EQU True (
  2698.     SET CopyIntCMDArg=%CopyIntCMDArg%/V
  2699. )
  2700.  
  2701. IF %ParametersCopy.Suppress% EQU True (
  2702.     SET CopyIntCMDArg=%CopyIntCMDArg%/Y
  2703. )
  2704.  
  2705. IF %ParametersCopy.Restart% EQU True (
  2706.     SET CopyIntCMDArg=%CopyIntCMDArg%/Z
  2707. )
  2708. GOTO :EOF
  2709.  
  2710.  
  2711.  
  2712. REM # =============================================================================================
  2713. REM # Documentation: If the user has the intCMD COPY as the primary mass copier, then update the CopyArg parameter.
  2714. REM # =============================================================================================
  2715. :ControlPanel_intCMDCopyParameterConfiguration_CopyArgUpdate
  2716. IF %CopyMethod% EQU COPY (
  2717.     SET "CopyArg=%CopyIntCMDArg%"
  2718. )
  2719. GOTO :EOF
  2720.  
  2721.  
  2722.  
  2723.  
  2724. REM =====================================================================
  2725. REM Control Panel: XCopy Behavior
  2726. REM ----------------------------
  2727. REM This allows the user to change the behavioral of the external command 'XCopy'.  This section merely adjusts what parameters and switches are to be used when using the command.
  2728. REM =====================================================================
  2729.  
  2730.  
  2731.  
  2732. REM # =============================================================================================
  2733. REM # Documentation: XCopy [ExtCMD] software Behavior Menu
  2734. REM # =============================================================================================
  2735. :ControlPanel_XCopyParameterConfiguration
  2736. CALL :DashboardDisplay
  2737. ECHO XCopy Switches Configuration
  2738. ECHO.
  2739. ECHO Description
  2740. ECHO %SeparatorSmall%
  2741. ECHO This allows the ability for the user to customize the switches that can be utilized when a module copies data using 'XCOPY'
  2742. ECHO.
  2743. ECHO %Separator%
  2744. ECHO [1] Verify Data
  2745. ECHO     Switch: /V
  2746. ECHO     Current: %ParametersXCopy.Verify%
  2747. ECHO [2] Continue Operation regardless of Errors
  2748. ECHO     Switch: /C
  2749. ECHO     Current: %ParametersXCopy.Continue%
  2750. ECHO [3] Files encrypted stays encrypted (even if destination does not allow it)
  2751. ECHO     Switch: /G
  2752. ECHO     Current: %ParametersXCopy.Encrypt%
  2753. ECHO [4] Suppress Overwrite Messages
  2754. ECHO     Switch: /Y
  2755. ECHO     Current: %ParametersXCopy.Suppress%
  2756. ECHO [5] Network Restart Mode
  2757. ECHO     Switch: /Z
  2758. ECHO     Current: %ParametersXCopy.Restart%
  2759. ECHO.
  2760. ECHO Other Options
  2761. ECHO %SeparatorSmall%
  2762. ECHO [X] Cancel
  2763. CALL :UserInput
  2764. GOTO :ControlPanel_XCopyParameterConfiguration_UserInput
  2765.  
  2766.  
  2767.  
  2768. REM # =============================================================================================
  2769. REM # Documentation: Inspect the users input
  2770. REM # =============================================================================================
  2771. :ControlPanel_XCopyParameterConfiguration_UserInput
  2772. IF /I "%STDIN%" EQU "X" GOTO :EOF
  2773. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  2774. REM The idea here is to change the initial value and then build the entire XCopyArg
  2775. IF "%STDIN%" EQU "1" (
  2776.     CALL :ControlPanel_XCopyParameterConfiguration_Toggle_Verify
  2777.     CALL :ControlPanel_XCopyParameterConfiguration_Builder
  2778.     CALL :ControlPanel_XCopyParameterConfiguration_CopyArgUpdate
  2779.     CALL :ClearBuffer 1
  2780.     GOTO :ControlPanel_XCopyParameterConfiguration
  2781. )
  2782. IF "%STDIN%" EQU "2" (
  2783.     CALL :ControlPanel_XCopyParameterConfiguration_Toggle_Continue
  2784.     CALL :ControlPanel_XCopyParameterConfiguration_Builder
  2785.     CALL :ControlPanel_XCopyParameterConfiguration_CopyArgUpdate
  2786.     CALL :ClearBuffer 1
  2787.     GOTO :ControlPanel_XCopyParameterConfiguration
  2788. )
  2789. IF "%STDIN%" EQU "3" (
  2790.     CALL :ControlPanel_XCopyParameterConfiguration_Toggle_Encrypt
  2791.     CALL :ControlPanel_XCopyParameterConfiguration_Builder
  2792.     CALL :ControlPanel_XCopyParameterConfiguration_CopyArgUpdate
  2793.     CALL :ClearBuffer 1
  2794.     GOTO :ControlPanel_XCopyParameterConfiguration
  2795. )
  2796. IF "%STDIN%" EQU "4" (
  2797.     CALL :ControlPanel_XCopyParameterConfiguration_Toggle_Suppress
  2798.     CALL :ControlPanel_XCopyParameterConfiguration_Builder
  2799.     CALL :ControlPanel_XCopyParameterConfiguration_CopyArgUpdate
  2800.     CALL :ClearBuffer 1
  2801.     GOTO :ControlPanel_XCopyParameterConfiguration
  2802. )
  2803. IF "%STDIN%" EQU "5" (
  2804.     CALL :ControlPanel_XCopyParameterConfiguration_Toggle_Restart
  2805.     CALL :ControlPanel_XCopyParameterConfiguration_Builder
  2806.     CALL :ControlPanel_XCopyParameterConfiguration_CopyArgUpdate
  2807.     CALL :ClearBuffer 1
  2808.     GOTO :ControlPanel_XCopyParameterConfiguration
  2809. )
  2810. CALL :BadInput& GOTO :ControlPanel_XCopyParameterConfiguration
  2811.  
  2812.  
  2813.  
  2814. REM # =============================================================================================
  2815. REM # Documentation: This function toggles the value to enable or disable Continue
  2816. REM # =============================================================================================
  2817. :ControlPanel_XCopyParameterConfiguration_Toggle_Continue
  2818. IF %ParametersXCopy.Continue% EQU True (
  2819.     SET ParametersXCopy.Continue=False
  2820. ) ELSE (
  2821.     SET ParametersXCopy.Continue=True
  2822. )
  2823. GOTO :EOF
  2824.  
  2825.  
  2826.  
  2827. REM # =============================================================================================
  2828. REM # Documentation: This function toggles the value to enable or disable Encryption to destination
  2829. REM # =============================================================================================
  2830. :ControlPanel_XCopyParameterConfiguration_Toggle_Encrypt
  2831. IF %ParametersXCopy.Encrypt% EQU True (
  2832.     SET ParametersXCopy.Encrypt=False
  2833. ) ELSE (
  2834.     SET ParametersXCopy.Encrypt=True
  2835. )
  2836. GOTO :EOF
  2837.  
  2838.  
  2839.  
  2840. REM # =============================================================================================
  2841. REM # Documentation: This function toggles the value to enable or disable Verify
  2842. REM # =============================================================================================
  2843. :ControlPanel_XCopyParameterConfiguration_Toggle_Verify
  2844. IF %ParametersXCopy.Verify% EQU True (
  2845.     SET ParametersXCopy.Verify=False
  2846. ) ELSE (
  2847.     SET ParametersXCopy.Verify=True
  2848. )
  2849. GOTO :EOF
  2850.  
  2851.  
  2852.  
  2853. REM # =============================================================================================
  2854. REM # Documentation: This function toggles the value to enable or disable Suppress Warnings
  2855. REM # =============================================================================================
  2856. :ControlPanel_XCopyParameterConfiguration_Toggle_Suppress
  2857. IF %ParametersXCopy.Suppress% EQU True (
  2858.     SET ParametersXCopy.Suppress=False
  2859. ) ELSE (
  2860.     SET ParametersXCopy.Suppress=True
  2861. )
  2862. GOTO :EOF
  2863.  
  2864.  
  2865.  
  2866. REM # =============================================================================================
  2867. REM # Documentation: This function toggles the value to enable or disable Restart
  2868. REM # =============================================================================================
  2869. :ControlPanel_XCopyParameterConfiguration_Toggle_Restart
  2870. IF %ParametersXCopy.Restart% EQU True (
  2871.     SET ParametersXCopy.Restart=False
  2872. ) ELSE (
  2873.     SET ParametersXCopy.Restart=True
  2874. )
  2875. GOTO :EOF
  2876.  
  2877.  
  2878.  
  2879. REM # =============================================================================================
  2880. REM # Documentation: Update the entire XCopyArg variable.  This works by simply taking all of the supported parameters and updates the main holder variable
  2881. REM # =============================================================================================
  2882. :ControlPanel_XCopyParameterConfiguration_Builder
  2883. REM First, clear the entire variable by uninitializing it
  2884. SET XCopyArg=
  2885. REM Build it again with the newer changes
  2886. IF %ParametersXCopy.Verify% EQU True (
  2887.     SET XCopyArg=%XCopyArg%/V
  2888. )
  2889.  
  2890. IF %ParametersXCopy.Continue% EQU True (
  2891.     SET XCopyArg=%XCopyArg%/C
  2892. )
  2893.  
  2894. IF %ParametersXCopy.Encrypt% EQU True (
  2895.     SET XCopyArg=%XCopyArg%/G
  2896. )
  2897.  
  2898. IF %ParametersXCopy.Suppress% EQU True (
  2899.     SET XCopyArg=%XCopyArg%/Y
  2900. )
  2901.  
  2902. IF %ParametersXCopy.Restart% EQU True (
  2903.     SET XCopyArg=%XCopyArg%/Z
  2904. )
  2905. GOTO :EOF
  2906.  
  2907.  
  2908.  
  2909. REM # =============================================================================================
  2910. REM # Documentation: If the user has the extCMD XCOPY as the primary mass copier, then update the CopyArg parameter.
  2911. REM # =============================================================================================
  2912. :ControlPanel_XCopyParameterConfiguration_CopyArgUpdate
  2913. IF %CopyMethod% EQU XCOPY (
  2914.     SET "CopyArg=%XCopyArg%"
  2915. )
  2916. GOTO :EOF
  2917.  
  2918.  
  2919.  
  2920.  
  2921. REM =====================================================================
  2922. REM Control Panel: Robocopy Behavior
  2923. REM ----------------------------
  2924. REM This allows the user to change the behavioral of the external command 'Robocopy'.  This section merely adjusts what parameters and switches are to be used when using the command.
  2925. REM =====================================================================
  2926.  
  2927.  
  2928.  
  2929. REM # =============================================================================================
  2930. REM # Documentation: Robocopy [ExtCMD] software Behavior Menu
  2931. REM # =============================================================================================
  2932. :ControlPanel_RoboCopyParameterConfiguration
  2933. CALL :DashboardDisplay
  2934. ECHO Robocopy Switches and Parameters Configuration
  2935. ECHO.
  2936. ECHO Description
  2937. ECHO %SeparatorSmall%
  2938. ECHO This allows the ability for the user to customize the switches that can be utilized when a module copies data using 'ROBOCOPY'
  2939. ECHO.
  2940. ECHO %Separator%
  2941. ECHO [1] Restartable Mode (backup mode if permission failure)
  2942. ECHO     Switch: /ZB
  2943. ECHO     Current: %ParametersRobocopy.RestartBackup%
  2944. ECHO [2] Disallow Deep Paths (exceeding 256 chars)
  2945. ECHO     Switch: /256
  2946. ECHO     Current: %ParametersRobocopy.RestrictDeepPaths%
  2947. ECHO [3] Exclude Junctions Pointers [RECOMMENDED: True]
  2948. ECHO     Switch: /XJ
  2949. ECHO     Current: %ParametersRobocopy.NoJunctionPoints%
  2950. ECHO [4] Verbose Details
  2951. ECHO     Switch: /V
  2952. ECHO     Current: %ParametersRobocopy.Verbose%
  2953. ECHO [5] Display Long Paths
  2954. ECHO     Switch: /FP
  2955. ECHO     Current: %ParametersRobocopy.FullPath%
  2956. ECHO [6] File Sizes are Displayed as Bytes
  2957. ECHO     Switch: /BYTES
  2958. ECHO     Current: %ParametersRobocopy.BytesFileSize%
  2959. ECHO [7] Do Not Display Progress
  2960. ECHO     Switch: /NP
  2961. ECHO     Current: %ParametersRobocopy.NoProgress%
  2962. ECHO [8] Display Estimated Time of Arrival
  2963. ECHO     Switch: /ETA
  2964. ECHO     Current: %ParametersRobocopy.ETA%
  2965. ECHO.
  2966. ECHO Other Options
  2967. ECHO %SeparatorSmall%
  2968. ECHO [MT] Multithreading
  2969. ECHO [Retry] Max of Retires
  2970. ECHO [Wait] Wait before retry
  2971. ECHO [X] Cancel
  2972. CALL :UserInput
  2973. GOTO :ControlPanel_RoboCopyParameterConfiguration_UserInput
  2974.  
  2975.  
  2976.  
  2977. REM # =============================================================================================
  2978. REM # Documentation: Inspect the users input
  2979. REM # =============================================================================================
  2980. :ControlPanel_RoboCopyParameterConfiguration_UserInput
  2981. IF /I "%STDIN%" EQU "X" GOTO :EOF
  2982. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  2983. REM The idea here is to change the initial value and then build the entire RobocopyArg
  2984. IF "%STDIN%" EQU "1" (
  2985.     CALL :ControlPanel_RoboCopyParameterConfiguration_Toggle_RestartBackup
  2986.     CALL :ControlPanel_RoboCopyParameterConfiguration_Builder
  2987.     CALL :ControlPanel_RoboCopyParameterConfiguration_CopyArgUpdate
  2988.     CALL :ClearBuffer 1
  2989.     GOTO :ControlPanel_RoboCopyParameterConfiguration
  2990. )
  2991. IF "%STDIN%" EQU "2" (
  2992.     CALL :ControlPanel_RoboCopyParameterConfiguration_Toggle_RestrictDeepPaths
  2993.     CALL :ControlPanel_RoboCopyParameterConfiguration_Builder
  2994.     CALL :ControlPanel_RoboCopyParameterConfiguration_CopyArgUpdate
  2995.     CALL :ClearBuffer 1
  2996.     GOTO :ControlPanel_RoboCopyParameterConfiguration
  2997. )
  2998. IF "%STDIN%" EQU "3" (
  2999.     CALL :ControlPanel_RoboCopyParameterConfiguration_Toggle_NoJunctionPoints
  3000.     CALL :ControlPanel_RoboCopyParameterConfiguration_Builder
  3001.     CALL :ControlPanel_RoboCopyParameterConfiguration_CopyArgUpdate
  3002.     CALL :ClearBuffer 1
  3003.     GOTO :ControlPanel_RoboCopyParameterConfiguration
  3004. )
  3005. IF "%STDIN%" EQU "4" (
  3006.     CALL :ControlPanel_RoboCopyParameterConfiguration_Toggle_Verbose
  3007.     CALL :ControlPanel_RoboCopyParameterConfiguration_Builder
  3008.     CALL :ControlPanel_RoboCopyParameterConfiguration_CopyArgUpdate
  3009.     CALL :ClearBuffer 1
  3010.     GOTO :ControlPanel_RoboCopyParameterConfiguration
  3011. )
  3012. IF "%STDIN%" EQU "5" (
  3013.     CALL :ControlPanel_RoboCopyParameterConfiguration_Toggle_FullPath
  3014.     CALL :ControlPanel_RoboCopyParameterConfiguration_Builder
  3015.     CALL :ControlPanel_RoboCopyParameterConfiguration_CopyArgUpdate
  3016.     CALL :ClearBuffer 1
  3017.     GOTO :ControlPanel_RoboCopyParameterConfiguration
  3018. )
  3019. IF "%STDIN%" EQU "6" (
  3020.     CALL :ControlPanel_RoboCopyParameterConfiguration_Toggle_BytesFileSize
  3021.     CALL :ControlPanel_RoboCopyParameterConfiguration_Builder
  3022.     CALL :ControlPanel_RoboCopyParameterConfiguration_CopyArgUpdate
  3023.     CALL :ClearBuffer 1
  3024.     GOTO :ControlPanel_RoboCopyParameterConfiguration
  3025. )
  3026. IF "%STDIN%" EQU "7" (
  3027.     CALL :ControlPanel_RoboCopyParameterConfiguration_Toggle_NoProgress
  3028.     CALL :ControlPanel_RoboCopyParameterConfiguration_Builder
  3029.     CALL :ControlPanel_RoboCopyParameterConfiguration_CopyArgUpdate
  3030.     CALL :ClearBuffer 1
  3031.     GOTO :ControlPanel_RoboCopyParameterConfiguration
  3032. )
  3033. IF "%STDIN%" EQU "8" (
  3034.     CALL :ControlPanel_RoboCopyParameterConfiguration_Toggle_ETA
  3035.     CALL :ControlPanel_RoboCopyParameterConfiguration_Builder
  3036.     CALL :ControlPanel_RoboCopyParameterConfiguration_CopyArgUpdate
  3037.     CALL :ClearBuffer 1
  3038.     GOTO :ControlPanel_RoboCopyParameterConfiguration
  3039. )
  3040. IF /I "%STDIN%" EQU "Retry" (
  3041.     CALL :ClearBuffer 1
  3042.     CALL :ControlPanel_RoboCopyParameterConfiguration_Retry
  3043.     CALL :ControlPanel_RoboCopyParameterConfiguration_Builder
  3044.     CALL :ControlPanel_RoboCopyParameterConfiguration_CopyArgUpdate
  3045.     CALL :ClearBuffer 1
  3046.     GOTO :ControlPanel_RoboCopyParameterConfiguration
  3047. )
  3048. IF /I "%STDIN%" EQU "Wait" (
  3049.     CALL :ClearBuffer 1
  3050.     CALL :ControlPanel_RoboCopyParameterConfiguration_Wait
  3051.     CALL :ControlPanel_RoboCopyParameterConfiguration_Builder
  3052.     CALL :ControlPanel_RoboCopyParameterConfiguration_CopyArgUpdate
  3053.     CALL :ClearBuffer 1
  3054.     GOTO :ControlPanel_RoboCopyParameterConfiguration
  3055. )
  3056. IF /I "%STDIN%" EQU "MT" (
  3057.     CALL :ClearBuffer 1
  3058.     CALL :ControlPanel_RoboCopyParameterConfiguration_Multithreading
  3059.     CALL :ControlPanel_RoboCopyParameterConfiguration_Builder
  3060.     CALL :ControlPanel_RoboCopyParameterConfiguration_CopyArgUpdate
  3061.     CALL :ClearBuffer 1
  3062.     GOTO :ControlPanel_RoboCopyParameterConfiguration
  3063. )
  3064. CALL :BadInput& GOTO :ControlPanel_RoboCopyParameterConfiguration
  3065.  
  3066.  
  3067.  
  3068. REM # =============================================================================================
  3069. REM # Documentation: This function toggles the value to enable or disable Network Restartable Mode (use Backup Mode if permission failure)
  3070. REM # =============================================================================================
  3071. :ControlPanel_RoboCopyParameterConfiguration_Toggle_RestartBackup
  3072. IF %ParametersRobocopy.RestartBackup% EQU True (
  3073.     SET ParametersRobocopy.RestartBackup=False
  3074. ) ELSE (
  3075.     SET ParametersRobocopy.RestartBackup=True
  3076. )
  3077. GOTO :EOF
  3078.  
  3079.  
  3080.  
  3081. REM # =============================================================================================
  3082. REM # Documentation: This function toggles the value to enable or disable deep paths
  3083. REM # =============================================================================================
  3084. :ControlPanel_RoboCopyParameterConfiguration_Toggle_RestrictDeepPaths
  3085. IF %ParametersRobocopy.RestrictDeepPaths% EQU True (
  3086.     SET ParametersRobocopy.RestrictDeepPaths=False
  3087. ) ELSE (
  3088.     SET ParametersRobocopy.RestrictDeepPaths=True
  3089. )
  3090. GOTO :EOF
  3091.  
  3092.  
  3093.  
  3094. REM # =============================================================================================
  3095. REM # Documentation: This function toggles the value to enable or disable Follow Junction Pointers (RECOMMEND TO DISABLE THIS!)
  3096. REM # =============================================================================================
  3097. :ControlPanel_RoboCopyParameterConfiguration_Toggle_NoJunctionPoints
  3098. IF %ParametersRobocopy.NoJunctionPoints% EQU True (
  3099.     SET ParametersRobocopy.NoJunctionPoints=False
  3100. ) ELSE (
  3101.     SET ParametersRobocopy.NoJunctionPoints=True
  3102. )
  3103. GOTO :EOF
  3104.  
  3105.  
  3106.  
  3107. REM # =============================================================================================
  3108. REM # Documentation: This function toggles the value to enable or disable Verbose messages
  3109. REM # =============================================================================================
  3110. :ControlPanel_RoboCopyParameterConfiguration_Toggle_Verbose
  3111. IF %ParametersRobocopy.Verbose% EQU True (
  3112.     SET ParametersRobocopy.Verbose=False
  3113. ) ELSE (
  3114.     SET ParametersRobocopy.Verbose=True
  3115. )
  3116. GOTO :EOF
  3117.  
  3118.  
  3119.  
  3120. REM # =============================================================================================
  3121. REM # Documentation: This function toggles the value to enable or disable displaying long file paths
  3122. REM # =============================================================================================
  3123. :ControlPanel_RoboCopyParameterConfiguration_Toggle_FullPath
  3124. IF %ParametersRobocopy.FullPath% EQU True (
  3125.     SET ParametersRobocopy.FullPath=False
  3126. ) ELSE (
  3127.     SET ParametersRobocopy.FullPath=True
  3128. )
  3129. GOTO :EOF
  3130.  
  3131.  
  3132.  
  3133. REM # =============================================================================================
  3134. REM # Documentation: This function toggles the value to enable or disable displaying filesize in bytes
  3135. REM # =============================================================================================
  3136. :ControlPanel_RoboCopyParameterConfiguration_Toggle_BytesFileSize
  3137. IF %ParametersRobocopy.BytesFileSize% EQU True (
  3138.     SET ParametersRobocopy.BytesFileSize=False
  3139. ) ELSE (
  3140.     SET ParametersRobocopy.BytesFileSize=True
  3141. )
  3142. GOTO :EOF
  3143.  
  3144.  
  3145.  
  3146. REM # =============================================================================================
  3147. REM # Documentation: This function toggles the value to enable or disable displaying Display Progress
  3148. REM # =============================================================================================
  3149. :ControlPanel_RoboCopyParameterConfiguration_Toggle_NoProgress
  3150. IF %ParametersRobocopy.NoProgress% EQU True (
  3151.     SET ParametersRobocopy.NoProgress=False
  3152. ) ELSE (
  3153.     SET ParametersRobocopy.NoProgress=True
  3154. )
  3155. GOTO :EOF
  3156.  
  3157.  
  3158.  
  3159. REM # =============================================================================================
  3160. REM # Documentation: This function toggles the value to enable or disable displaying Estimated Time of Arrival
  3161. REM # =============================================================================================
  3162. :ControlPanel_RoboCopyParameterConfiguration_Toggle_ETA
  3163. IF %ParametersRobocopy.ETA% EQU True (
  3164.     SET ParametersRobocopy.ETA=False
  3165. ) ELSE (
  3166.     SET ParametersRobocopy.ETA=True
  3167. )
  3168. GOTO :EOF
  3169.  
  3170.  
  3171.  
  3172. REM # =============================================================================================
  3173. REM # Documentation: Update the entire RobocopyArg variable.  This works by simply taking all of the supported parameters and updates the main holder variable
  3174. REM # =============================================================================================
  3175. :ControlPanel_RoboCopyParameterConfiguration_Builder
  3176. REM First, clear the entire variable by uninitializing it
  3177. SET RobocopyArg=
  3178. REM Build it again with the newer changes
  3179. IF %ParametersRobocopy.RestartBackup% EQU True (
  3180.     SET RobocopyArg=%RobocopyArg%/ZB
  3181. )
  3182.  
  3183. IF %ParametersRobocopy.RestrictDeepPaths% EQU True (
  3184.     SET RobocopyArg=%RobocopyArg%/256
  3185. )
  3186.  
  3187. IF %ParametersRobocopy.NoJunctionPoints% EQU True (
  3188.     SET RobocopyArg=%RobocopyArg%/XJ
  3189. )
  3190.  
  3191. IF %ParametersRobocopy.Verbose% EQU True (
  3192.     SET RobocopyArg=%RobocopyArg%/V
  3193. )
  3194.  
  3195. IF %ParametersRobocopy.FullPath% EQU True (
  3196.     SET RobocopyArg=%RobocopyArg%/FP
  3197. )
  3198.  
  3199. IF %ParametersRobocopy.BytesFileSize% EQU True (
  3200.     SET RobocopyArg=%RobocopyArg%/BYTES
  3201. )
  3202.  
  3203. IF %ParametersRobocopy.NoProgress% EQU True (
  3204.     SET RobocopyArg=%RobocopyArg%/NP
  3205. )
  3206.  
  3207. IF %ParametersRobocopy.ETA% EQU True (
  3208.     SET RobocopyArg=%RobocopyArg%/ETA
  3209. )
  3210.  
  3211. REM Statics; always true but values changes
  3212. REM ----
  3213. REM Maximum Number of Retries for each individual file failure
  3214. SET RobocopyArg=%RobocopyArg%/R:%ParametersRobocopy.Retry%
  3215. REM Maximum Numer of Retry Waits
  3216. SET RobocopyArg=%RobocopyArg%/W:%ParametersRobocopy.Wait%
  3217. REM Multithreading
  3218. SET RobocopyArg=%RobocopyArg%/MT:%ParametersRobocopy.Multithread%
  3219. REM ----
  3220. GOTO :EOF
  3221.  
  3222.  
  3223.  
  3224. REM # =============================================================================================
  3225. REM # Documentation: If the user has the extCMD Robocopy as the primary mass copier, then update the CopyArg parameter.
  3226. REM # =============================================================================================
  3227. :ControlPanel_RoboCopyParameterConfiguration_CopyArgUpdate
  3228. IF %CopyMethod% EQU ROBOCOPY (
  3229.     SET "CopyArg=%RobocopyArg%"
  3230. )
  3231. GOTO :EOF
  3232.  
  3233.  
  3234.  
  3235.  
  3236. REM =====================================================================
  3237. REM Control Panel: Robocopy Behavior [Extended]
  3238. REM ----------------------------
  3239. REM This allows the user to change the behavioral of the external command 'Robocopy'.  This section merely adjusts special parameters and switches are to be used when using the command.
  3240. REM =====================================================================
  3241.  
  3242.  
  3243.  
  3244. REM # =============================================================================================
  3245. REM # Documentation: Maximum Wait time (seconds) before retrying
  3246. REM # =============================================================================================
  3247. :ControlPanel_RoboCopyParameterConfiguration_Wait
  3248. CALL :DashboardDisplay
  3249. ECHO Robocopy Wait Time
  3250. ECHO.
  3251. ECHO Description
  3252. ECHO %SeparatorSmall%
  3253. ECHO Wait time between failed retries
  3254. ECHO.
  3255. ECHO %Separator%
  3256. ECHO Enter a new value in terms of seconds of how long it should take to retry processing the requested data file.
  3257. ECHO Current Value: %ParametersRobocopy.Wait%
  3258. ECHO.
  3259. ECHO Other Options
  3260. ECHO %SeparatorSmall%
  3261. ECHO [X] Cancel
  3262. CALL :UserInput
  3263. GOTO :ControlPanel_RoboCopyParameterConfiguration_Wait_UserInput
  3264.  
  3265.  
  3266.  
  3267. REM # =============================================================================================
  3268. REM # Documentation: Inspect the users input
  3269. REM # =============================================================================================
  3270. :ControlPanel_RoboCopyParameterConfiguration_Wait_UserInput
  3271. IF /I "%STDIN%" EQU "X" GOTO :EOF
  3272. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  3273. REM ----
  3274. REM Make sure that the users input is a legal integer
  3275. ECHO %STDIN%|FINDSTR /R /C:"^[0-9][0-9]*$" > NUL || (CALL :BadInput& GOTO :ControlPanel_RoboCopyParameterConfiguration_Wait)
  3276. REM Set the value if it passed
  3277. SET ParametersRobocopy.Wait=%STDIN%
  3278. GOTO :EOF
  3279.  
  3280.  
  3281.  
  3282. REM =============================================================================
  3283. REM =============================================================================
  3284. REM -----------------------------------------------------------------------------
  3285. REM =============================================================================
  3286. REM =============================================================================
  3287.  
  3288.  
  3289.  
  3290. REM # =============================================================================================
  3291. REM # Documentation: Maximum number of retries for each individual file
  3292. REM # =============================================================================================
  3293. :ControlPanel_RoboCopyParameterConfiguration_Retry
  3294. CALL :DashboardDisplay
  3295. ECHO Robocopy Maximum Retries
  3296. ECHO.
  3297. ECHO Description
  3298. ECHO %SeparatorSmall%
  3299. ECHO Number of Retries on failed copies.
  3300. ECHO.
  3301. ECHO %Separator%
  3302. ECHO Enter a new value of how many times Robocopy should retry to process the requested file before skipping it.
  3303. ECHO Current Value: %ParametersRobocopy.Retry%
  3304. ECHO.
  3305. ECHO Other Options
  3306. ECHO %SeparatorSmall%
  3307. ECHO [X] Cancel
  3308. CALL :UserInput
  3309. GOTO :ControlPanel_RoboCopyParameterConfiguration_Retry_UserInput
  3310.  
  3311.  
  3312.  
  3313. REM # =============================================================================================
  3314. REM # Documentation: Inspect the users input
  3315. REM # =============================================================================================
  3316. :ControlPanel_RoboCopyParameterConfiguration_Retry_UserInput
  3317. IF /I "%STDIN%" EQU "X" GOTO :EOF
  3318. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  3319. REM ----
  3320. REM Make sure that the users input is a legal integer
  3321. ECHO %STDIN%|FINDSTR /R /C:"^[0-9][0-9]*$" > NUL || (CALL :BadInput& GOTO :ControlPanel_RoboCopyParameterConfiguration_Retry)
  3322. REM Set the value if it passed
  3323. SET ParametersRobocopy.Retry=%STDIN%
  3324. GOTO :EOF
  3325.  
  3326.  
  3327.  
  3328. REM =============================================================================
  3329. REM =============================================================================
  3330. REM -----------------------------------------------------------------------------
  3331. REM =============================================================================
  3332. REM =============================================================================
  3333.  
  3334.  
  3335.  
  3336. REM # =============================================================================================
  3337. REM # Documentation: How many threads should Robocopy process
  3338. REM # =============================================================================================
  3339. :ControlPanel_RoboCopyParameterConfiguration_Multithreading
  3340. CALL :DashboardDisplay
  3341. ECHO Robocopy Multithreading
  3342. ECHO.
  3343. ECHO Description
  3344. ECHO %SeparatorSmall%
  3345. ECHO Do multi-threaded copies with a number of [1-128] threads
  3346. ECHO.
  3347. ECHO %Separator%
  3348. ECHO Enter a new value of how many threads Robocopy should process [1 through 128 threads possible]
  3349. ECHO Current Value: %ParametersRobocopy.Multithread%
  3350. ECHO.
  3351. ECHO Other Options
  3352. ECHO %SeparatorSmall%
  3353. ECHO [X] Cancel
  3354. CALL :UserInput
  3355. GOTO :ControlPanel_RoboCopyParameterConfiguration_Multithreading_UserInput
  3356.  
  3357.  
  3358.  
  3359. REM # =============================================================================================
  3360. REM # Documentation: Inspect the users input
  3361. REM # =============================================================================================
  3362. :ControlPanel_RoboCopyParameterConfiguration_Multithreading_UserInput
  3363. IF /I "%STDIN%" EQU "X" GOTO :EOF
  3364. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  3365. REM ----
  3366. REM Make sure that the users input is a legal integer
  3367. ECHO %STDIN%|FINDSTR /R /C:"^[0-9][0-9]*$" > NUL || (CALL :BadInput& GOTO :ControlPanel_RoboCopyParameterConfiguration_Multithreading)
  3368. REM ----
  3369. REM Make sure that the users input is a legal integer [1 -> 128]
  3370. IF %STDIN% GEQ 1 (
  3371.     IF %STDIN% LEQ 128 SET ParametersRobocopy.Multithread=%STDIN%& GOTO :EOF
  3372. )
  3373. CALL :BadInput& GOTO :ControlPanel_RoboCopyParameterConfiguration_Multithreading
  3374.  
  3375.  
  3376.  
  3377. REM # =============================================================================================
  3378. REM # Documentation: Update the ParametersRobocopy.Multithread variable.  This could have been done in the UserInput function, however to make things easier on myself [with how well nested conditional statements works in Batch Shell], lets just update the value here and properly process it through without mistakenly hitting a few bumps.
  3379. REM # =============================================================================================
  3380. :ControlPanel_RoboCopyParameterConfiguration_Multithreading_Update
  3381. SET ParametersRobocopy.Multithread=%STDIN%
  3382. GOTO :EOF
  3383.  
  3384.  
  3385.  
  3386.  
  3387. REM =====================================================================
  3388. REM Control Panel: Terminal Sounds
  3389. REM ----------------------------
  3390. REM Within the terminal, it is possible to have a bell [or alarm] signal.  This feature gives the ability to send an alarm to the user if an event happens.  Modules _may_ treat this differently, this is not core specific but module specific.
  3391. REM =====================================================================
  3392.  
  3393.  
  3394. REM # =============================================================================================
  3395. REM # Documentation: This function is a translator which takes the variable's value and stores a nicer value name to a temporary working variable.
  3396. REM # =============================================================================================
  3397. :ControlPanel_TerminalSound_Translator
  3398. IF %UseBell% EQU 0 SET ProcessVarA=Disabled& GOTO :EOF
  3399. IF %UseBell% EQU 1 SET ProcessVarA=Enabled [Notify for all notifications]& GOTO :EOF
  3400. IF %UseBell% EQU 2 SET ProcessVarA=Enabled [Notify only for errors]
  3401. GOTO :EOF
  3402.  
  3403.  
  3404.  
  3405. REM # =============================================================================================
  3406. REM # Documentation: Terminal sound menu
  3407. REM # =============================================================================================
  3408. :ControlPanel_TerminalSound
  3409. CALL :DashboardDisplay
  3410. REM Translate the actual variable value into another variable with a nicer value.
  3411. CALL :ControlPanel_TerminalSound_Translator
  3412. ECHO Terminal Sound Settings
  3413. ECHO.
  3414. ECHO Description
  3415. ECHO %SeparatorSmall%
  3416. ECHO When the program runs into a critical state or an event occurs, this program can alarm the user by supplying a 'Beep' noise.  These notifications, however, can only be played through the system's speakers and not the internal PC Speaker.
  3417. ECHO.
  3418. ECHO Default Value: Sounds for either successful or failed operations
  3419. ECHO Sounds is currently: %ProcessVarA%
  3420. ECHO %Separator%
  3421. ECHO Notify when:
  3422. ECHO [1] Notify for all notifications
  3423. ECHO [2] Notify only for errors
  3424. ECHO [3] Disabled
  3425. ECHO.
  3426. ECHO Other Options
  3427. ECHO %SeparatorSmall%
  3428. ECHO [X] Cancel
  3429. CALL :UserInput
  3430. GOTO :ControlPanel_TerminalSound_UserInput
  3431.  
  3432.  
  3433.  
  3434. REM # =============================================================================================
  3435. REM # Documentation: Inspect the users input
  3436. REM # =============================================================================================
  3437. :ControlPanel_TerminalSound_UserInput
  3438. IF /I "%STDIN%" EQU "X" GOTO :EOF
  3439. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  3440.  
  3441. IF "%STDIN%" EQU "1" (
  3442.     CALL :ControlPanel_TerminalSound_Toggle All
  3443.     CALL :ClearBuffer 1
  3444.     GOTO :ControlPanel_TerminalSound
  3445. )
  3446. IF "%STDIN%" EQU "2" (
  3447.     CALL :ControlPanel_TerminalSound_Toggle Error
  3448.     CALL :ClearBuffer 1
  3449.     GOTO :ControlPanel_TerminalSound
  3450. )
  3451. IF "%STDIN%" EQU "3" (
  3452.     CALL :ControlPanel_TerminalSound_Toggle Off
  3453.     CALL :ClearBuffer 1
  3454.     GOTO :ControlPanel_TerminalSound
  3455. )
  3456. CALL :BadInput& GOTO :ControlPanel_TerminalSound
  3457.  
  3458.  
  3459.  
  3460. REM # =============================================================================================
  3461. REM # Parameters: [{String} SettingType]
  3462. REM # Documentation: Adjust the variable value as requested by the user.
  3463. REM # =============================================================================================
  3464. :ControlPanel_TerminalSound_Toggle
  3465. IF %1 EQU All (
  3466.    REM Always send an alarm when an event happens
  3467.     SET UseBell=1
  3468.     GOTO :EOF
  3469. )
  3470. IF %1 EQU Error (
  3471.    REM Send an alarm when an error event happens
  3472.     SET UseBell=2
  3473.     GOTO :EOF
  3474. )
  3475. IF %1 EQU Off (
  3476.    REM Disallow the entire feature.
  3477.     SET UseBell=0
  3478.     GOTO :EOF
  3479. )
  3480.  
  3481.  
  3482.  
  3483.  
  3484. REM =====================================================================
  3485. REM Control Panel: Directory Setup
  3486. REM ----------------------------
  3487. REM This section allows the user to customize the directory or file location of resources that is supported in the program.  This will allow compatible modules to easily take advantage of such resources that can be detect and supported without having to add more redundancy code or making it inconvenient to the user.
  3488. REM =====================================================================
  3489.  
  3490.  
  3491. REM # =============================================================================================
  3492. REM # Documentation: Main directory menu
  3493. REM # =============================================================================================
  3494. :ControlPanel_DirectorySetup
  3495. CALL :DashboardDisplay
  3496. REM Check see if the resources exists
  3497. CALL :EnvironmentSetup_Switch CheckExternalResources
  3498. ECHO Directory Setup
  3499. ECHO.
  3500. ECHO Description
  3501. ECHO %SeparatorSmall%
  3502. ECHO In order to compile other projects, there is in need of necessary prerequisites.  Not all of the listed tools maybe required, to be sure what you need in order to compile a project - refer to documentation.
  3503. ECHO.
  3504. ECHO Choose the following to modify:
  3505. ECHO %Separator%
  3506. ECHO [1] Microsoft Visual Studio Category
  3507. ECHO [2] Microsoft HTML Workshop
  3508. ECHO      Detected: [ %Detect_MSHTMLWorkShop% ]
  3509. ECHO [3] MinGW
  3510. ECHO      Detected: [ %Detect_MinGW% ]
  3511. ECHO [4] 7Zip
  3512. ECHO      Detected: [ %Detect_7Zip% ]
  3513. ECHO [5] Inno Setup
  3514. ECHO      Detected: [ %Detect_InnoSetup% ]
  3515. ECHO [6] Python v3.x
  3516. ECHO      Detected: [ %Detect_Python3% ]
  3517. ECHO [7] Python v2.7.x
  3518. ECHO      Detected: [ %Detect_Python2% ]
  3519. ECHO.
  3520. ECHO Other Options
  3521. ECHO %SeparatorSmall%
  3522. ECHO [X] Cancel
  3523. CALL :UserInput
  3524. GOTO :ControlPanel_DirectorySetup_UserInput
  3525.  
  3526.  
  3527.  
  3528. REM # =============================================================================================
  3529. REM # Documentation: Inspect the user's input
  3530. REM # =============================================================================================
  3531. :ControlPanel_DirectorySetup_UserInput
  3532. IF /I "%STDIN%" EQU "X" GOTO :EOF
  3533. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  3534.  
  3535. IF "%STDIN%" EQU "1" (
  3536.     CALL :ClearBuffer 1
  3537.     CALL :ControlPanel_DirectorySetup_MSVisualStudio
  3538.     CALL :ClearBuffer 1
  3539.     GOTO :ControlPanel_DirectorySetup
  3540. )
  3541. IF "%STDIN%" EQU "2" (
  3542.     CALL :ClearBuffer 1
  3543.     CALL :ControlPanel_DirectorySetup_ChangePathCommon "HTML Workshop" "%PathMSHTMLWorkShop%" "Microsoft HTML Workshop path"
  3544.     CALL :ClearBuffer 1
  3545.     GOTO :ControlPanel_DirectorySetup
  3546. )
  3547. IF "%STDIN%" EQU "3" (
  3548.     CALL :ClearBuffer 1
  3549.     CALL :ControlPanel_DirectorySetup_ChangePathCommon "MinGW" "%PathMinGW%" "MinGW path"
  3550.     CALL :ClearBuffer 1
  3551.     GOTO :ControlPanel_DirectorySetup
  3552. )
  3553. IF "%STDIN%" EQU "4" (
  3554.     CALL :ClearBuffer 1
  3555.     CALL :ControlPanel_DirectorySetup_ChangePathCommon "Seven Zip" "%Path7Zip%" "Seven Zip path"
  3556.     CALL :ClearBuffer 1
  3557.     GOTO :ControlPanel_DirectorySetup
  3558. )
  3559. IF "%STDIN%" EQU "5" (
  3560.     CALL :ClearBuffer 1
  3561.     CALL :ControlPanel_DirectorySetup_ChangePathCommon "Inno Installer" "%PathInnoSetup%" "Inno Installer path"
  3562.     CALL :ClearBuffer 1
  3563.     GOTO :ControlPanel_DirectorySetup
  3564. )
  3565. IF "%STDIN%" EQU "6" (
  3566.     CALL :ClearBuffer 1
  3567.     CALL :ControlPanel_DirectorySetup_ChangePathCommon "Python3" "%PathPython3%" "Python v3 path"
  3568.     CALL :ClearBuffer 1
  3569.     GOTO :ControlPanel_DirectorySetup
  3570. )
  3571. IF "%STDIN%" EQU "7" (
  3572.     CALL :ClearBuffer 1
  3573.     CALL :ControlPanel_DirectorySetup_ChangePathCommon "Python2" "%PathPython2%" "Python v2.7.x path"
  3574.     CALL :ClearBuffer 1
  3575.     GOTO :ControlPanel_DirectorySetup
  3576. )
  3577. CALL :BadInput& GOTO :ControlPanel_DirectorySetup
  3578.  
  3579.  
  3580.  
  3581. REM =============================================================================
  3582. REM -----------------------------------------------------------------------------
  3583. REM =============================================================================
  3584.  
  3585.  
  3586.  
  3587. REM # =============================================================================================
  3588. REM # Documentation: Microsoft Visual Studio Directory setting menu
  3589. REM # =============================================================================================
  3590. :ControlPanel_DirectorySetup_MSVisualStudio
  3591. CALL :DashboardDisplay
  3592. REM Check to see if the Microsoft Visual Studio products can be detected.
  3593. CALL :EnvironmentSetup_Switch CheckExternalResources
  3594. ECHO Directories: Microsoft Visual Studio Versions
  3595. ECHO %SeparatorSmall%
  3596. ECHO [1] Visual Studio 2005
  3597. ECHO      Detected: [ %Detect_MSVS80COMMTOOLS% ]
  3598. ECHO [2] Visual Studio 2008
  3599. ECHO      Detected: [ %Detect_MSVS90COMMTOOLS% ]
  3600. ECHO [3] Visual Studio 2010
  3601. ECHO      Detected: [ %Detect_MSVS100COMMTOOLS% ]
  3602. ECHO [4] Visual Studio 2012
  3603. ECHO      Detected: [ %Detect_MSVS110COMMTOOLS% ]
  3604. ECHO [5] Visual Studio 2013
  3605. ECHO      Detected: [ %Detect_MSVS120COMMTOOLS% ]
  3606. ECHO.
  3607. ECHO Other Options
  3608. ECHO %SeparatorSmall%
  3609. ECHO [X] Cancel
  3610. CALL :UserInput
  3611. GOTO :ControlPanel_DirectorySetup_MSVisualStudio_UserInput
  3612.  
  3613.  
  3614.  
  3615. REM # =============================================================================================
  3616. REM # Documentation: Inspect the user's input
  3617. REM # =============================================================================================
  3618. :ControlPanel_DirectorySetup_MSVisualStudio_UserInput
  3619. IF /I "%STDIN%" EQU "X" GOTO :EOF
  3620. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  3621. IF /I "%STDIN%" EQU "Exit" GOTO :EOF
  3622.  
  3623. IF "%STDIN%" EQU "1" (
  3624.     CALL :ClearBuffer 1
  3625.     CALL :ControlPanel_DirectorySetup_ChangePathCommon "Visual Studio 2005" "%PathMSVS2005%" "Microsoft Visual Studio 2005 [Common Tools] path"
  3626.     CALL :ClearBuffer 1
  3627.     GOTO :ControlPanel_DirectorySetup_MSVisualStudio
  3628. )
  3629. IF "%STDIN%" EQU "2" (
  3630.     CALL :ClearBuffer 1
  3631.     CALL :ControlPanel_DirectorySetup_ChangePathCommon "Visual Studio 2008" "%PathMSVS2008%" "Microsoft Visual Studio 2008 [Common Tools] path"
  3632.     CALL :ClearBuffer 1
  3633.     GOTO :ControlPanel_DirectorySetup_MSVisualStudio
  3634. )
  3635. IF "%STDIN%" EQU "3" (
  3636.     CALL :ClearBuffer 1
  3637.     CALL :ControlPanel_DirectorySetup_ChangePathCommon "Visual Studio 2010" "%PathMSVS2010%" "Microsoft Visual Studio 2010 [Common Tools] path"
  3638.     CALL :ClearBuffer 1
  3639.     GOTO :ControlPanel_DirectorySetup_MSVisualStudio
  3640. )
  3641. IF "%STDIN%" EQU "4" (
  3642.     CALL :ClearBuffer 1
  3643.     CALL :ControlPanel_DirectorySetup_ChangePathCommon "Visual Studio 2012" "%PathMSVS2012%" "Microsoft Visual Studio 2012 [Common Tools] path"
  3644.     CALL :ClearBuffer 1
  3645.     GOTO :ControlPanel_DirectorySetup_MSVisualStudio
  3646. )
  3647. IF "%STDIN%" EQU "5" (
  3648.     CALL :ClearBuffer 1
  3649.     CALL :ControlPanel_DirectorySetup_ChangePathCommon "Visual Studio 2013" "%PathMSVS2013%" "Microsoft Visual Studio 2013 [Common Tools] path"
  3650.     CALL :ClearBuffer 1
  3651.     GOTO :ControlPanel_DirectorySetup_MSVisualStudio
  3652. )
  3653. CALL :BadInput& GOTO :ControlPanel_DirectorySetup_MSVisualStudio
  3654.  
  3655.  
  3656.  
  3657. REM =============================================================================
  3658. REM -----------------------------------------------------------------------------
  3659. REM =============================================================================
  3660.  
  3661.  
  3662.  
  3663. REM # =============================================================================================
  3664. REM # Parameters: [{string} ProductName] [{string} FilePath] [{string} LongString]
  3665. REM # Documentation: When inputting a new file location, this function is going to be called.  This will manage all of the external resource file locations and will set the file path - only if the detection is able to locate the file or directory.
  3666. REM # =============================================================================================
  3667. :ControlPanel_DirectorySetup_ChangePathCommon
  3668. CALL :DashboardDisplay
  3669. REM Does the file location exists?
  3670. CALL :ControlPanel_DirectorySetup_Finder_Status "%~2"
  3671. CALL :ControlPanel_DirectorySetup_ChangePathCommon_FixUninitializedVariables "%~2"
  3672. ECHO Modifying: %~3
  3673. ECHO %SeparatorSmall%
  3674. ECHO Current location:
  3675. ECHO    %ProcessVarB%
  3676. ECHO Detection Status:
  3677. ECHO    %ProcessVarA%
  3678. ECHO.
  3679. CALL :ControlPanel_DirectorySetup_CommonSetupSubMenuDisplay
  3680. CALL :UserInput
  3681. REM Inspect the users input; does the file or directory exists?
  3682. CALL :ControlPanel_DirectorySetup_Finder "%~1" "%STDIN%"
  3683. REM If the user wishes to abort
  3684. IF %ERRORLEVEL% EQU 2 GOTO :EOF
  3685. IF %ERRORLEVEL% EQU 1 (
  3686.     CALL :ClearBuffer 1
  3687.     GOTO :ControlPanel_DirectorySetup_ChangePathCommon
  3688. )
  3689.     IF "%~1" EQU "Visual Studio 2005" SET "PathMSVS2005=%STDIN%"& CALL :ClearBuffer 1& GOTO :EOF
  3690.     IF "%~1" EQU "Visual Studio 2008" SET "PathMSVS2008=%STDIN%"& CALL :ClearBuffer 1& GOTO :EOF
  3691.     IF "%~1" EQU "Visual Studio 2010" SET "PathMSVS2010=%STDIN%"& CALL :ClearBuffer 1& GOTO :EOF
  3692.     IF "%~1" EQU "Visual Studio 2012" SET "PathMSVS2012=%STDIN%"& CALL :ClearBuffer 1& GOTO :EOF
  3693.     IF "%~1" EQU "Visual Studio 2013" SET "PathMSVS2013=%STDIN%"& CALL :ClearBuffer 1& GOTO :EOF
  3694.     IF "%~1" EQU "HTML Workshop" SET "PathMSHTMLWorkShop=%STDIN%"& CALL :ClearBuffer 1& GOTO :EOF
  3695.     IF "%~1" EQU "MinGW" SET "PathMinGW=%STDIN%"& CALL :ClearBuffer 1& GOTO :EOF
  3696.     IF "%~1" EQU "Seven Zip" SET "Path7Zip=%STDIN%"& CALL :ClearBuffer 1& GOTO :EOF
  3697.     IF "%~1" EQU "Inno Installer" SET "PathInnoSetup=%STDIN%"& CALL :ClearBuffer 1& GOTO :EOF
  3698.     IF "%~1" EQU "Python3" SET "PathPython3=%STDIN%"& CALL :ClearBuffer 1& GOTO :EOF
  3699.     IF "%~1" EQU "Python2" SET "PathPython2=%STDIN%"& CALL :ClearBuffer 1& GOTO :EOF
  3700.  
  3701.  
  3702.  
  3703. REM # =============================================================================================
  3704. REM # Parameters: [{string} FilePath]
  3705. REM # Documentation: If the variable is uninitialized during the initialization phase (such as not having Microsoft Visual Studio 2005 or it's environment variables), then properly display the result on the screen instead of the standalone ECHO message.
  3706. REM # =============================================================================================
  3707. :ControlPanel_DirectorySetup_ChangePathCommon_FixUninitializedVariables
  3708. REM Cache the value so we can determine if it was ever defined at all
  3709. SET "ProcessVarB=%~1"
  3710. REM Determine how the output is going to be on the screen
  3711. IF NOT DEFINED ProcessVarB (
  3712.     SET ProcessVarB=!ERROR!
  3713. )
  3714. GOTO :EOF
  3715.  
  3716.  
  3717.  
  3718. REM # =============================================================================================
  3719. REM # Parameters: [{string} ProductName] [{string} FilePath]
  3720. REM # Documentation: Inspect the users input; if the directory or file exists - then report back a success, if the file or directory does not exist - report an error.  Also manage if the user wishes to cancel or revert a setting.
  3721. REM # =============================================================================================
  3722. :ControlPanel_DirectorySetup_Finder
  3723. REM If incase the user wishes to abort
  3724. IF /I "%STDIN%" EQU "X" CALL :ClearBuffer 1& EXIT /B 2
  3725. IF /I "%STDIN%" EQU "Cancel" CALL :ClearBuffer 1& EXIT /B 2
  3726. IF /I "%STDIN%" EQU "Exit" CALL :ClearBuffer 1& EXIT /B 2
  3727. REM Allow the user to restore a variable value target to its default setting.
  3728. IF /I "%STDIN%" EQU "Restore" CALL :ControlPanel_DirectorySetup_RestoreDefauts "%~1"& EXIT /B 2
  3729.  
  3730. REM The user must specify the _exact_ file.
  3731. REM %1 = Program Name or File Name
  3732. REM %2 = Program Path Variable or STDIN
  3733. IF EXIST "%STDIN%" (
  3734.     EXIT /B 0
  3735. ) ELSE (
  3736.     ECHO.
  3737.     ECHO !ERR: Could not find the file or program ^'%~1^'
  3738.     ECHO       at location: %~2
  3739.     PAUSE
  3740.     EXIT /B 1
  3741. )
  3742.  
  3743.  
  3744.  
  3745. REM # =============================================================================================
  3746. REM # Parameters: [{string} ProductName]
  3747. REM # Documentation: This function will restore the requested target value; this specifically will call the Environment Setup to properly restore the value.
  3748. REM # =============================================================================================
  3749. :ControlPanel_DirectorySetup_RestoreDefauts
  3750. CALL :EnvironmentSetup_Switch PathRestore "%~1"
  3751. GOTO :EOF
  3752.  
  3753.  
  3754.  
  3755. REM # =============================================================================================
  3756. REM # Parameters: [{string} FilePath]
  3757. REM # Documentation: This function checks to make sure that the target actually exists.  This will only change the working variable's value that will be used to print the detection status.
  3758. REM # =============================================================================================
  3759. :ControlPanel_DirectorySetup_Finder_Status
  3760. IF EXIST "%~1" (
  3761.     SET ProcessVarA=Found!
  3762.     GOTO :EOF
  3763. ) ELSE (
  3764.     SET ProcessVarA=Not Found!
  3765.     GOTO :EOF
  3766. )
  3767.  
  3768.  
  3769.  
  3770. REM # =============================================================================================
  3771. REM # Documentation: This function merely contains the common information that is used when inputting a new file location.
  3772. REM # =============================================================================================
  3773. :ControlPanel_DirectorySetup_CommonSetupSubMenuDisplay
  3774. ECHO Other Options:
  3775. ECHO %SeparatorSmall%
  3776. ECHO [Cancel] [Restore]
  3777. ECHO.
  3778. ECHO  Notes:
  3779. ECHO   + Do NOT use quotes
  3780. ECHO       For Example, do _NOT_: "C:\Users\Admin\Travra.ps"
  3781. ECHO                              ^^                        ^^
  3782. ECHO   + Use Absolute Path
  3783. ECHO       For Example: C:^\Program Files\RequestedProgram.exe
  3784. ECHO   + Include specific filename including file extension
  3785. ECHO       For Example: ExecutableFile.exe or MyShellScript.sh
  3786. ECHO                                   ^^                   ^^
  3787. ECHO.
  3788. ECHO Enter new direct location and specific filename
  3789. GOTO :EOF
  3790.  
  3791.  
  3792.  
  3793.  
  3794. REM =====================================================================
  3795. REM Control Panel: General Program Configuration
  3796. REM ----------------------------
  3797. REM This section houses generalized program settings that the user is able to manipulate.
  3798. REM =====================================================================
  3799.  
  3800.  
  3801. REM # =============================================================================================
  3802. REM # Documentation: Advanced settings menu for General Program Configuration
  3803. REM # =============================================================================================
  3804. :ControlPanel_GeneralProgramConfiguration
  3805. CALL :DashboardDisplay
  3806. ECHO General Program Configuration Menu
  3807. ECHO.
  3808. ECHO Select the following options:
  3809. ECHO %Separator%
  3810. ECHO [1] Toggle Explorer.exe Calls
  3811. ECHO [2] General Priority
  3812. ECHO [3] Toggle Dashboard Tool
  3813. ECHO [4] Toggle Module Window Sharing
  3814. ECHO.
  3815. ECHO Other Options
  3816. ECHO %SeparatorSmall%
  3817. ECHO [X] Exit
  3818. CALL :UserInput
  3819. GOTO :ControlPanel_GeneralProgramConfiguration_UserInput
  3820.  
  3821.  
  3822.  
  3823. REM # =============================================================================================
  3824. REM # Documentation: Inspect the users input
  3825. REM # =============================================================================================
  3826. :ControlPanel_GeneralProgramConfiguration_UserInput
  3827. IF "%STDIN%" EQU "1" GOTO :ControlPanel_GeneralProgramConfiguration_Choice_WindowsExplorer
  3828. IF "%STDIN%" EQU "2" GOTO :ControlPanel_GeneralProgramConfiguration_Choice_Priority
  3829. IF "%STDIN%" EQU "3" GOTO :ControlPanel_GeneralProgramConfiguration_Choice_DashboardViewerTool
  3830. IF "%STDIN%" EQU "4" GOTO :ControlPanel_GeneralProgramConfiguration_Choice_ModuleWindowSharing
  3831. IF /I "%STDIN%" EQU "X" GOTO :EOF
  3832. IF /I "%STDIN%" EQU "Exit" GOTO :EOF
  3833. CALL :BadInput& GOTO :ControlPanel_GeneralProgramConfiguration
  3834.  
  3835.  
  3836.  
  3837. REM # =============================================================================================
  3838. REM # Documentation: Call the Windows Explorer settings.
  3839. REM # =============================================================================================
  3840. :ControlPanel_GeneralProgramConfiguration_Choice_WindowsExplorer
  3841. CALL :ClearBuffer 1
  3842. CALL :ControlPanel_WindowsExplorer
  3843. CALL :ClearBuffer 1
  3844. GOTO :ControlPanel_GeneralProgramConfiguration
  3845.  
  3846.  
  3847.  
  3848. REM # =============================================================================================
  3849. REM # Documentation:  Call the Windows process priority level.
  3850. REM # =============================================================================================
  3851. :ControlPanel_GeneralProgramConfiguration_Choice_Priority
  3852. CALL :ClearBuffer 1
  3853. CALL :ControlPanel_Priority
  3854. CALL :ClearBuffer 1
  3855. GOTO :ControlPanel_GeneralProgramConfiguration
  3856.  
  3857.  
  3858.  
  3859. REM # =============================================================================================
  3860. REM # Documentation: Enable or disable the Dashboard Viewer tool.
  3861. REM # =============================================================================================
  3862. :ControlPanel_GeneralProgramConfiguration_Choice_DashboardViewerTool
  3863. CALL :ClearBuffer 1
  3864. CALL :ControlPanel_DashboardTool
  3865. CALL :ClearBuffer 1
  3866. GOTO :ControlPanel_GeneralProgramConfiguration
  3867.  
  3868.  
  3869.  
  3870. REM # =============================================================================================
  3871. REM # Documentation: Enable or disable the modules being executed in the same window as the core.
  3872. REM # =============================================================================================
  3873. :ControlPanel_GeneralProgramConfiguration_Choice_ModuleWindowSharing
  3874. CALL :ClearBuffer 1
  3875. CALL :ControlPanel_ModuleExecuteSharingWindow
  3876. CALL :ClearBuffer 1
  3877. GOTO :ControlPanel_GeneralProgramConfiguration
  3878.  
  3879.  
  3880.  
  3881.  
  3882. REM =====================================================================
  3883. REM Control Panel: Windows Explorer
  3884. REM ----------------------------
  3885. REM This section allows the user to allow or disallow the programs to utilize the Windows Explorer functionality.  This ultimately can be used to open new windows into environment and also can highlight objects within a new window.
  3886. REM =====================================================================
  3887.  
  3888.  
  3889. REM # =============================================================================================
  3890. REM # Documentation: This function is a translator which takes the variable's value and stores a nicer value name to a temporary working variable.
  3891. REM # =============================================================================================
  3892. :ControlPanel_WindowsExplorer_Translator
  3893. IF %CallExplorerCommands% EQU True SET ProcessVarA=Enable& GOTO :EOF
  3894. IF %CallExplorerCommands% EQU False SET ProcessVarA=Disable
  3895. GOTO :EOF
  3896.  
  3897.  
  3898.  
  3899. REM # =============================================================================================
  3900. REM # Documentation: Explorer menu
  3901. REM # =============================================================================================
  3902. :ControlPanel_WindowsExplorer
  3903. CALL :DashboardDisplay
  3904. REM Translate the actual variable value into another variable with a nicer value.
  3905. CALL :ControlPanel_WindowsExplorer_Translator
  3906. ECHO Windows Explorer Settings
  3907. ECHO.
  3908. ECHO Description
  3909. ECHO %SeparatorSmall%
  3910. ECHO For certain operations or events, this program might call on Windows 'explorer.exe' for certain operations.  Most simply, in terms of operations could be, opening a new window focus, highlighting objects, and small various tasks.
  3911. ECHO.
  3912. ECHO Default Value: Enable
  3913. ECHO Calling Explorer is Currently: %ProcessVarA%
  3914. ECHO %Separator%
  3915. ECHO [1] Disable
  3916. ECHO [2] Enable
  3917. ECHO.
  3918. ECHO Other Options
  3919. ECHO %SeparatorSmall%
  3920. ECHO [X] Cancel
  3921. CALL :UserInput
  3922. GOTO :ControlPanel_WindowsExplorer_UserInput
  3923.  
  3924.  
  3925.  
  3926. REM # =============================================================================================
  3927. REM # Documentation: Inspect the users input
  3928. REM # =============================================================================================
  3929. :ControlPanel_WindowsExplorer_UserInput
  3930. IF /I "%STDIN%" EQU "X" GOTO :EOF
  3931. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  3932.  
  3933. IF "%STDIN%" EQU "1" (
  3934.     CALL :ControlPanel_WindowsExplorer_Toggle Disable
  3935.     CALL :ClearBuffer 1
  3936.     GOTO :ControlPanel_WindowsExplorer
  3937. )
  3938. IF "%STDIN%" EQU "2" (
  3939.     CALL :ControlPanel_WindowsExplorer_Toggle Enable
  3940.     CALL :ClearBuffer 1
  3941.     GOTO :ControlPanel_WindowsExplorer
  3942. )
  3943. CALL :BadInput& GOTO :ControlPanel_WindowsExplorer
  3944.  
  3945.  
  3946.  
  3947. REM # =============================================================================================
  3948. REM # Parameters: [{Bool} SettingType]
  3949. REM # Documentation: Adjust the variable value as requested by the user.
  3950. REM # =============================================================================================
  3951. :ControlPanel_WindowsExplorer_Toggle
  3952. IF %1 EQU Enable (
  3953.     SET CallExplorerCommands=True
  3954.     GOTO :EOF
  3955. ) ELSE (
  3956.     SET CallExplorerCommands=False
  3957.     GOTO :EOF
  3958. )
  3959.  
  3960.  
  3961.  
  3962.  
  3963. REM =====================================================================
  3964. REM Control Panel: Priority Level [Kernel Throttle Request]
  3965. REM ----------------------------
  3966. REM When external commands are being processed, they are normally set through the kernel as 'Normal' priority level; however, it is possible to change that priority leveling to either a higher level or lower.
  3967. REM Refer to this documentation for more information: http://en.wikipedia.org/wiki/Scheduling_(computing)
  3968. REM For more details: http://msdn.microsoft.com/en-us/library/windows/desktop/ms685100(v=vs.85).aspx
  3969. REM =====================================================================
  3970.  
  3971.  
  3972. REM # =============================================================================================
  3973. REM # Documentation: Translate the stored value to a working variable.  This will contain a nicer value that will be displayed on the terminal screen.
  3974. REM # =============================================================================================
  3975. :ControlPanel_Priority_Translator
  3976. IF /I "%PriorityGeneral%" EQU "Low" (
  3977.     SET ProcessVarA=Low
  3978.     GOTO :EOF
  3979. )
  3980. IF /I "%PriorityGeneral%" EQU "BelowNormal" (
  3981.     SET ProcessVarA=Below Normal
  3982.     GOTO :EOF
  3983. )
  3984. IF /I "%PriorityGeneral%" EQU "Normal" (
  3985.     SET ProcessVarA=Normal
  3986.     GOTO :EOF
  3987. )
  3988. IF /I "%PriorityGeneral%" EQU "AboveNormal" (
  3989.     SET ProcessVarA=Above Normal
  3990.     GOTO :EOF
  3991. )
  3992. IF /I "%PriorityGeneral%" EQU "High" (
  3993.     SET ProcessVarA=High
  3994.     GOTO :EOF
  3995. )
  3996. IF /I "%PriorityGeneral%" EQU "RealTime" (
  3997.     SET ProcessVarA=LUDICROUS SPEED!
  3998.     GOTO :EOF
  3999. )
  4000.  
  4001.  
  4002.  
  4003. REM # =============================================================================================
  4004. REM # Documentation: Priority throttling menu
  4005. REM # =============================================================================================
  4006. :ControlPanel_Priority
  4007. CALL :DashboardDisplay
  4008. CALL :ControlPanel_Priority_Translator
  4009. ECHO Program Priority Settings
  4010. ECHO.
  4011. ECHO Description
  4012. ECHO %SeparatorSmall%
  4013. ECHO It is possible to generally enforce all operations to work either faster or slower, but however, be warned that the faster may not always be better - generally.  For more details, please read Kernel Priority documentation for Windows.
  4014. ECHO.
  4015. ECHO Default Value: Normal
  4016. ECHO Priority Level is Currently: %ProcessVarA%
  4017. ECHO %Separator%
  4018. ECHO [1] Low
  4019. ECHO [2] Below Normal
  4020. ECHO [3] Normal
  4021. ECHO [4] Above Normal
  4022. ECHO [5] High
  4023. ECHO [6] LUDICROUS SPEED!
  4024. ECHO.
  4025. ECHO Other Options
  4026. ECHO %SeparatorSmall%
  4027. ECHO [X] Cancel
  4028. CALL :UserInput
  4029. GOTO :ControlPanel_Priority_UserInput
  4030.  
  4031.  
  4032.  
  4033. REM # =============================================================================================
  4034. REM # Documentation: Inspect the users input
  4035. REM # =============================================================================================
  4036. :ControlPanel_Priority_UserInput
  4037. IF /I "%STDIN%" EQU "X" GOTO :EOF
  4038. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  4039.  
  4040. IF "%STDIN%" EQU "1" (
  4041.     CALL :ControlPanel_Priority_Switch Low
  4042.     CALL :ClearBuffer 1
  4043.     GOTO :ControlPanel_Priority
  4044. )
  4045. IF "%STDIN%" EQU "2" (
  4046.     CALL :ControlPanel_Priority_Switch BelowNormal
  4047.     CALL :ClearBuffer 1
  4048.     GOTO :ControlPanel_Priority
  4049. )
  4050. IF "%STDIN%" EQU "3" (
  4051.     CALL :ControlPanel_Priority_Switch Normal
  4052.     CALL :ClearBuffer 1
  4053.     GOTO :ControlPanel_Priority
  4054. )
  4055. IF "%STDIN%" EQU "4" (
  4056.     CALL :ControlPanel_Priority_Switch AboveNormal
  4057.     CALL :ClearBuffer 1
  4058.     GOTO :ControlPanel_Priority
  4059. )
  4060. IF "%STDIN%" EQU "5" (
  4061.     CALL :ControlPanel_Priority_Switch High
  4062.     CALL :ClearBuffer 1
  4063.     GOTO :ControlPanel_Priority
  4064. )
  4065. IF "%STDIN%" EQU "6" (
  4066.     CALL :ControlPanel_Priority_Switch RealTime
  4067.     CALL :ClearBuffer 1
  4068.     GOTO :ControlPanel_Priority
  4069. )
  4070. CALL :BadInput& GOTO :ControlPanel_Priority
  4071.  
  4072.  
  4073.  
  4074. REM # =============================================================================================
  4075. REM # Parameters: [{String} SettingType]
  4076. REM # Documentation: Adjust the variable value as requested by the user.
  4077. REM # =============================================================================================
  4078. :ControlPanel_Priority_Switch
  4079. IF %1 EQU Low (
  4080.     SET PriorityGeneral=LOW
  4081.     GOTO :EOF
  4082. )
  4083. IF %1 EQU BelowNormal (
  4084.     SET PriorityGeneral=BELOWNORMAL
  4085.     GOTO :EOF
  4086. )
  4087. IF %1 EQU Normal (
  4088.     SET PriorityGeneral=NORMAL
  4089.     GOTO :EOF
  4090. )
  4091. IF %1 EQU AboveNormal (
  4092.     SET PriorityGeneral=ABOVENORMAL
  4093.     GOTO :EOF
  4094. )
  4095. IF %1 EQU High (
  4096.     SET PriorityGeneral=HIGH
  4097.     GOTO :EOF
  4098. )
  4099. IF %1 EQU RealTime (
  4100.     SET PriorityGeneral=REALTIME
  4101.     GOTO :EOF
  4102. )
  4103.  
  4104.  
  4105.  
  4106.  
  4107. REM =====================================================================
  4108. REM Control Panel: 7Zip Generalized Settings
  4109. REM ----------------------------
  4110. REM Within this section houses all of the 7Zip settings.
  4111. REM =====================================================================
  4112.  
  4113.  
  4114. REM # =============================================================================================
  4115. REM # Documentation: Translate the stored value to a working variable.  This will contain a nicer value that will be displayed on the terminal screen.
  4116. REM # =============================================================================================
  4117. :ControlPanel_7Zip_Password_Translator
  4118. IF "%SevZipKey%" EQU "" (
  4119.     SET ProcessVarA=Not Set!
  4120.     GOTO :EOF
  4121. ) ELSE (
  4122.     SET ProcessVarA=Set!
  4123.     GOTO :EOF
  4124. )
  4125.  
  4126.  
  4127.  
  4128. REM # =============================================================================================
  4129. REM # Documentation: This function is the main password setting menu.
  4130. REM # =============================================================================================
  4131. :ControlPanel_7Zip_Password
  4132. CALL :DashboardDisplay
  4133. REM Translate the value to a nicer value
  4134. CALL :ControlPanel_7Zip_Password_Translator
  4135. ECHO 7Zip Password Settings
  4136. ECHO.
  4137. ECHO Description
  4138. ECHO %SeparatorSmall%
  4139. ECHO This allows the user to setup a password key for an archive file.
  4140. ECHO.
  4141. ECHO Password is currently: %ProcessVarA%
  4142. ECHO %Separator%
  4143. ECHO [Set] Change key
  4144. ECHO [Cancel]
  4145. CALL :UserInput
  4146. GOTO :ControlPanel_7Zip_Password_UserInput
  4147.  
  4148.  
  4149.  
  4150. REM # =============================================================================================
  4151. REM # Documentation: Inspect the user's input
  4152. REM # =============================================================================================
  4153. :ControlPanel_7Zip_Password_UserInput
  4154. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  4155.  
  4156. IF /I "%STDIN%" EQU "Set" (
  4157.    REM Set a new key
  4158.     CALL :ControlPanel_7Zip_Password_Manager
  4159.     CALL :ClearBuffer 1
  4160.     GOTO :ControlPanel_7Zip_Password
  4161. )
  4162. CALL :BadInput& GOTO :ControlPanel_7Zip_Password
  4163.  
  4164.  
  4165.  
  4166. REM # =============================================================================================
  4167. REM # Documentation: Manage the entire password creation procedure process.
  4168. REM # =============================================================================================
  4169. :ControlPanel_7Zip_Password_Manager
  4170. REM Clear the STDIN variable
  4171. CALL :ClearSTDIN
  4172. REM Fetch the initial key first
  4173. CALL :ControlPanel_7Zip_Password_Prompt NewKey
  4174. CALL :ControlPanel_7Zip_Password_ManageInput Key
  4175.     IF %ERRORLEVEL% GTR 0 GOTO :EOF
  4176. REM Clear the STDIN variable
  4177. CALL :ClearSTDIN
  4178. REM Fetch the confirmation key
  4179. CALL :ControlPanel_7Zip_Password_Prompt 1
  4180. CALL :ControlPanel_7Zip_Password_ManageInput Confirm
  4181.     IF %ERRORLEVEL% GTR 0 GOTO :EOF
  4182. REM Clear the STDIN variable
  4183. CALL :ClearSTDIN
  4184. CALL :ControlPanel_7Zip_Password_CheckInput
  4185. REM Clear the working variables that held the key
  4186. CALL :ControlPanel_7Zip_Password_ThrashWorkingVariables
  4187. GOTO :EOF
  4188.  
  4189.  
  4190.  
  4191. REM # =============================================================================================
  4192. REM # Parameters: [{string} ModeType]
  4193. REM # Documentation: Prompt the user to enter the password.
  4194. REM # =============================================================================================
  4195. :ControlPanel_7Zip_Password_Prompt
  4196. ECHO.
  4197. IF %1 EQU NewKey (
  4198.    REM Create a new key into memory.
  4199.     ECHO Enter password:
  4200.     CALL :UserInput
  4201.     GOTO :EOF
  4202. ) ELSE (
  4203.    REM Confirm that the key was entered successfully.
  4204.     ECHO Confirm password:
  4205.     CALL :UserInput
  4206.     GOTO :EOF
  4207. )
  4208.  
  4209.  
  4210.  
  4211. REM # =============================================================================================
  4212. REM # Parameters: [{string} ModeType]
  4213. REM # Documentation: Store the input into the temporary working variables.
  4214. REM # =============================================================================================
  4215. :ControlPanel_7Zip_Password_ManageInput
  4216. IF /I "%STDIN%" EQU "Cancel" EXIT /B 1
  4217.  
  4218. IF %1 EQU Key (
  4219.     SET "ProcessVarA=%STDIN%"
  4220.     EXIT /B 0
  4221. ) ELSE (
  4222.     SET "ProcessVarB=%STDIN%"
  4223.     EXIT /B 0
  4224. )
  4225.  
  4226.  
  4227.  
  4228. REM # =============================================================================================
  4229. REM # Documentation: This function checks the two passwords (that were temporarily stored in the working variables) to be sure that they exactly match, this is case sensitive!
  4230. REM # =============================================================================================
  4231. :ControlPanel_7Zip_Password_CheckInput
  4232. REM Compare the two inputs
  4233. IF "%ProcessVarA%" EQU "%ProcessVarB%" (
  4234.     CALL :ControlPanel_7Zip_Password_Result 0
  4235.     GOTO :EOF
  4236. ) ELSE (
  4237.     CALL :ControlPanel_7Zip_Password_Result 1
  4238.     GOTO :EOF
  4239. )
  4240.  
  4241.  
  4242.  
  4243. REM # =============================================================================================
  4244. REM # Parameters: [{bool} Status]
  4245. REM # Documentation: This function will set the new key into the SevZipKey variable - if there was a match (determined by the parameter).  If the key did not match, then print an error.
  4246. REM # =============================================================================================
  4247. :ControlPanel_7Zip_Password_Result
  4248. IF %1 EQU 0 (
  4249.    REM Key was successfully set
  4250.     SET "SevZipKey=%ProcessVarA%"
  4251.     GOTO :EOF
  4252. ) ELSE (
  4253.     ECHO !ERR: Mismatch key!
  4254.     PAUSE
  4255.     GOTO :EOF
  4256. )
  4257.  
  4258.  
  4259.  
  4260. REM # =============================================================================================
  4261. REM # Documentation: This function will thrash the working variables that held the password that was inputted by the user.
  4262. REM # =============================================================================================
  4263. :ControlPanel_7Zip_Password_ThrashWorkingVariables
  4264. REM Uninitialize them
  4265. SET ProcessVarA=
  4266. SET ProcessVarB=
  4267. GOTO :EOF
  4268.  
  4269.  
  4270.  
  4271. REM =============================================================================
  4272. REM =============================================================================
  4273. REM -----------------------------------------------------------------------------
  4274. REM =============================================================================
  4275. REM =============================================================================
  4276.  
  4277.  
  4278.  
  4279. REM # =============================================================================================
  4280. REM # Documentation: Archive Format menu
  4281. REM # =============================================================================================
  4282. :ControlPanel_7Zip_ArchiveFormat
  4283. CALL :DashboardDisplay
  4284. ECHO 7Zip Archive Format Settings
  4285. ECHO.
  4286. ECHO Description
  4287. ECHO %SeparatorSmall%
  4288. ECHO When creating an archive file, 7zip software allows the user to utilize different formats.  These formats differ in compression and general uses, though the most commonly used is Zip and 7Z.
  4289. ECHO.
  4290. ECHO Default Value: 7Z
  4291. ECHO Archive Format is currently: %SevZipArchiveFormat%
  4292. ECHO %Separator%
  4293. ECHO [1] Zip
  4294. ECHO [2] GZip
  4295. ECHO [3] BZip2
  4296. ECHO [4] 7Z
  4297. ECHO [5] XZ
  4298. ECHO.
  4299. ECHO Other Options
  4300. ECHO %SeparatorSmall%
  4301. ECHO [X] Cancel
  4302. CALL :UserInput
  4303. GOTO :ControlPanel_7Zip_ArchiveFormat_UserInput
  4304.  
  4305.  
  4306.  
  4307. REM # =============================================================================================
  4308. REM # Documentation: Inspect the user's input.
  4309. REM # =============================================================================================
  4310. :ControlPanel_7Zip_ArchiveFormat_UserInput
  4311. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  4312. IF /I "%STDIN%" EQU "X" GOTO :EOF
  4313.  
  4314. IF "%STDIN%" EQU "1" (
  4315.     CALL :ControlPanel_7Zip_ArchiveFormat_Switch Zip
  4316.     CALL :ClearBuffer 1
  4317.     GOTO :ControlPanel_7Zip_ArchiveFormat
  4318. )
  4319. IF "%STDIN%" EQU "2" (
  4320.     CALL :ControlPanel_7Zip_ArchiveFormat_Switch GZip
  4321.     CALL :ClearBuffer 1
  4322.     GOTO :ControlPanel_7Zip_ArchiveFormat
  4323. )
  4324. IF "%STDIN%" EQU "3" (
  4325.     CALL :ControlPanel_7Zip_ArchiveFormat_Switch BZip2
  4326.     CALL :ClearBuffer 1
  4327.     GOTO :ControlPanel_7Zip_ArchiveFormat
  4328. )
  4329. IF "%STDIN%" EQU "4" (
  4330.     CALL :ControlPanel_7Zip_ArchiveFormat_Switch SevenZip
  4331.     CALL :ClearBuffer 1
  4332.     GOTO :ControlPanel_7Zip_ArchiveFormat
  4333. )
  4334. IF "%STDIN%" EQU "5" (
  4335.     CALL :ControlPanel_7Zip_ArchiveFormat_Switch XZ
  4336.     CALL :ClearBuffer 1
  4337.     GOTO :ControlPanel_7Zip_ArchiveFormat
  4338. )
  4339. CALL :BadInput& GOTO :ControlPanel_7Zip_ArchiveFormat
  4340.  
  4341.  
  4342.  
  4343. REM # =============================================================================================
  4344. REM # Parameters: [{String} ArchiveType]
  4345. REM # Documentation: Set the primary archive format and file extension.
  4346. REM # =============================================================================================
  4347. :ControlPanel_7Zip_ArchiveFormat_Switch
  4348. IF %1 EQU Zip (
  4349.     SET SevZipArchiveFormat=Zip
  4350.     SET SevZipFileExtension=zip
  4351.     GOTO :EOF
  4352. )
  4353. IF %1 EQU GZip (
  4354.     SET SevZipArchiveFormat=GZip
  4355.     SET SevZipFileExtension=gz
  4356.     GOTO :EOF
  4357. )
  4358. IF %1 EQU BZip2 (
  4359.     SET SevZipArchiveFormat=BZip2
  4360.     SET SevZipFileExtension=bz2
  4361.     GOTO :EOF
  4362. )
  4363. IF %1 EQU SevenZip (
  4364.     SET SevZipArchiveFormat=7z
  4365.     SET SevZipFileExtension=7z
  4366.     GOTO :EOF
  4367. )
  4368. IF %1 EQU XZ (
  4369.     SET SevZipArchiveFormat=XZ
  4370.     SET SevZipFileExtension=xz
  4371.     GOTO :EOF
  4372. )
  4373.  
  4374.  
  4375.  
  4376. REM =============================================================================
  4377. REM =============================================================================
  4378. REM -----------------------------------------------------------------------------
  4379. REM =============================================================================
  4380. REM =============================================================================
  4381.  
  4382.  
  4383.  
  4384. REM # =============================================================================================
  4385. REM # Documentation: Translate the stored value to a working variable.  This will contain a nicer value that will be displayed on the terminal screen.
  4386. REM # =============================================================================================
  4387. :ControlPanel_7Zip_Compression_Translator
  4388. REM Translate these variables as hardly anyone is going to understand what these integers mean.
  4389. IF %SevZipCompressionPass% EQU 0 (
  4390.     SET ProcessVarA=Copy
  4391.     GOTO :EOF
  4392. )
  4393. IF %SevZipCompressionPass% EQU 1 (
  4394.     SET ProcessVarA=Low
  4395.     GOTO :EOF
  4396. )
  4397. IF %SevZipCompressionPass% EQU 3 (
  4398.     SET ProcessVarA=Below Normal
  4399.     GOTO :EOF
  4400. )
  4401. IF %SevZipCompressionPass% EQU 5 (
  4402.     SET ProcessVarA=Normal
  4403.     GOTO :EOF
  4404. )
  4405. IF %SevZipCompressionPass% EQU 7 (
  4406.     SET ProcessVarA=Above Normal
  4407.     GOTO :EOF
  4408. )
  4409. IF %SevZipCompressionPass% EQU 9 (
  4410.     SET ProcessVarA=High
  4411.     GOTO :EOF
  4412. )
  4413.  
  4414.  
  4415.  
  4416. REM # =============================================================================================
  4417. REM # Documentation: Compression ratio menu
  4418. REM # =============================================================================================
  4419. :ControlPanel_7Zip_Compression
  4420. CALL :DashboardDisplay
  4421. REM Translate the value to a nicer value
  4422. CALL :ControlPanel_7Zip_Compression_Translator
  4423. ECHO 7Zip Compression Level Depth Settings
  4424. ECHO.
  4425. ECHO Description
  4426. ECHO %SeparatorSmall%
  4427. ECHO During compacting files into an archive file, it is possible to customize the depth of compression for the data within the archive file.  Higher compression - more CPU time is needed but the data is well compressed, Lesser compression - less CPU time is needed but the data is not so well compressed.
  4428. ECHO.
  4429. ECHO Default Value: Normal
  4430. ECHO Compression Depth is currently: %ProcessVarA%
  4431. ECHO %Separator%
  4432. ECHO [1] Copy
  4433. ECHO [2] Low
  4434. ECHO [3] Below Normal
  4435. ECHO [4] Normal
  4436. ECHO [5] Above Normal
  4437. ECHO [6] High
  4438. ECHO.
  4439. ECHO Other Options
  4440. ECHO %SeparatorSmall%
  4441. ECHO [X] Cancel
  4442. CALL :UserInput
  4443. GOTO :ControlPanel_7Zip_Compression_UserInput
  4444.  
  4445.  
  4446.  
  4447. REM # =============================================================================================
  4448. REM # Documentation: Inspect the user's input.
  4449. REM # =============================================================================================
  4450. :ControlPanel_7Zip_Compression_UserInput
  4451. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  4452. IF /I "%STDIN%" EQU "X" GOTO :EOF
  4453.  
  4454. IF "%STDIN%" EQU "1" (
  4455.     CALL :ControlPanel_7Zip_Compression_Switch Copy
  4456.     CALL :ClearBuffer 1
  4457.     GOTO :ControlPanel_7Zip_Compression
  4458. )
  4459. IF "%STDIN%" EQU "2" (
  4460.     CALL :ControlPanel_7Zip_Compression_Switch Low
  4461.     CALL :ClearBuffer 1
  4462.     GOTO :ControlPanel_7Zip_Compression
  4463. )
  4464. IF "%STDIN%" EQU "3" (
  4465.     CALL :ControlPanel_7Zip_Compression_Switch BelowNormal
  4466.     CALL :ClearBuffer 1
  4467.     GOTO :ControlPanel_7Zip_Compression
  4468. )
  4469. IF "%STDIN%" EQU "4" (
  4470.     CALL :ControlPanel_7Zip_Compression_Switch Normal
  4471.     CALL :ClearBuffer 1
  4472.     GOTO :ControlPanel_7Zip_Compression
  4473. )
  4474. IF "%STDIN%" EQU "5" (
  4475.     CALL :ControlPanel_7Zip_Compression_Switch AboveNormal
  4476.     CALL :ClearBuffer 1
  4477.     GOTO :ControlPanel_7Zip_Compression
  4478. )
  4479. IF "%STDIN%" EQU "6" (
  4480.     CALL :ControlPanel_7Zip_Compression_Switch High
  4481.     CALL :ClearBuffer 1
  4482.     GOTO :ControlPanel_7Zip_Compression
  4483. )
  4484. CALL :BadInput& GOTO :ControlPanel_7Zip_Compression
  4485.  
  4486.  
  4487.  
  4488. REM # =============================================================================================
  4489. REM # Parameters: [{string} CompressionRatio]
  4490. REM # Documentation: This function sets the compression ratio.
  4491. REM # =============================================================================================
  4492. :ControlPanel_7Zip_Compression_Switch
  4493. IF %1 EQU Copy (
  4494.    REM Compression: Copy, no compression.
  4495.     SET SevZipCompressionPass=0
  4496.     GOTO :EOF
  4497. )
  4498. IF %1 EQU Low (
  4499.    REM Compression: Low
  4500.     SET SevZipCompressionPass=1
  4501.     GOTO :EOF
  4502. )
  4503. IF %1 EQU BelowNormal (
  4504.    REM Compression: Below Normal
  4505.     SET SevZipCompressionPass=3
  4506.     GOTO :EOF
  4507. )
  4508. IF %1 EQU Normal (
  4509.    REM Compression: Normal
  4510.     SET SevZipCompressionPass=5
  4511.     GOTO :EOF
  4512. )
  4513. IF %1 EQU AboveNormal (
  4514.    REM Compression: Above Normal
  4515.     SET SevZipCompressionPass=7
  4516.     GOTO :EOF
  4517. )
  4518. IF %1 EQU High (
  4519.    REM Compression: High
  4520.     SET SevZipCompressionPass=9
  4521.     GOTO :EOF
  4522. )
  4523.  
  4524.  
  4525.  
  4526. REM =============================================================================
  4527. REM =============================================================================
  4528. REM -----------------------------------------------------------------------------
  4529. REM =============================================================================
  4530. REM =============================================================================
  4531.  
  4532.  
  4533.  
  4534. REM # =============================================================================================
  4535. REM # Documentation: Copy algorithm menu
  4536. REM # =============================================================================================
  4537. :ControlPanel_7Zip_CopyAlgorithm
  4538. CALL :DashboardDisplay
  4539. ECHO 7Zip Copy Format Settings
  4540. ECHO.
  4541. ECHO Description
  4542. ECHO %SeparatorSmall%
  4543. ECHO When importing files into an archive file, the 7Zip software requires that the data must be imported in a certain way for compression and decompression means.
  4544. ECHO.
  4545. ECHO Default Value: Deflate
  4546. ECHO Copy Format is currently: %SevZipCopyFormat%
  4547. ECHO %Separator%
  4548. ECHO [1] Copy
  4549. ECHO [2] Deflate
  4550. ECHO [3] Deflate64
  4551. ECHO [4] BZip2
  4552. ECHO [5] LZMA
  4553. ECHO [6] PPMd
  4554. ECHO.
  4555. ECHO Other Options
  4556. ECHO %SeparatorSmall%
  4557. ECHO [X] Cancel
  4558. CALL :UserInput
  4559. GOTO :ControlPanel_7Zip_CopyAlgorithm_UserInput
  4560.  
  4561.  
  4562.  
  4563. REM # =============================================================================================
  4564. REM # Documentation: Inspect the user's input.
  4565. REM # =============================================================================================
  4566. :ControlPanel_7Zip_CopyAlgorithm_UserInput
  4567. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  4568. IF /I "%STDIN%" EQU "X" GOTO :EOF
  4569.  
  4570. IF "%STDIN%" EQU "1" (
  4571.     CALL :ControlPanel_7Zip_CopyAlgorithm_Switch Copy
  4572.     CALL :ClearBuffer 1
  4573.     GOTO :ControlPanel_7Zip_CopyAlgorithm
  4574. )
  4575. IF "%STDIN%" EQU "2" (
  4576.     CALL :ControlPanel_7Zip_CopyAlgorithm_Switch Deflate
  4577.     CALL :ClearBuffer 1
  4578.     GOTO :ControlPanel_7Zip_CopyAlgorithm
  4579. )
  4580. IF "%STDIN%" EQU "3" (
  4581.     CALL :ControlPanel_7Zip_CopyAlgorithm_Switch Deflate64
  4582.     CALL :ClearBuffer 1
  4583.     GOTO :ControlPanel_7Zip_CopyAlgorithm
  4584. )
  4585. IF "%STDIN%" EQU "4" (
  4586.     CALL :ControlPanel_7Zip_CopyAlgorithm_Switch BZip2
  4587.     CALL :ClearBuffer 1
  4588.     GOTO :ControlPanel_7Zip_CopyAlgorithm
  4589. )
  4590. IF "%STDIN%" EQU "5" (
  4591.     CALL :ControlPanel_7Zip_CopyAlgorithm_Switch LZMA
  4592.     CALL :ClearBuffer 1
  4593.     GOTO :ControlPanel_7Zip_CopyAlgorithm
  4594. )
  4595. IF "%STDIN%" EQU "6" (
  4596.     CALL :ControlPanel_7Zip_CopyAlgorithm_Switch PPMd
  4597.     CALL :ClearBuffer 1
  4598.     GOTO :ControlPanel_7Zip_CopyAlgorithm
  4599. )
  4600. CALL :BadInput& GOTO :ControlPanel_7Zip_CopyAlgorithm
  4601.  
  4602.  
  4603.  
  4604. REM # =============================================================================================
  4605. REM # Parameters: [{string} CopyType]
  4606. REM # Documentation: This function sets the primary copy algorithm.
  4607. REM # =============================================================================================
  4608. :ControlPanel_7Zip_CopyAlgorithm_Switch
  4609. IF %1 EQU Copy (
  4610.     SET SevZipCopyFormat=Copy
  4611.     GOTO :EOF
  4612. )
  4613. IF %1 EQU Deflate (
  4614.     SET SevZipCopyFormat=Deflate
  4615.     GOTO :EOF
  4616. )
  4617. IF %1 EQU Deflate64 (
  4618.     SET SevZipCopyFormat=Deflate64
  4619.     GOTO :EOF
  4620. )
  4621. IF %1 EQU BZip2 (
  4622.     SET SevZipCopyFormat=BZip2
  4623.     GOTO :EOF
  4624. )
  4625. IF %1 EQU LZMA (
  4626.     SET SevZipCopyFormat=LZMA
  4627.     GOTO :EOF
  4628. )
  4629. IF %1 EQU PPMd (
  4630.     SET SevZipCopyFormat=PPMd
  4631.     GOTO :EOF
  4632. )
  4633.  
  4634.  
  4635.  
  4636. REM =============================================================================
  4637. REM =============================================================================
  4638. REM -----------------------------------------------------------------------------
  4639. REM =============================================================================
  4640. REM =============================================================================
  4641.  
  4642.  
  4643.  
  4644. REM # =============================================================================================
  4645. REM # Documentation: Translate the stored value to a working variable.  This will contain a nicer value that will be displayed on the terminal screen.
  4646. REM # =============================================================================================
  4647. :ControlPanel_7Zip_Multithread_Translator
  4648. IF %SevZipMultiThreadingCPU% EQU on SET ProcessVarA=Enable& GOTO :EOF
  4649. IF %SevZipMultiThreadingCPU% EQU off SET ProcessVarA=Disable
  4650. GOTO :EOF
  4651.  
  4652.  
  4653.  
  4654. REM # =============================================================================================
  4655. REM # Documentation: Multiple threading menu
  4656. REM # =============================================================================================
  4657. :ControlPanel_7Zip_Multithread
  4658. CALL :DashboardDisplay
  4659. REM Translate the value to a nicer value
  4660. CALL :ControlPanel_7Zip_Multithread_Translator
  4661. ECHO 7Zip Multithreading Settings
  4662. ECHO.
  4663. ECHO Description
  4664. ECHO %SeparatorSmall%
  4665. ECHO 7Zip can utilize all available CPU cores and threads for processing, which - is faster.  If the CPU does _NOT_ have multiple cores or threads, disable this feature.
  4666. ECHO.
  4667. ECHO Default Value: Enable
  4668. ECHO Multithreading is currently: %ProcessVarA%
  4669. ECHO %Separator%
  4670. ECHO [1] Enable
  4671. ECHO [2] Disable
  4672. ECHO.
  4673. ECHO Other Options
  4674. ECHO %SeparatorSmall%
  4675. ECHO [X] Cancel
  4676. CALL :UserInput
  4677. GOTO :ControlPanel_7Zip_Multithread_UserInput
  4678.  
  4679.  
  4680.  
  4681. REM # =============================================================================================
  4682. REM # Documentation: Inspect the user's input.
  4683. REM # =============================================================================================
  4684. :ControlPanel_7Zip_Multithread_UserInput
  4685. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  4686. IF /I "%STDIN%" EQU "X" GOTO :EOF
  4687.  
  4688. REM First check if the host system has multithreading capabilities available, and then cache that return value.
  4689. CALL :ControlPanel_7Zip_Multithread_Evaluate
  4690. SET ProcessVarA=%ERRORLEVEL%
  4691.  
  4692. IF "%STDIN%" EQU "1" (
  4693.     CALL :ControlPanel_7Zip_Multithread_Toggle False %ProcessVarA%
  4694.     CALL :ClearBuffer 1
  4695.     GOTO :ControlPanel_7Zip_Multithread
  4696. )
  4697. IF "%STDIN%" EQU "2" (
  4698.     CALL :ControlPanel_7Zip_Multithread_Toggle True %ProcessVarA%
  4699.     CALL :ClearBuffer 1
  4700.     GOTO :ControlPanel_7Zip_Multithread
  4701. )
  4702. CALL :BadInput& GOTO :ControlPanel_7Zip_Multithread
  4703.  
  4704.  
  4705.  
  4706. REM # =============================================================================================
  4707. REM # Parameters: [{string} MultithreadingMode] [{bool} Evaluation]
  4708. REM # Documentation: This function sets the multithreading setting.
  4709. REM # =============================================================================================
  4710. :ControlPanel_7Zip_Multithread_Toggle
  4711. IF %1 EQU False (
  4712.     IF %2 EQU 1 SET SevZipMultiThreadingCPU=on
  4713.     GOTO :EOF
  4714. ) ELSE (
  4715.     SET SevZipMultiThreadingCPU=off
  4716.     GOTO :EOF
  4717. )
  4718.  
  4719.  
  4720.  
  4721. REM # =============================================================================================
  4722. REM # Documentation: This function will check to see how many logical cores the host system has available.  This function is dedicated for 7Zip program, Multithreading functionality.  If the host system does NOT have any multithreading capabilities available, this program will disable the multithreading functionality when 7Zip is being called.
  4723. REM # =============================================================================================
  4724. :ControlPanel_7Zip_Multithread_Evaluate
  4725. IF %Number_Of_Processors% EQU 0 (
  4726.    REM Not possible to utilize Multithreading
  4727.     EXIT /B 0
  4728. ) ELSE (
  4729.    REM Multithreading capabilities are possible
  4730.     EXIT /B 1
  4731. )
  4732. GOTO :EOF
  4733.  
  4734.  
  4735.  
  4736. REM =============================================================================
  4737. REM =============================================================================
  4738. REM -----------------------------------------------------------------------------
  4739. REM =============================================================================
  4740. REM =============================================================================
  4741.  
  4742.  
  4743.  
  4744. REM # =============================================================================================
  4745. REM # Documentation: Encryption Algorithm menu
  4746. REM # =============================================================================================
  4747. :ControlPanel_7Zip_Encryption
  4748. CALL :DashboardDisplay
  4749. ECHO 7Zip Encryption Algorithm Settings
  4750. ECHO.
  4751. ECHO Description
  4752. ECHO %SeparatorSmall%
  4753. ECHO When utilizing password protected archive files, this allows the user to select different encryption types that 7Zip supports.  Best encrypted archives, takes more time to break.
  4754. ECHO.
  4755. ECHO Default Value: ZipCrypto
  4756. ECHO Encryption is currently: %SevZipEncryptionAlgorithm%
  4757. ECHO %Separator%
  4758. ECHO [1] ZipCrypto
  4759. ECHO [2] AES128
  4760. ECHO [3] AES192
  4761. ECHO [4] AES256
  4762. ECHO.
  4763. ECHO Other Options
  4764. ECHO %SeparatorSmall%
  4765. ECHO [X] Cancel
  4766. CALL :UserInput
  4767. GOTO :ControlPanel_7Zip_Encryption_UserInput
  4768.  
  4769.  
  4770.  
  4771. REM # =============================================================================================
  4772. REM # Documentation: Inspect the user's input.
  4773. REM # =============================================================================================
  4774. :ControlPanel_7Zip_Encryption_UserInput
  4775. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  4776. IF /I "%STDIN%" EQU "X" GOTO :EOF
  4777. IF "%STDIN%" EQU "1" (
  4778.     CALL :ControlPanel_7Zip_Encryption_Switch ZipCrypto
  4779.     CALL :ClearBuffer 1
  4780.     GOTO :ControlPanel_7Zip_Encryption
  4781. )
  4782. IF "%STDIN%" EQU "2" (
  4783.     CALL :ControlPanel_7Zip_Encryption_Switch AES128
  4784.     CALL :ClearBuffer 1
  4785.     GOTO :ControlPanel_7Zip_Encryption
  4786. )
  4787. IF "%STDIN%" EQU "3" (
  4788.     CALL :ControlPanel_7Zip_Encryption_Switch AES192
  4789.     CALL :ClearBuffer 1
  4790.     GOTO :ControlPanel_7Zip_Encryption
  4791. )
  4792. IF "%STDIN%" EQU "4" (
  4793.     CALL :ControlPanel_7Zip_Encryption_Switch AES256
  4794.     CALL :ClearBuffer 1
  4795.     GOTO :ControlPanel_7Zip_Encryption
  4796. )
  4797. CALL :BadInput& GOTO :ControlPanel_7Zip_Encryption
  4798.  
  4799.  
  4800.  
  4801. REM # =============================================================================================
  4802. REM # Parameters: [{string} EncryptionType]
  4803. REM # Documentation: This function sets the primary encryption type.
  4804. REM # =============================================================================================
  4805. :ControlPanel_7Zip_Encryption_Switch
  4806. IF %1 EQU ZipCrypto (
  4807.     SET SevZipEncryptionAlgorithm=ZipCrypto
  4808.     GOTO :EOF
  4809. )
  4810. IF %1 EQU AES128 (
  4811.     SET SevZipEncryptionAlgorithm=AES128
  4812.     GOTO :EOF
  4813. )
  4814. IF %1 EQU AES192 (
  4815.     SET SevZipEncryptionAlgorithm=AES192
  4816.     GOTO :EOF
  4817. )
  4818. IF %1 EQU AES256 (
  4819.     SET SevZipEncryptionAlgorithm=AES256
  4820.     GOTO :EOF
  4821. )
  4822.  
  4823.  
  4824.  
  4825. REM =============================================================================
  4826. REM =============================================================================
  4827. REM -----------------------------------------------------------------------------
  4828. REM =============================================================================
  4829. REM =============================================================================
  4830.  
  4831.  
  4832.  
  4833. REM # =============================================================================================
  4834. REM # Documentation: Translate the stored value to a working variable.  This will contain a nicer value that will be displayed on the terminal screen.
  4835. REM # =============================================================================================
  4836. :ControlPanel_7Zip_Verify_Translator
  4837. IF %SevZipVerify% EQU True SET ProcessVarA=Enable& GOTO :EOF
  4838. IF %SevZipVerify% EQU False SET ProcessVarA=Disable
  4839. GOTO :EOF
  4840.  
  4841.  
  4842.  
  4843. REM # =============================================================================================
  4844. REM # Documentation: Integrity checking menu
  4845. REM # =============================================================================================
  4846. :ControlPanel_7Zip_Verify
  4847. CALL :DashboardDisplay
  4848. REM Translate the value to a nicer value
  4849. CALL :ControlPanel_7Zip_Verify_Translator
  4850. ECHO 7Zip Verification Settings
  4851. ECHO.
  4852. ECHO Description
  4853. ECHO %SeparatorSmall%
  4854. ECHO After 7Zip finishes generating an archive file [and everything is already compressed], this option enforces 7Zip to verify the archive file for any potential errors.
  4855. ECHO.
  4856. ECHO Default Value: Enable
  4857. ECHO Integrity Checking is currently: %ProcessVarA%
  4858. ECHO %Separator%
  4859. ECHO [1] Enable
  4860. ECHO [2] Disable
  4861. ECHO.
  4862. ECHO Other Options
  4863. ECHO %SeparatorSmall%
  4864. ECHO [X] Cancel
  4865. CALL :UserInput
  4866. GOTO :ControlPanel_7Zip_Verifys_UserInput
  4867.  
  4868.  
  4869.  
  4870. REM # =============================================================================================
  4871. REM # Documentation: Inspect the user's input.
  4872. REM # =============================================================================================
  4873. :ControlPanel_7Zip_Verifys_UserInput
  4874. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  4875. IF /I "%STDIN%" EQU "X" GOTO :EOF
  4876.  
  4877. IF "%STDIN%" EQU "1" (
  4878.     CALL :ControlPanel_7Zip_Verify_Toggle True
  4879.     CALL :ClearBuffer 1
  4880.     GOTO :ControlPanel_7Zip_Verify
  4881. )
  4882. IF "%STDIN%" EQU "2" (
  4883.     CALL :ControlPanel_7Zip_Verify_Toggle False
  4884.     CALL :ClearBuffer 1
  4885.     GOTO :ControlPanel_7Zip_Verify
  4886. )
  4887. CALL :BadInput& GOTO :ControlPanel_7Zip_Verify
  4888.  
  4889.  
  4890.  
  4891. REM # =============================================================================================
  4892. REM # Parameters: [{string} VerifyMode]
  4893. REM # Documentation: This function sets the primary value for the verification process.
  4894. REM # =============================================================================================
  4895. :ControlPanel_7Zip_Verify_Toggle
  4896. IF %1 EQU True (
  4897.     SET SevZipVerify=True
  4898.     GOTO :EOF
  4899. ) ELSE (
  4900.     SET SevZipVerify=False
  4901.     GOTO :EOF
  4902. )
  4903.  
  4904.  
  4905.  
  4906. REM =============================================================================
  4907. REM =============================================================================
  4908. REM -----------------------------------------------------------------------------
  4909. REM =============================================================================
  4910. REM =============================================================================
  4911.  
  4912.  
  4913.  
  4914. REM # =============================================================================================
  4915. REM # Documentation: Translate the stored value to a working variable.  This will contain a nicer value that will be displayed on the terminal screen.
  4916. REM # =============================================================================================
  4917. :ControlPanel_7Zip_TogglePassword_Translator
  4918. IF %SevZipUseKey% EQU True SET ProcessVarA=Enable& GOTO :EOF
  4919. IF %SevZipUseKey% EQU False SET ProcessVarA=Disable
  4920. GOTO :EOF
  4921.  
  4922.  
  4923.  
  4924. REM # =============================================================================================
  4925. REM # Documentation: Toggle password protection menu
  4926. REM # =============================================================================================
  4927. :ControlPanel_7Zip_TogglePassword
  4928. CALL :DashboardDisplay
  4929. REM Translate the value to a nicer value
  4930. CALL :ControlPanel_7Zip_TogglePassword_Translator
  4931. ECHO 7Zip Toggle Passwords Settings
  4932. ECHO.
  4933. ECHO Description
  4934. ECHO %SeparatorSmall%
  4935. ECHO A simple switch to enforce archive files to be created with a password.
  4936. ECHO.
  4937. ECHO Default Value: Disable
  4938. ECHO Use Passwords is currently: %ProcessVarA%
  4939. ECHO %Separator%
  4940. ECHO [1] Enable
  4941. ECHO [2] Disable
  4942. ECHO.
  4943. ECHO Other Options
  4944. ECHO %SeparatorSmall%
  4945. ECHO [X] Cancel
  4946. CALL :UserInput
  4947. GOTO :ControlPanel_7Zip_TogglePassword_UserInput
  4948.  
  4949.  
  4950.  
  4951. REM # =============================================================================================
  4952. REM # Documentation: Inspect the user's input.
  4953. REM # =============================================================================================
  4954. :ControlPanel_7Zip_TogglePassword_UserInput
  4955. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  4956. IF /I "%STDIN%" EQU "X" GOTO :EOF
  4957.  
  4958. IF "%STDIN%" EQU "1" (
  4959.     CALL :ControlPanel_7Zip_TogglePassword_Toggle True
  4960.     CALL :ClearBuffer 1
  4961.     GOTO :ControlPanel_7Zip_TogglePassword
  4962. )
  4963. IF "%STDIN%" EQU "2" (
  4964.     CALL :ControlPanel_7Zip_TogglePassword_Toggle False
  4965.     CALL :ClearBuffer 1
  4966.     GOTO :ControlPanel_7Zip_TogglePassword
  4967. )
  4968. CALL :BadInput&
  4969. GOTO :ControlPanel_7Zip_TogglePassword
  4970.  
  4971.  
  4972.  
  4973. REM # =============================================================================================
  4974. REM # Parameters: [{string} PasswordProtectionMode]
  4975. REM # Documentation: This function enables or disables the password protection.
  4976. REM # =============================================================================================
  4977. :ControlPanel_7Zip_TogglePassword_Toggle
  4978. IF %1 EQU False (
  4979.     SET SevZipUseKey=False
  4980.     GOTO :EOF
  4981. )
  4982. REM Assume true otherwise, but also check to make sure that there is a key already set.
  4983. IF "%SevZipKey%" EQU "" (
  4984.    REM If incase this setting was already enabled previously, disable it.
  4985.     SET SevZipUseKey=False
  4986.     CALL :ControlPanel_7Zip_TogglePassword_NoKeySetError
  4987.     GOTO :EOF
  4988. ) ELSE (
  4989.     SET SevZipUseKey=True
  4990.     GOTO :EOF
  4991. )
  4992.  
  4993.  
  4994.  
  4995. REM # =============================================================================================
  4996. REM # Documentation: This function will be called when the user attempts to enable the use of the password - when the password was never defined within the program.
  4997. REM # =============================================================================================
  4998. :ControlPanel_7Zip_TogglePassword_NoKeySetError
  4999. ECHO.&ECHO.
  5000. ECHO ^<!^>    Password Not Declared!    ^<!^>
  5001. ECHO %SeparatorLong%
  5002. ECHO.
  5003. ECHO !ERR: There is no password yet defined!  Please go to Password Setup within the 7Zip configuration!
  5004. ECHO.
  5005. PAUSE
  5006. GOTO :EOF
  5007.  
  5008.  
  5009.  
  5010.  
  5011. REM =====================================================================
  5012. REM Control Panel: 7Zip Configuration
  5013. REM ----------------------------
  5014. REM Within this section, this will allow the user to customize available settings for 7Zip software.
  5015. REM =====================================================================
  5016.  
  5017.  
  5018. REM # =============================================================================================
  5019. REM # Documentation: Settings menu for 7Zip Configuration
  5020. REM # =============================================================================================
  5021. :ControlPanel_7Zip
  5022. CALL :DashboardDisplay
  5023. ECHO 7Zip Configuration Menu
  5024. ECHO.
  5025. ECHO Select the following options:
  5026. ECHO %Separator%
  5027. ECHO [1] Password
  5028. ECHO [2] Toggle Password
  5029. ECHO [3] Archive
  5030. ECHO [4] Compression Depth
  5031. ECHO [5] Copy Format
  5032. ECHO [6] Multithread
  5033. ECHO [7] Encryption Algorithm
  5034. ECHO [8] Verification
  5035. ECHO.
  5036. ECHO Other Options
  5037. ECHO %SeparatorSmall%
  5038. ECHO [X] Exit
  5039. CALL :UserInput
  5040. GOTO :ControlPanel_7Zip_Menu_UserInput
  5041.  
  5042.  
  5043.  
  5044. REM # =============================================================================================
  5045. REM # Documentation: Inspect the users input
  5046. REM # =============================================================================================
  5047. :ControlPanel_7Zip_Menu_UserInput
  5048. IF "%STDIN%" EQU "1" GOTO :ControlPanel_7Zip_Menu_Choice_Password
  5049. IF "%STDIN%" EQU "2" GOTO :ControlPanel_7Zip_Menu_Choice_TogglePassword
  5050. IF "%STDIN%" EQU "3" GOTO :ControlPanel_7Zip_Menu_Choice_Archive
  5051. IF "%STDIN%" EQU "4" GOTO :ControlPanel_7Zip_Menu_Choice_Compression
  5052. IF "%STDIN%" EQU "5" GOTO :ControlPanel_7Zip_Menu_Choice_CopyAlgorithm
  5053. IF "%STDIN%" EQU "6" GOTO :ControlPanel_7Zip_Menu_Choice_Multithread
  5054. IF "%STDIN%" EQU "7" GOTO :ControlPanel_7Zip_Menu_Choice_Encryption
  5055. IF "%STDIN%" EQU "8" GOTO :ControlPanel_7Zip_Menu_Choice_Verify
  5056. IF /I "%STDIN%" EQU "X" GOTO :EOF
  5057. IF /I "%STDIN%" EQU "Exit" GOTO :EOF
  5058. CALL :BadInput& GOTO :ControlPanel_7Zip
  5059.  
  5060.  
  5061.  
  5062. REM # =============================================================================================
  5063. REM # Documentation: Call the 7Zip setting for setting a new archive password.
  5064. REM # =============================================================================================
  5065. :ControlPanel_7Zip_Menu_Choice_Password
  5066. CALL :ClearBuffer 1
  5067. CALL :ControlPanel_7Zip_Password
  5068. CALL :ClearBuffer 1
  5069. GOTO :ControlPanel_7Zip
  5070.  
  5071.  
  5072.  
  5073. REM # =============================================================================================
  5074. REM # Documentation: Call the 7Zip setting for enabling or disabling the archive password.
  5075. REM # =============================================================================================
  5076. :ControlPanel_7Zip_Menu_Choice_TogglePassword
  5077. CALL :ClearBuffer 1
  5078. CALL :ControlPanel_7Zip_TogglePassword
  5079. CALL :ClearBuffer 1
  5080. GOTO :ControlPanel_7Zip
  5081.  
  5082.  
  5083.  
  5084. REM # =============================================================================================
  5085. REM # Documentation: Call the 7Zip setting for changing the archive file format.
  5086. REM # =============================================================================================
  5087. :ControlPanel_7Zip_Menu_Choice_Archive
  5088. CALL :ClearBuffer 1
  5089. CALL :ControlPanel_7Zip_ArchiveFormat
  5090. CALL :ClearBuffer 1
  5091. GOTO :ControlPanel_7Zip
  5092.  
  5093.  
  5094.  
  5095. REM # =============================================================================================
  5096. REM # Documentation: Call the 7Zip setting for changing the compression rate.
  5097. REM # =============================================================================================
  5098. :ControlPanel_7Zip_Menu_Choice_Compression
  5099. CALL :ClearBuffer 1
  5100. CALL :ControlPanel_7Zip_Compression
  5101. CALL :ClearBuffer 1
  5102. GOTO :ControlPanel_7Zip
  5103.  
  5104.  
  5105.  
  5106. REM # =============================================================================================
  5107. REM # Documentation: Call the 7Zip setting for changing the copying algorithm.
  5108. REM # =============================================================================================
  5109. :ControlPanel_7Zip_Menu_Choice_CopyAlgorithm
  5110. CALL :ClearBuffer 1
  5111. CALL :ControlPanel_7Zip_CopyAlgorithm
  5112. CALL :ClearBuffer 1
  5113. GOTO :ControlPanel_7Zip
  5114.  
  5115.  
  5116.  
  5117. REM # =============================================================================================
  5118. REM # Documentation: Call the 7Zip setting for allowing or disallowing multiple thread processing.
  5119. REM # =============================================================================================
  5120. :ControlPanel_7Zip_Menu_Choice_Multithread
  5121. CALL :ClearBuffer 1
  5122. CALL :ControlPanel_7Zip_Multithread
  5123. CALL :ClearBuffer 1
  5124. GOTO :ControlPanel_7Zip
  5125.  
  5126.  
  5127.  
  5128. REM # =============================================================================================
  5129. REM # Documentation: Call the 7Zip setting for changing the encryption algorithm.
  5130. REM # =============================================================================================
  5131. :ControlPanel_7Zip_Menu_Choice_Encryption
  5132. CALL :ClearBuffer 1
  5133. CALL :ControlPanel_7Zip_Encryption
  5134. CALL :ClearBuffer 1
  5135. GOTO :ControlPanel_7Zip
  5136.  
  5137.  
  5138.  
  5139. REM # =============================================================================================
  5140. REM # Documentation: Call the 7Zip setting for changing the archive file type.
  5141. REM # =============================================================================================
  5142. :ControlPanel_7Zip_Menu_Choice_Verify
  5143. CALL :ClearBuffer 1
  5144. CALL :ControlPanel_7Zip_Verify
  5145. CALL :ClearBuffer 1
  5146. GOTO :ControlPanel_7Zip
  5147.  
  5148.  
  5149.  
  5150.  
  5151. REM =====================================================================
  5152. REM Control Panel: Execute Modules Window Process
  5153. REM ----------------------------
  5154. REM Allow the user to choose wither or not to execute external modules in a new window or in the same [parent] window as the core.  If incase the modules are serious buggy, it is better to launch them in their own window.
  5155. REM =====================================================================
  5156.  
  5157.  
  5158. REM # =============================================================================================
  5159. REM # Documentation: Priority throttling menu
  5160. REM # =============================================================================================
  5161. :ControlPanel_ModuleExecuteSharingWindow
  5162. CALL :DashboardDisplay
  5163. ECHO Module Execution Window Sharing Settings
  5164. ECHO.
  5165. ECHO Description
  5166. ECHO %SeparatorSmall%
  5167. ECHO When executing modules, it is possible to have them be in their own window and not sharing the same window as %ProgramName%.  When set to [true], this should be helpful for executing multiple modules as well as avoiding serious conflicts with buggy modules.
  5168. ECHO.
  5169. ECHO Default Value: True
  5170. ECHO Window Sharing is Currently: %ModuleExecuteSharingWindow%
  5171. ECHO %Separator%
  5172. ECHO [1] True
  5173. ECHO [2] False
  5174. ECHO.
  5175. ECHO Other Options
  5176. ECHO %SeparatorSmall%
  5177. ECHO [X] Cancel
  5178. CALL :UserInput
  5179. GOTO :ControlPanel_ModuleExecuteSharingWindow_UserInput
  5180.  
  5181.  
  5182.  
  5183. REM # =============================================================================================
  5184. REM # Documentation: Inspect the users input
  5185. REM # =============================================================================================
  5186. :ControlPanel_ModuleExecuteSharingWindow_UserInput
  5187. IF /I "%STDIN%" EQU "X" GOTO :EOF
  5188. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  5189.  
  5190. IF "%STDIN%" EQU "1" (
  5191.     CALL :ControlPanel_ModuleExecuteSharingWindow_UserInput_Switch True
  5192.     CALL :ClearBuffer 1
  5193.     GOTO :ControlPanel_ModuleExecuteSharingWindow
  5194. )
  5195. IF "%STDIN%" EQU "2" (
  5196.     CALL :ControlPanel_ModuleExecuteSharingWindow_UserInput_Switch False
  5197.     CALL :ClearBuffer 1
  5198.     GOTO :ControlPanel_ModuleExecuteSharingWindow
  5199. )
  5200. CALL :BadInput& GOTO :ControlPanel_ModuleExecuteSharingWindow
  5201.  
  5202.  
  5203.  
  5204. REM # =============================================================================================
  5205. REM # Parameters: [{String} SettingType]
  5206. REM # Documentation: Adjust the variable value as requested by the user.
  5207. REM # =============================================================================================
  5208. :ControlPanel_ModuleExecuteSharingWindow_UserInput_Switch
  5209. IF %1 EQU False (
  5210.     SET ModuleExecuteSharingWindow=False
  5211.     GOTO :EOF
  5212. ) ELSE (
  5213.     SET ModuleExecuteSharingWindow=True
  5214.     GOTO :EOF
  5215. )
  5216.  
  5217.  
  5218.  
  5219.  
  5220. REM =====================================================================
  5221. REM Control Panel: Dashboard Viewer Tool
  5222. REM ----------------------------
  5223. REM Allow the user to configure the dashboard tool.
  5224. REM For some modules, disabling this feature might help with over all performances.
  5225. REM =====================================================================
  5226.  
  5227.  
  5228. REM # =============================================================================================
  5229. REM # Documentation: This function is a translator which takes the variable's value and stores a nicer value name to a temporary working variable.
  5230. REM # =============================================================================================
  5231. :ControlPanel_DashboardTool_Translator
  5232. IF %DashboardViewerTool% EQU True SET ProcessVarA=Enable& GOTO :EOF
  5233. IF %DashboardViewerTool% EQU False SET ProcessVarA=Disable
  5234. GOTO :EOF
  5235.  
  5236.  
  5237.  
  5238. REM # =============================================================================================
  5239. REM # Documentation: Dashboard Viewer menu
  5240. REM # =============================================================================================
  5241. :ControlPanel_DashboardTool
  5242. CALL :DashboardDisplay
  5243. REM Translate the actual variable value into another variable with a nicer value.
  5244. CALL :ControlPanel_DashboardTool_Translator
  5245. ECHO Dashboard Viewer Settings
  5246. ECHO.
  5247. ECHO Description
  5248. ECHO %SeparatorSmall%
  5249. ECHO The Dashboard Viewer tool only displays quick and brief information that the user will likely need to know.
  5250. ECHO.
  5251. ECHO Default Value: Enable
  5252. ECHO Dashboard Viewer is Currently: %ProcessVarA%
  5253. ECHO %Separator%
  5254. ECHO [1] Disable
  5255. ECHO [2] Enable
  5256. ECHO.
  5257. ECHO Other Options
  5258. ECHO %SeparatorSmall%
  5259. ECHO [X] Cancel
  5260. CALL :UserInput
  5261. GOTO :ControlPanel_DashboardTool_UserInput
  5262.  
  5263.  
  5264.  
  5265. REM # =============================================================================================
  5266. REM # Documentation: Inspect the users input
  5267. REM # =============================================================================================
  5268. :ControlPanel_DashboardTool_UserInput
  5269. IF /I "%STDIN%" EQU "X" GOTO :EOF
  5270. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  5271.  
  5272. IF "%STDIN%" EQU "1" (
  5273.     CALL :ControlPanel_DashboardTool_Toggle Disable
  5274.     CALL :ClearBuffer 1
  5275.     GOTO :ControlPanel_DashboardTool
  5276. )
  5277. IF "%STDIN%" EQU "2" (
  5278.     CALL :ControlPanel_DashboardTool_Toggle Enable
  5279.     CALL :ClearBuffer 1
  5280.     GOTO :ControlPanel_DashboardTool
  5281. )
  5282. CALL :BadInput& GOTO :ControlPanel_DashboardTool
  5283.  
  5284.  
  5285.  
  5286. REM # =============================================================================================
  5287. REM # Parameters: [{Bool} SettingType]
  5288. REM # Documentation: Adjust the variable value as requested by the user.
  5289. REM # =============================================================================================
  5290. :ControlPanel_DashboardTool_Toggle
  5291. IF %1 EQU Enable (
  5292.     SET DashboardViewerTool=True
  5293.     GOTO :EOF
  5294. ) ELSE (
  5295.     SET DashboardViewerTool=False
  5296.     GOTO :EOF
  5297. )
  5298.  
  5299.  
  5300.  
  5301.  
  5302. REM =====================================================================
  5303. REM Debugger Tool
  5304. REM ----------------------------
  5305. REM This section allows the user to use the debugger tool to either print the users configuration or display the code in real time.  This is not for general purposes, but for debugging and finding errors or inspecting the environment within the current session.
  5306. REM =====================================================================
  5307.  
  5308.  
  5309. REM # =============================================================================================
  5310. REM # Documentation: Debugger menu
  5311. REM # =============================================================================================
  5312. :DebuggerTool
  5313. CALL :DashboardDisplay
  5314. ECHO Debugger Tool
  5315. ECHO.
  5316. ECHO Options available:
  5317. ECHO %Separator%
  5318. ECHO [User] Display User Vars
  5319. ECHO [ECHO] Display code in real time
  5320. ECHO [X] Cancel
  5321. CALL :UserInput
  5322. GOTO :DebuggerTool_UserInput
  5323.  
  5324.  
  5325.  
  5326. REM # =============================================================================================
  5327. REM # Documentation: Inspect the users input
  5328. REM # =============================================================================================
  5329. :DebuggerTool_UserInput
  5330. IF /I "%STDIN%" EQU "X" GOTO :EOF
  5331. IF /I "%STDIN%" EQU "Cancel" GOTO :EOF
  5332. IF /I "%STDIN%" EQU "User" (
  5333.     CALL :ClearBuffer 1
  5334.     CALL :DebuggerTool_User
  5335.     CALL :ClearBuffer 1
  5336.     GOTO :DebuggerTool
  5337. )
  5338. IF /I "%STDIN%" EQU "ECHO" (
  5339.     CALL :DebuggerTool_EchoOperations
  5340.     CALL :ClearBuffer 1
  5341.     GOTO :DebuggerTool
  5342. )
  5343. CALL :BadInput& GOTO :DebuggerTool
  5344.  
  5345.  
  5346.  
  5347. REM # =============================================================================================
  5348. REM # Documentation: If the user requests to enable or disable the 'ECHO' mode, this function will manage that setting.  Within this function, this will set the DebugMode variable and will also toggle the ECHO mode.
  5349. REM # =============================================================================================
  5350. :DebuggerTool_EchoOperations
  5351. IF "%DebugMode%" EQU "False" (
  5352.     SET DebugMode=True
  5353.     ECHO ON
  5354.     GOTO :EOF
  5355. ) ELSE (
  5356.     SET DebugMode=False
  5357.     ECHO OFF
  5358.     GOTO :EOF
  5359. )
  5360.  
  5361.  
  5362.  
  5363. REM # =============================================================================================
  5364. REM # Documentation: When this function is called, this will output the user's current configuration on to the terminal screen.  This will use the EnvironmentSetup section in order to properly display all of the results.
  5365. REM # =============================================================================================
  5366. :DebuggerTool_User
  5367. ECHO User Variables
  5368. ECHO %Separator%
  5369. ECHO.
  5370. CALL :EnvironmentSetup_Switch DebugUser
  5371. CALL :DebuggerTool_FinishedOut
  5372. GOTO :EOF
  5373.  
  5374.  
  5375.  
  5376. REM # =============================================================================================
  5377. REM # Documentation: This function will be executed when the debug mode or debug request is finished.
  5378. REM # =============================================================================================
  5379. :DebuggerTool_FinishedOut
  5380. ECHO.
  5381. ECHO %SeparatorLong%
  5382. ECHO Finished
  5383. PAUSE
  5384. GOTO :EOF
  5385.  
  5386.  
  5387.  
  5388.  
  5389. REM =====================================================================
  5390. REM Terminate Program
  5391. REM ----------------------------
  5392. REM This entire section allows the program to properly exit and do any extra procedures necessary before the program terminates completely.
  5393. REM Exit Code:
  5394. REM   0 = Clean Exit
  5395. REM   1 = Environment Hooking
  5396. REM   2 = Incorrect Parameters or Syntax Error
  5397. REM   3 = Premature Termination or Crash
  5398. REM   4 = Incompatible Operating System
  5399. REM =====================================================================
  5400.  
  5401.  
  5402. REM # =============================================================================================
  5403. REM # Parameters: [{String} Mode]
  5404. REM # Documentation: This function primarily deals with error termination procedures.
  5405. REM #   Incompatible OS
  5406. REM #   Environment Hooking
  5407. REM #   Incorrect Parameters or Syntax error.
  5408. REM # =============================================================================================
  5409. :Kill
  5410. IF %IncompatibleOS% EQU True (
  5411.    REM Because the Windows 9x and ME Operating Systems do not call a subroutine with parameters, we still have to check by a variable.
  5412.    REM Remember, to stay compatible within the ancient Windows Operating Systems.
  5413.     SET ExitCode=4
  5414.     ECHO !ERR_CRIT!: The host Operating System is not compatible with this program.
  5415.     GOTO :Terminator
  5416. )
  5417. REM --------------
  5418. REM Environment Hooking failed
  5419. IF %1 EQU Hook_Operation (
  5420.     SET ExitCode=1
  5421.     ECHO !ERR_CRIT!: Could not successfully modify the users working directory!
  5422.     CALL :EnvironmentSetup_Switch Thrash
  5423.     GOTO :Terminator
  5424. )
  5425. REM Bad parameter or incorrect syntax
  5426. IF %1 EQU BadParameter (
  5427.     SET ExitCode=2
  5428.     ECHO !ERR_CRIT!: This program was invoked with incorrect parameters.
  5429.     CALL :Terminator
  5430. )
  5431.  
  5432.  
  5433.  
  5434. REM # =============================================================================================
  5435. REM # Documentation: When the user requests to terminate the program from the Main Menu, this this function will be called.
  5436. REM # =============================================================================================
  5437. :KillPrompt
  5438. ECHO ^(?^)   End Program   ^(?^)
  5439. ECHO %Separator%
  5440. ECHO.
  5441. ECHO Are you sure you want to end this program?
  5442. ECHO.
  5443. ECHO [Y] Yes
  5444. ECHO [N] Cancel
  5445. CALL :UserInput
  5446. GOTO :KillPrompt_UserInput
  5447.  
  5448.  
  5449.  
  5450. REM # =============================================================================================
  5451. REM # Documentation: Inspect the user's input.
  5452. REM # =============================================================================================
  5453. :KillPrompt_UserInput
  5454. IF /I "%STDIN%" EQU "Y" GOTO :KillPrompt_ChoiceYes
  5455. IF /I "%STDIN%" EQU "Yes" GOTO :KillPrompt_ChoiceYes
  5456. IF /I "%STDIN%" EQU "Exit" GOTO :KillPrompt_ChoiceYes
  5457. IF /I "%STDIN%" EQU "Quit" GOTO :KillPrompt_ChoiceYes
  5458. IF /I "%STDIN%" EQU "N" GOTO :KillPrompt_ChoiceNo
  5459. IF /I "%STDIN%" EQU "No" GOTO :KillPrompt_ChoiceNo
  5460. CALL :BadInput& GOTO :KillPrompt
  5461.  
  5462.  
  5463.  
  5464. REM # =============================================================================================
  5465. REM # Documentation: If the user wishes to terminate the program, then prepare to terminate the program.
  5466. REM # =============================================================================================
  5467. :KillPrompt_ChoiceYes
  5468. SET ExitCode=0
  5469. REM Thrash anything that might be sensitive
  5470. CALL :EnvironmentSetup_Switch Thrash
  5471. REM Revert the user's Working Directory to its original state.
  5472. CALL :ClientWorkingDirectorySetup_RevertChange
  5473. GOTO :Terminator
  5474.  
  5475.  
  5476.  
  5477. REM # =============================================================================================
  5478. REM # Documentation: If the user does not want to terminate the program, then return the main menu.
  5479. REM # =============================================================================================
  5480. :KillPrompt_ChoiceNo
  5481. CALL :ClearBuffer 1
  5482. GOTO :MainScreen
  5483.  
  5484.  
  5485.  
  5486. REM # =============================================================================================
  5487. REM # Documentation: Terminate the program.
  5488. REM # =============================================================================================
  5489. :Terminator
  5490. ECHO Closing program...
  5491. CALL :ClearBuffer 1
  5492. EXIT %ExitCode%
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top