2

When I boot from the a Windows 11 USB flash drive installer, the wireless keyboard and mouse do not work. I have a wired mouse that I can use, but no wired keyboard. I currently have the latest Windows 10 (22H2) installed and I want to do a clean install of Windows 11. The machine does not meet the minimum requirements for a normal (recommended) Windows 11 install. I intend to use Windows commands such as diskpart, dism and bcdboot to do a (not recommended) install of Windows 11. So, how can I get an on-screen keyboard that can be used to enter these commands?

I have seen the question How to start on-screen-keyboard when installing windows. I assume once I reach a similar point in the installation of Windows 11 as given in the accepted answer, I will be able to get an on-screen keyboard. This question has to do with getting an on-screen keyboard before I reach such a point.

David Anderson
  • 883
  • 1
  • 8
  • 13
  • Do you have a Command Prompt ? Does it have some text including the letters O S K ? If not , can you select & copy D I R & a new line , then paste 1 character at a time ? When you get letters O S K on the screen , copy that with a new line , then paste 1 character at a time to start "osk.exe" which should start the on screen keyboard. – Prem Oct 22 '22 at 08:14
  • @Prem: That is a great answer, but there is no `osk.exe` in the path. The only `osk.exe` that I can find is in the `C:\Windows\System32` folder. – David Anderson Oct 22 '22 at 08:40
  • For what do you need the keyboard before reaching the stage as indicated in the link? – harrymc Oct 22 '22 at 08:53
  • The suggested (and safest) way by Microsoft is to let the installation do the job for you. The Microsoft link you gave pertains to restoring the backup disk image of *an already installed Windows 11*, which does not pertain to your only having the installation media. – harrymc Oct 22 '22 at 09:03
  • Yes , you have to Select + Copy + Paste the characters in "C:\Windows\System32\osk.exe" , 1 at a time & then 1 new line , to start that On Screen Keyboard ! – Prem Oct 22 '22 at 09:37
  • @Prem: I was thinking more towards first booting to Windows 10 and copying `osk.exe` and `OskSupport.dll` to the root folder of the flash drive. Then there would be less Select + Copy + Paste when booted from the flash drive. Also, I will be reformatting drive C: and I am not sure what happens if the on-screen keyboard application is erased after execution starts. – David Anderson Oct 22 '22 at 09:58
  • @Prem: Could you post an answer so I can accept? I ended up using Windows 10 to copy `osk.exe` and `OskSupport.dll` to the root folder on the flash drive. Next, I renamed `osk.exe` to `sources.exe`. So when I booted from the flash drive, I only needed to Select + Copy + Paste the characters in `e:\sources` followed by a return. (Note: the prompt was `X:\sources>`) – David Anderson Oct 22 '22 at 12:29
  • Why install a crippled operating system instead of a fully functional one? – harrymc Oct 22 '22 at 13:14
  • Posting that now , @DavidAnderson – Prem Oct 22 '22 at 16:01

2 Answers2

1

(A) When at the Command Prompt , there may be some text including the letters O S K visible.
Copy the 3 letters , then paste 1 character at a time , then copy 1 new line to start "osk.exe" which should start the On Screen Keyboard.

(B) Even in case these letters are not there , you can select & copy D I R & a new line , then paste 1 character at a time. There will be a lot of output with more chances of getting the letters O S K on the screen.
Copy that with a new line , then paste 1 character at a time to start "osk.exe" which should start the On Screen Keyboard.

Here is a ScreenShot (on very old machine) with the copied text (highlighted in green boxes) , & the attempt to copy the new line :

DIR

(C) In case these letters are still not available , you can try "typing" the letters in "explorer" with this mouse method to start that & navigate to "C:\Windows\System32\osk.exe" , to start the On Screen Keyboard.

(D) In case "explorer" too is not there , try "taskmgr" , then right-click some executable & select to show the file location to start Explorer & navigate to "osk.exe" & thus start that.

(E) Alternately , if you can before-hand copy some files , then try to copy the "osk.exe" to something easier to "type" with the mouse method , & put that in a location easier to access.
[[ Here , this is what OP eventually got to !! OP had to copy "OskSupport.dll" too ]]

