diff --git a/windick.cmd b/windick.cmd index 90c04d7..06554a1 100644 --- a/windick.cmd +++ b/windick.cmd @@ -1218,7 +1218,7 @@ CALL:VAR_CLEAR&CALL:RAS_DELETE :LIST_RUN_CLEANUP IF DEFINED ERR_MSG ECHO.&&ECHO.%ERR_MSG%&&ECHO. IF "%CURR_SESSION%"=="PACK" IF DEFINED DUAL_SESSION IF DEFINED VDISK_FLAG GOTO:LIST_RUN_END -IF "%CURR_SESSION%"=="MULTI" IF NOT DEFINED DUAL_SESSION IF DEFINED MLT_SESSION IF NOT DEFINED PKX_SESSION CALL:MOUNT_INT&CALL:VDISK_DETACH +IF "%CURR_SESSION%"=="MULTI" IF NOT DEFINED DUAL_SESSION IF DEFINED MLT_SESSION IF NOT DEFINED PKX_SESSION CALL:MOUNT_INT&IF "%VDISK_ATTACHED%"=="1" CALL:VDISK_DETACH IF DEFINED VDISK_FLAG CALL:MOUNT_INT&CALL:VDISK_DETACH :LIST_RUN_END IF NOT DEFINED DUAL_SESSION FOR %%a in (DRIVER_QRY SC_PREPARE RO_PREPARE) DO (SET "%%a=") @@ -1245,6 +1245,7 @@ IF "%LIST_ITEM%:%LIST_TIME%"=="TASK:IA" CALL:TASK_ITEM IF "%LIST_ITEM%:%LIST_TIME%"=="WINSXS:IA" CALL:WINSXS_REMOVE IF "%LIST_ITEM%:%LIST_TIME%"=="EXTPACKAGE:IA" CALL SET "EXTPACKAGE=%PACK_FOLDER%\%BASE_MEAT%"&&CALL:PACK_ITEM IF "%LIST_ITEM%"=="MOUNT" IF DEFINED MLT_SESSION IF NOT DEFINED PKX_SESSION CALL:MOUNT_ITEM +IF "%LIST_ITEM%"=="UNMOUNT" IF DEFINED MLT_SESSION IF NOT DEFINED PKX_SESSION CALL:UNMOUNT_ITEM FOR %%a in (SC RO) DO (IF "%%a"=="%LIST_TIME%" CALL:SC_RO_CREATE) IF EXIST "$*" CALL:CLEAN EXIT /B @@ -1271,29 +1272,33 @@ IF "%LIST_ITEM%"=="TASK" CALL ECHO.REG DELETE "%HIVE_SOFTWARE%\Microsoft\Windows IF "%LIST_ITEM%"=="TASK" CALL ECHO.DEL /Q /F "%WINTAR%\System32\Tasks\%BASE_MEAT%"^>NUL 2^>^&^1>>"%PROG_FOLDER%\$%$RAS%.cmd" ECHO.EXIT /B>>"%PROG_FOLDER%\$%$RAS%.cmd" IF NOT "%WINPE_BOOT%"=="1" NET START $RAS>NUL 2>&1 -IF "%WINPE_BOOT%"=="1" CALL:RASTI_CREATEPE>NUL 2>&1 +IF "%WINPE_BOOT%"=="1" IF "%$RAS%"=="RAS" CALL CMD.EXE /C "%PROG_FOLDER%\$RAS.cmd" +IF "%WINPE_BOOT%"=="1" IF "%$RAS%"=="RATI" CALL CMD.EXE /C "%PROG_FOLDER%\$RAS.cmd">NUL 2>&1 :$RASTI_WAIT FOR %%a in (RAS RATI) DO (IF EXIST "%PROG_FOLDER%\$%%a.cmd" GOTO:$RASTI_WAIT) -IF EXIST "%PROG_FOLDER%\$LOG" FOR /F "TOKENS=* DELIMS=" %%a in (%PROG_FOLDER%\$LOG) DO (ECHO.%%a) +IF EXIST "%PROG_FOLDER%\$LOG" IF NOT "%LIST_ITEM%"=="SERVICE" IF NOT "%LIST_ITEM%"=="TASK" FOR /F "TOKENS=* DELIMS=" %%a in (%PROG_FOLDER%\$LOG) DO (ECHO.%%a) IF EXIST "%PROG_FOLDER%\$LOG" DEL /Q /F "%PROG_FOLDER%\$LOG">NUL 2>&1 EXIT /B -:RASTI_CREATEPE -CALL CMD.EXE /C "%PROG_SOURCE%\$RAS.cmd" -EXIT /B :RAS_DELETE IF "%WINPE_BOOT%"=="1" EXIT /B FOR /F "TOKENS=1 DELIMS= " %%a IN ('REG QUERY "HKLM\SYSTEM\ControlSet001\SERVICES\$RAS" /V ImagePath 2^>NUL') DO (IF "%%a"=="ImagePath" SC DELETE $RAS>NUL 2>&1) EXIT /B :PICK_ITEM EXIT /B +:UNMOUNT_ITEM +IF NOT "%VDISK_ATTACHED%"=="1" EXIT /B +CALL:VDISK_DETACH +IF EXIST "%VDISK_LTR%:\" SET "$HALT=1" +IF NOT EXIST "%VDISK_LTR%:\" SET "LIVE_APPLY=1"&&SET "VDISK_ATTACHED=" +EXIT /B :MOUNT_ITEM -IF "%LIST_ITEM%"=="MOUNT" IF DEFINED VDISK_ATTACHED EXIT /B -IF "%LIST_ITEM%"=="MOUNT" ECHO.&&SET "MENUT0=%BASE_MEAT%"&&SET "MENUT1= "&&SET "MENUT2= ( %##%@%#$% ) %##%Current-Environment%#$%"&&SET "MENUB0= "&&SET "MENUB1=%LIST_ACTN%"&&SET "PICK=VHDX"&&SET "NOCLS=1"&&SET "NOPAD=1"&&SET "LIVE_APPLY="&&CALL:FILE_PICK&&ECHO. -IF "%LIST_ITEM%"=="MOUNT" IF NOT DEFINED $PICK IF DEFINED LIVE_APPLY SET "VDISK_ATTACHED=SKIP"&&ECHO. Using live system as target.&&EXIT /B -IF "%LIST_ITEM%"=="MOUNT" IF NOT DEFINED $PICK IF NOT DEFINED LIVE_APPLY SET "$HALT=1"&&EXIT /B -IF "%LIST_ITEM%"=="MOUNT" IF DEFINED $PICK SET "VDISK=%$PICK%"&&SET "VDISK_LTR=ANY"&&CALL:VDISK_ATTACH -IF "%LIST_ITEM%"=="MOUNT" IF DEFINED $PICK IF EXIST "%VDISK_LTR%:\" SET "VDISK_ATTACHED=1" -IF "%LIST_ITEM%"=="MOUNT" IF DEFINED $PICK IF NOT EXIST "%VDISK_LTR%:\" SET "$HALT=1"&&EXIT /B +IF DEFINED VDISK_ATTACHED EXIT /B +ECHO.&&SET "MENUT0=%BASE_MEAT%"&&SET "MENUT1= "&&SET "MENUT2= ( %##%@%#$% ) %##%Current-Environment%#$%"&&SET "MENUB0= "&&SET "MENUB1=%LIST_ACTN%"&&SET "PICK=VHDX"&&SET "NOCLS=1"&&SET "NOPAD=1"&&SET "LIVE_APPLY="&&CALL:FILE_PICK&&ECHO. +IF NOT DEFINED $PICK IF DEFINED LIVE_APPLY SET "VDISK_ATTACHED=SKIP"&&ECHO. Using live system as target.&&EXIT /B +IF NOT DEFINED $PICK IF NOT DEFINED LIVE_APPLY SET "$HALT=1"&&EXIT /B +IF DEFINED $PICK SET "VDISK=%$PICK%"&&SET "VDISK_LTR=ANY"&&CALL:VDISK_ATTACH +IF DEFINED $PICK IF EXIST "%VDISK_LTR%:\" SET "VDISK_ATTACHED=1" +IF DEFINED $PICK IF NOT EXIST "%VDISK_LTR%:\" SET "$HALT=1" EXIT /B :COMMAND_ITEM IF NOT "%LIST_ACTN%"=="CMD" IF NOT "%LIST_ACTN%"=="REG" IF NOT "%LIST_ACTN%"=="REG_RAS" IF NOT "%LIST_ACTN%"=="REG_RATI" IF NOT "%LIST_ACTN%"=="CMD_RAS" IF NOT "%LIST_ACTN%"=="CMD_RATI" ECHO. %XLR4%ERROR: Command list action is not CMD, REG, CMD_RAS, CMD_RATI, REG_RAS, or REG_RATI.%#$%&&EXIT /B @@ -1665,7 +1670,7 @@ EXIT /B :LIST_MULTI_TEMPLATE CLS&&CALL:PAD_LINE&&CALL:BOXT1&&ECHO.&&ECHO. This feature is a work in progress.&&ECHO. It's a hybrid of a group base and an execution list, with&&ECHO. simple scripted tools in mind. A example list will be created.&&ECHO.&&ECHO. Enter new list name&&ECHO.&&CALL:BOXB1&&CALL:PAD_LINE&&CALL:PAD_PREV&&SET "PROMPT_SET=NEW_NAME"&&SET "PROMPT_ANY=1"&&CALL:PROMPT_SET IF NOT DEFINED NEW_NAME EXIT /B -(ECHO.MULTI-LIST&&ECHO.[GROUP][Mount VHDX list item][EXAMPLE]&&ECHO.[COMMANDQ]ECHO. Recommended to put this at the top of any subgroup.][CMD][IA]&&ECHO.[COMMANDQ]ECHO. Default is the live system when this item is not used.][CMD][IA]&&ECHO.[MOUNT][ AVAILABLE VHDXs:][ Select the filesystem target]&&ECHO.[COMMAND][DIR /B %%DRVTAR%%\][CMD][IA]&&ECHO.[COMMAND][REG QUERY %%HIVE_USER%%][REG][IA]&&ECHO.[GROUP][Item picker][UPCOMING]&&ECHO.[COMMANDQ]ECHO. Not implemented yet.][CMD][IA])>"%LIST_FOLDER%\%NEW_NAME%.list" +(ECHO.MULTI-LIST&&ECHO.[GROUP][Mount and Unmount VHDX list items][EXAMPLE]&&ECHO.&&ECHO.[MOUNT][ AVAILABLE VHDXs:][ Select the filesystem target]&&ECHO.&&ECHO.[COMMANDQ][ECHO.Recommended to put this at the top of any subgroup.][CMD][IA]&&ECHO.[COMMANDQ][ECHO.Default target is the live system when this item is not used.][CMD][IA]&&ECHO.[COMMAND][DIR /B %%DRVTAR%%\][CMD][IA]&&ECHO.[COMMAND][REG QUERY %%HIVE_USER%%][REG][IA]&&ECHO.&&ECHO.[UNMOUNT][Unmount VHDX][Detaches virtual disk if it was attached during this instance.]&&ECHO.&&ECHO.[COMMANDQ][ECHO.Recommended to put this at the bottomm of any subgroup.][CMD][IA]&&ECHO.[COMMANDQ][ECHO.Target returns to the live system following the usage of this item.][CMD][IA]&&ECHO.[COMMAND][DIR /B %%DRVTAR%%\][CMD][IA]&&ECHO.[COMMAND][REG QUERY %%HIVE_USER%%][REG][IA])>"%LIST_FOLDER%\%NEW_NAME%.list" START NOTEPAD.EXE "%LIST_FOLDER%\%NEW_NAME%.list" EXIT /B :LIST_COMMAND_CREATE @@ -1914,7 +1919,7 @@ EXIT /B CALL:BOXB2&&CALL:PAD_LINE EXIT /B :LIST_ITEMS -SET LIST_ITEMS1=APPX FEATURE COMPONENT CAPABILITY SERVICE TASK WINSXS DRIVER EXTPACKAGE COMMAND COMMANDQ PICK MOUNT +SET LIST_ITEMS1=APPX FEATURE COMPONENT CAPABILITY SERVICE TASK WINSXS DRIVER EXTPACKAGE COMMAND COMMANDQ PICK MOUNT UNMOUNT SET LIST_ITEMS2=# $0 $1 $2 $3 $4 $5 $6 $7 $8 $9 GROUP EXIT /B :IF_LIVE_EXT