Hi
Welcome to Microsoft community.
I understand that you are trying to run a batch file or cmd script during the Windows 11 setup process, specifically when the OOBE (Out-Of-Box Experience) Language selection screen comes up. However, it seems like your script is running slightly before the OOBE screen, causing some commands to not be recognized.
This is a complex issue that might require more in-depth knowledge of your exact setup and script. However, you could consider the following:
- Delay the script: You could try adding a delay at the start of your script to ensure the OOBE has fully loaded before the script starts running. In a batch file, you can use the
timeout /t <seconds>command to add a delay. - Use SetupComplete.cmd: You could try using the SetupComplete.cmd method. This cmd file is meant to be run after OOBE completes, but perhaps it could work for your situation. The SetupComplete.cmd file should be located in
%WINDIR%\Setup\Scripts\SetupComplete.cmd - Use Windows Setup scripts: Windows Setup supports the configuration of scripts that can run at different points during the installation process. You might be able to leverage this feature to run your script at the correct time.
- Modify your autounattend.xml file: It might be possible to modify your autounattend.xml file to run the script at the correct time. However, this would require a good understanding of this file and the Windows Setup process.
Please let me know if you need any further assistance. Thank you.
Best regards
Derrick Qian | Microsoft Community Support Specialist