A BUG in WinPE for Win11 22H2

Anonymous
2024-06-06T13:32:50+00:00

A BUG in WinPE for Win11 22H2

I write a batch file and run it in WinPE

focus at line

echo A %myWim1% %myWim2%

The %myWim2% can not get the currect value

and focus at line

set myWim1=%myWim2%

The %myWim1% can not get the currect value of %myWim2%

-----------------batch file -------------

@echo off

setlocal

rem set myWim0=d

set myWim1=\sources\install.wim

set myWim2=\sources\install.wim

%myWim0%:

md \wipe

cd \wipe

for /l %%i in (1000000,10000,9000000) do (

if exist c:\pagefile.sys (

cls

echo.

echo ..........It is running

set myWim2=\wipe\w%%i.tmp

echo.

echo.

set

echo.

echo A %myWim1% %myWim2%

echo A %myWim2%

pause

set myWim1=%myWim2%

)

)

endlocal

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.

0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-06-07T06:40:51+00:00

    Hello,

    Thank you for posting in Microsoft Community forum.

    Based on the description, I understand your question is related to A BUG in WinPE for Win11 22H2.

    1. Add setlocal enabledelayedexpansion at the beginning of your script instead of setlocal.
    2. Try replace %myWim1% and %myWim2% with !myWim1! and !myWim2! respectively in below. echo. echo A !myWim1! !myWim2! echo A !myWim2! pause set myWim1=!myWim2!

    Have a nice day.

    Best Regards,

    Molly

    0 comments No comments