This works:
Code: Select all
::--------------------------------------------------------------------------------------------------------------------------
%@Pre% @DelayedExpansion.Toggleoff
::(
echo on
set ^"@DelayedExpansion.Toggleoff=( %$n1c%
echo. ^&set /p "?= Delayed Expansion is" ^<nul %$n1c%
if /i ["!"] neq [""] ( %$n1c%
set "Expansion=disabled" %$n1c%
set /p "?= [disabled]" ^<nul %$n1c%
) else ( %$n1c%
set "Expansion=enabled" %$n1c%
set /p "?= [enabled]" ^<nul %$n1c%
setlocal DisableDelayedExpansion %$n1c%
) %$n1c%
echo. ^&set /p "?= Delayed Expansion is" ^<nul %$n1c%
if /i ["!"] neq [""] ( %$n1c%
set "Expansion=disabled" %$n1c%
set /p "?= [disabled]" ^<nul %$n1c%
) else ( %$n1c%
set "Expansion=enabled" %$n1c%
set /p "?= [enabled]" ^<nul %$n1c%
) %$n1c%
)"
::)
%@Post% @DelayedExpansion.Toggleoff [OK]
::--------------------------------------------------------------------------------------------------------------------------
%@DelayedExpansion.Toggleoff%
pause
exit
This also works:
Code: Select all
::--------------------------------------------------------------------------------------------------------------------------
%@Pre% @DelayedExpansion.Get.State
::(
set "@DelayedExpansion.Get.State=echo. &set /p "?= Delayed Expansion is" <nul &if /i ["!"] neq [""] ( set "Expansion=disabled" &set /p "?= [disabled]" <nul ) else ( set "Expansion=enabled" &set /p "?= [enabled]" <nul )"
::)
%@Post% @DelayedExpansion.Get.State [OK]
::--------------------------------------------------------------------------------------------------------------------------
::--------------------------------------------------------------------------------------------------------------------------
%@Pre% @DelayedExpansion.Toggleoff
::(
set "@DelayedExpansion.Toggleoff=echo. &set /p "?= Delayed Expansion is" <nul &if /i ["!"] neq [""] ( set "Expansion=disabled" &set /p "?= [disabled]" <nul &setlocal DisableDelayedExpansion ) else ( set "Expansion=enabled" &set /p "?= [enabled]" <nul &setlocal DisableDelayedExpansion ) &%@DelayedExpansion.Get.State%"
::)
%@Post% @DelayedExpansion.Toggleoff [OK]
::--------------------------------------------------------------------------------------------------------------------------
I am simply trying to split it in two counterparts:
Code: Select all
::--------------------------------------------------------------------------------------------------------------------------
%@Pre% @DelayedExpansion.Get.State
::(
set ^"@DelayedExpansion.Get.State=( %$n1c%
echo. ^&set /p "?= Delayed Expansion is" ^<nul %$n1c%
if /i ["!"] neq [""] ( %$n1c%
set "Expansion=disabled" %$n1c%
set /p "?= [disabled]" ^<nul %$n1c%
) else ( %$n1c%
set "Expansion=enabled" %$n1c%
set /p "?= [enabled]" ^<nul %$n1c%
) %$n1c%
)"
::)
%@Post% @DelayedExpansion.Get.State [OK]
::--------------------------------------------------------------------------------------------------------------------------
Code: Select all
::--------------------------------------------------------------------------------------------------------------------------
%@Pre% @DelayedExpansion.Toggleoff
::(
echo on
set ^"@DelayedExpansion.Toggleoff=( %$n1c%
echo. ^&set /p "?= Delayed Expansion is" ^<nul %$n1c%
if /i ["!"] neq [""] ( %$n1c%
set "Expansion=disabled" %$n1c%
set /p "?= [disabled]" ^<nul %$n1c%
) else ( %$n1c%
set "Expansion=enabled" %$n1c%
set /p "?= [enabled]" ^<nul %$n1c%
setlocal DisableDelayedExpansion %$n1c%
) %$n1c%
echo. ^&set /p "?= Delayed Expansion is" ^<nul %$n1c%
%@DelayedExpansion.Get.State% %$n1c%
)"
%@DelayedExpansion.Toggleoff%
pause
exit
::)
%@Post% @DelayedExpansion.Toggleoff [OK]
::--------------------------------------------------------------------------------------------------------------------------
Just doesn't work