Like most people with "hybrid" touchscreen devices on Windows 8 or 8.1 (Windows 10 isn't an option for me right now for various reasons), I'm constantly annoyed by the "metro-style" on-screen keyboard popping up automatically even though I have an actual physical keyboard connected.

The best answer to this problem, without disabling the service completely (because I do sometimes use the device without a physical keyboard) is to open then minimise the old-school desktop-style on-screen keyboard. That application being open, even when minimised, stops the touchscreen metro-style keyboard popping up.

However, this also creates a (smaller) nuisance:

  • It's something I have to do every time I start up the computer
  • It un-minimises every time I put the computer to sleep, partially covering the lock screen, the picture password screen, and the Start screen.

Is there any way (bat script for example?) that I can make the onscreen keyboard open then minimise every time the computer starts up from shut down or from sleep?

  • If you know a bit about programming, I'm fairly confident you could do something with that. I'm not posing an answer because I don't actually know how, because I'm a novice at most desktop-based things, but I'm sure it's possible, even if it's just moving the mouse to the right position and clicking.
    – anon
    Nov 18, 2015 at 3:40
  • I think an Autohotkey script that automatically does the starting and minimising for you is a good solution. With Autohotkey you can click the mouse, and do keypresses, which combined make it possible for you to start and minimise the old-school desktopy-style on-screen keyboard. Adding this script to startup would make sure this goes automatically when starting. I am not sure whether or not you can use it to fix your lock-screen issue, opening and minimising something in lock-screen can be a challenge. Could you add a picture of that and exactly what you want fixed in this lock-screen?
    – BramMooij
    Nov 23, 2015 at 9:45
  • @BramMooij Screenshots in lock screen don't work unfortunately. Basically, on turning it on from sleep, if the old-school on screen keyboard was minimised, the lock screen has that keyboard floating on top of everything. If I minimise it, it comes back on the picture-password screen. If I minimise it there too, it comes back on the start screen. Someone managed to screen grab it on the start screen, here's an example. It's not the end of the world, it's just a frequent annoyance. Nov 23, 2015 at 9:56
  • 1
    Thanks for the extra info. I'll take a look when I have time and see if I can figure that one out. I think the easiest solution is to have a script run at startup to start and minimise the keyboard, and run another at shutdown that changes the setting to not use osk.exe after startup (which windows automatically changes after you start osk.exe). To add a program at shutdown go to "edit group policy->computer configuration->windows settings->scripts->shutdown. The start and minimise script will be easy, the change osk policy I don't know.
    – BramMooij
    Nov 23, 2015 at 10:28
  • @BramMooij The Task Scheduler doesn't have an 'On workstation shutdown' event, but it does have a 'On workstation lock' that could be used to stop the osk using something like taskkill /IM osk.exe (elevation needed; also available via nircmd in nircmd elevate taskkill /IM osk.exe).
    – kodybrown
    Nov 26, 2015 at 18:38

2 Answers 2


It sounds like BramMooij is onto a potential answer. I have an alternative suggestion that I have tested if his answer doesn't pan out.

First download nircmd if you don't already have it.

Create a batch file wherever you please and put the following code into it...

PING -n 3>nul
"locationOfNircmd\nircmd.exe" win hide title "On-Screen Keyboard"

Add the batch file to Task Scheduler as the action, and set the trigger as wake up from sleep or shutdown.

You may need to alter the "3" in the ping line depending on the performance of your computer, as osk sometimes takes a little while to appear in my testing (it is just a delay action in seconds). You will also need to replace LocationOfNircmd to where you copied those files. In my tests this task needs to be run as administrator in order to hide the keyboard.

  • Nice solution. I'm not sure it will work in the lock-screen though. It seems my ahk is on a dead end for now, so the OP might need a combination of our answers to get this to work.
    – BramMooij
    Nov 23, 2015 at 11:10
  • 1
    Alternatively, instead of using "PING -n 3>nul", you could use cmdwait, also included in the Nircmd package. Syntax: cmdwait xxxx where xxxx is the time in milliseconds.
    – BramMooij
    Nov 23, 2015 at 12:12
  • OP, have you tried this on your lock screen? Nov 28, 2015 at 15:56
  • I've only just had time to properly try it out, looks promising. Can you add more detail about how to set up the Task Scheduler task so that it is triggered on wake from sleep or shutdown, and so it runs the script as administrator? Also, while the bat file does work, each time it brings up a NirCMD popup which is as annoying as the OSK - is there any way to prevent this from popping up? Nov 30, 2015 at 14:36
  • Sorry I don't have access to a computer I am able to test this on at the moment as I'm travelling. The "Run as administrator" is on the first tab of the task properties if I remember correctly. The command should be able to be run minimised in the task options, but I forget the details of that. If you can't find it in 1 week I can help further and provide a vbs that runs the batch completely invisibly. Dec 1, 2015 at 1:31

I think I have a solution for your second problem.

Instead of getting rid of the osk window, you could change the position of the osk window to not be in your way. Open regedit, go to: HKEY_CURRENT_USER\Software\Microsoft\Osk.

Here you can set the WindowWidth, WindowHeight, and also WindowTop and WindowLeft. By changing the values for WindowTop and WindowLeft you can change the position. If you set both to 1 the osk window will start in the top left corner of your screen. You could use this to move the Window to a non-annoying position, then you only have the minimise after logon issue left.

I'm still working on the solution to your first problem. I made an autohotkey script to minimise the osk.exe window with a mouse click (assuming you know the position), but osk.exe acts different to most other programs. You cannot minimise it from the command line, and my autohotkey script can click everything but the osk window. It seems like the osk Window is sort of overlaying the rest causing the ahk mouseclick to disappear behind the window. I will try to figure this out and report back with the complete answer if I manage to find it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .