Please note that this is Turkish Q&A Forum, any threads should be posted in Turkish. However, I will still provide an answer on English based on your initial response.
Hi engin çiçek,
I understand that %windir% is producing an error while you are using an unattended Windows 11 installation.
Please note that %windir% is an environment variable, not a command by itself. It normally expands to the Windows directory, such as C:\Windows. If %windir% is entered alone in Command Prompt, Windows may try to execute the expanded folder path and return an error.
The result can also depend on when the command runs. During the Windows PE or early Setup phase, %windir% may refer to the Windows PE environment rather than the Windows 11 installation on the target drive. This could cause an application installer or script to use the wrong path.
Could you please provide the following details?
- The exact command or relevant section of your
Autounattend.xmlorUnattend.xmlfile - The complete error message or error code
- The configuration pass where the command runs, such as
windowsPE,specialize, oroobeSystem - Whether the command works after Windows 11 finishes installing
- Whether the ISO is an official Microsoft ISO or a customized image
Please remove any product keys, passwords, usernames, or other personal information before sharing the file or screenshot.
You may also test the command with cmd.exe /c and use echo %windir% to confirm which Windows directory the variable resolves to at that stage. If the command is intended to install applications into the completed Windows installation, it may need to run during a later configuration pass rather than during Windows PE.
For reference, Microsoft explains the Windows Setup configuration passes and unattended answer files here: Answer files (unattend.xml) Thank you so much for your understanding.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.