Prem
  • 1,282
  • 2
  • 12
  • 22
  • 1
    "explorer" is there, but will not open. "taskmgr" will open, but does not have "show the file location" (or "open file location"). Also, the "taskmgr" Browse button does not work. However, I can "type" the letters in "notepad" with the **mouse method**, then use open to navigate to and run `osk.exe` as shown in this [image](https://imgur.com/a/umFyx9e). The result is shown [here](https://imgur.com/a/fkh07Bu). – David Anderson Oct 22 '22 at 17:36
  • Some More Possibilities : When we have "taskmgr" via mouse method , we might use "file menu" to "run new task" & navigate to the osk executable & When we have access to notepad via mouse method , we can before-hand copy common & necessary commands to a text file , then copy-paste those commands. High-light : When using mouse method to initiate some key strokes early in the Process , we can move in a variety of Directions later in the Process ! – Prem Oct 23 '22 at 10:53
  • I already explained problems regarding the taskmgr. When you click on the Browse button, as shown in this [image](https://imgur.com/a/qhsxTgj), NOTHING HAPPENS. At this point, I assume you are testing using a fully installed Windows. This is ***not the same*** as when first booted from a Windows 11 installer USB flash drive. (In case you are wondering, I am using a virtual machine to make these images you are viewing. The images represent what I see when trying to install on the different actual real machine.) – David Anderson Oct 23 '22 at 16:20
  • Oh ok , I got that now ! I was thinking that the task manager list "right click" was not working , & now I see that even the file menu is not working too ! A Doubt : That Image looks like the "classic" task manager , not the "newer" version (( https://winaero.com/get-classic-old-task-manager-in-windows-10/ )) Is that intentional ? – Prem Oct 23 '22 at 16:22
  • Here is an [image](https://imgur.com/a/Lu0xmH2) of "Open File Location". Like the Browse button, when selecting "Open File Location" nothing happens. As regarding what the `taskmgr` looks like on a machine with Windows 11 installed, here is a [image](https://imgur.com/a/vomGrlI). I suppose there is a difference. I never thought about looking at the `taskmgr` during a Windows install until you mentioned it. – David Anderson Oct 23 '22 at 17:01
  • Prem: If you doubt what the task manger looks like, then you have never booted from a Windows 11 installer to verify any method posted in your answer. In fact at this point, most of what you have posted does not actually work when booted from a Windows 11 installer. I believe your answer is useful, if one takes the time to determine which parts actually work. – David Anderson Oct 24 '22 at 11:30
  • The summary or crux of my answer is the **mouse method** to somehow **copy&paste characters visible** on the Command Prompt to (Directly or InDirectly) start `OSK` without keyboard. All my other comments are just **variations** to generate visible characters via `DIR` or which `Intermediate tool` to use or Etc. I have given some alternatives because some commands might not work in the Initial Stages. Your two alternatives are great too (+1 there) , which I have not tried yet & I have not even installed Win11 !! – Prem Oct 24 '22 at 13:09
1

This answer offers two alternatives to using Prem's answer. Although, I feel the proper application of Prem's answer would be the easiest to implement.

Alternative #1

You can use the following (or edit an existing) AutoUnattend.xml file to have the on-screen keyboard open automatically. This file needs to be placed in the root directory of the volume on the flash drive installer. Once the on-screen keyboard appears, enter the shift+F10 key combination to open a Command Prompt window. An example AutoUnattend.xml file is given below and is also available for download from Pastebin.

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="windowsPE">
        <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <UserData>
                <ProductKey>
                    <WillShowUI>Always</WillShowUI>
                </ProductKey>
            </UserData>
            <RunAsynchronous>
                <RunAsynchronousCommand wcm:action="add">
                    <Order>1</Order>
                    <Path>cmd /c "for %i in (x g f e d c) do if exist %i:\windows\system32\osk.exe (start /b %i:\windows\system32\osk.exe & exit)"</Path>
                </RunAsynchronousCommand>
            </RunAsynchronous>
        </component>
    </settings>
</unattend>

For this to work, the files osk.exe and OskSupport.dll files need to exist in the Windows\System32 folder on drive X:, G:, F:, E:, D: or C:. The drives are searched in this order. This was tested using the files from either Windows 10 22H2 or Windows 11 22H2. I would recommend creating a Windows\System32 folder in the volume on the flash drive installer, then copying these two files to this folder.

Since an AutoUnattend.xml file can prevent shutdown down through the GUI, one may consider also copying the file shutdown.exe to the flash drive. This would allow the command below to be used to shutdown the computer. Here, the drive letter assigned to the USB Windows installer flash drive is the letter D:. If your drive letter is different, then make the appropriate substitution.

d:\windows\system32\shutdown /s /t 0

Alternative #2

You can edit the registry to have the on-screen keyboard open automatically when a Command Prompt windows opens. For this to work, the files osk.exe and OskSupport.dll files need to exist in the X:Windows\System32 folder. This was tested using the files from either Windows 10 22H2 or Windows 11 22H2.

To make the changes, open a Command Prompt windows as an Administrator, then enter the following commands. The commands copy the two files and edit the registry. (Here, the shutdown.exe file is also copied. See Alternative #1 for an explanation.)

Note: If the drive letter assign to the Windows installer USB flash drive is not D:, then make the appropriate substitution when entering d:\sources\boot.wim.

cd /d %userprofile%
md offline
dism /mount-wim /wimfile:d:\sources\boot.wim /index:2 /mountdir:offline
copy c:\windows\system32\osk.exe offline\windows\system32
copy c:\windows\system32\osksupport.dll offline\windows\system32
copy c:\windows\system32\shutdown.exe offline\windows\system32
reg load HKLM\OFFLINE offline\Windows\System32\Config\SOFTWARE
reg add "HKLM\OFFLINE\Microsoft\Command Processor" /v AutoRun /t REG_EXPAND_SZ /d osk /f
reg unload HKLM\OFFLINE
dism /unmount-image /mountdir:offline /commit
rd offline

If wish to shutdown the computer after booting from the USB flash drive Windows installer, then you can enter the command below.

shutdown /s /t 0
David Anderson
  • 883
  • 1
  • 8
  • 13