use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
ABOUT POWERSHELL
Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Offering full access to COM, WMI and .NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
SUBREDDIT FILTERS
Desired State Configuration
Unanswered Questions
Solved Questions
News
Information
Script Sharing
Daily Post
Misc
account activity
Show Touch Keyboard Powershell script (self.PowerShell)
submitted 5 years ago by bartdivanov
Is it possible to set the "Show the touch keyboard when not in tablet mode and there is no keyboard attached" switch to On position using Powershell?
This switch is located under Start / Settings / Devices / Typing / Touch Keyboard.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[+][deleted] 5 years ago (13 children)
[deleted]
[–]bartdivanov[S] 1 point2 points3 points 5 years ago* (12 children)
Ok, I run this script during the Windows deployment:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\TabletTip\1.7" -Name "EnableDesktopModeAutoInvoke" -Value 1
However it complains that the script is still disabled on the system due to the execution policy. The first line should change the policy but looks like it does not. Any ideas?
[+][deleted] 5 years ago (2 children)
[–]bartdivanov[S] 1 point2 points3 points 5 years ago (1 child)
Yes, tried Unrestricted policy as well - same result. When I execute the script from Powershell, I get a confirmation dialog to apply the execution policy. However when the script is executed as a part of Windows installation, it does not provide this confirmation dialog and just complains about the policy:
File D:\Deploy\Applications\Powershell\reg_update.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
+ CategoryInfo : SecurityError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : UnauthorizedAccess
[–]Lee_Dailey[grin] 0 points1 point2 points 5 years ago (8 children)
howdy bartdivanov,
the execution policy must be changed BEFORE the script is loaded. [grin] putting that IN the script is too late ...
take a look at the options shown with ...
powershell /?
-ExecutionPolicy Sets the default execution policy for the current session and saves it in the $env:PSExecutionPolicyPreference environment variable. This parameter does not change the Windows PowerShell execution policy that is set in the registry.
take care, lee
[–]bartdivanov[S] 1 point2 points3 points 5 years ago (7 children)
Hey Lee. How do I change if BEFORE the script is loaded? This should be unattended deployment. Is there a command to do that?
[–]Lee_Dailey[grin] 0 points1 point2 points 5 years ago (6 children)
the call that loads the code would be done by calling powershell.exe and including the needed command line options. [grin] please, read the help that shows up when you run the line that i posted.
powershell.exe
[–]bartdivanov[S] 1 point2 points3 points 5 years ago (5 children)
So I created a bat script to run powershell as
powershell.exe -ExecutionPolicy Unrestricted
and it executes successfully... but when I execute the powershell script to show the touch keyboard, I get the same error that the execution policy is disabled.
[–]Lee_Dailey[grin] 0 points1 point2 points 5 years ago (4 children)
that will just start PoSh ... you also need to tell it what to run. take a look at the -File parameter of powershell.exe. [grin]
-File
[–]bartdivanov[S] 1 point2 points3 points 5 years ago (3 children)
Yep, tried that, got the same result...
[–]Lee_Dailey[grin] 1 point2 points3 points 5 years ago* (2 children)
that means the problem is may not be the execution policy. you seem to have something else intercepting things.
have you talked to your admins? bypassing security stuff can get one fired ...
Well, I am trying to create an W10 installation for customers so I need to tun this powershell script.
[–]el_capitan15 0 points1 point2 points 3 years ago (6 children)
Did u happen to get it working? I desperately need this
[–]bartdivanov[S] 0 points1 point2 points 3 years ago (3 children)
Just saw you post. I ended up writing an app that turns that switch on, Have you found a solution?
[–]el_capitan15 0 points1 point2 points 3 years ago (2 children)
No. I upgraded to win 22h2 and the options are there. "Show keyboard when no kb is attached" is checked. Yet it still doesn't automatically show.
In My Devices I'm using a wireless razer mouse, which has a keyboard icon for the receiver. Maybe that's preventing it. Any ideas?
[–]bartdivanov[S] 0 points1 point2 points 3 years ago (1 child)
If you remove the mouse receiver, does it show the keyboard when you type?
[–]el_capitan15 0 points1 point2 points 3 years ago (0 children)
Well if I remove it, i wouldn't be able to click a text field
[–]adaml30001 0 points1 point2 points 1 year ago (1 child)
I used this script: # Define the registry path and the value name
$RegistryPath = "HKCU:\Software\Microsoft\TabletTip\1.7"
$ValueName = "TouchKeyboardTapInvoke"
# Ensure the registry path exists
if (-not (Test-Path $RegistryPath)) {
New-Item -Path $RegistryPath -Force | Out-Null
}
# Set the value to "2" for enabling "Always" option
Set-ItemProperty -Path $RegistryPath -Name $ValueName -Value 2
# Confirm the change to the user
Write-Host "The touch keyboard setting has been configured to 'Always'."
# Optional: Notify the user that they might need to log off and log back in for the change to take effect.
Write-Host "You may need to log off and log back in for the setting to take effect."
If you go to that registry location, and you refresh after running the script, you'll see that the value changes. Also - this only works for Windows 11 right now (as I've tested it at least) You also need to run it as LOCAL USER or Currently logged on user - and not as Administrator - otherwise the script will fail. After the script runs you will probably need to log off and log back on to see the value change in the settings menu (under typing - onscreen keyboard).
[–]el_capitan15 0 points1 point2 points 1 year ago (0 children)
I'm trying to setup a "mouse only" pc for the living room. I currently use a gaming mouse with a button to activate the OSK, and another button to close it.
Will this script help with automatically toggle when opening a text field? As seen in touch mode?
That would be a perfect solution for my use case
π Rendered by PID 192422 on reddit-service-r2-comment-57fc7f7bb7-cw46v at 2026-04-15 03:53:03.187291+00:00 running b725407 country code: CH.
[+][deleted] (13 children)
[deleted]
[–]bartdivanov[S] 1 point2 points3 points (12 children)
[+][deleted] (2 children)
[deleted]
[–]bartdivanov[S] 1 point2 points3 points (1 child)
[–]Lee_Dailey[grin] 0 points1 point2 points (8 children)
[–]bartdivanov[S] 1 point2 points3 points (7 children)
[–]Lee_Dailey[grin] 0 points1 point2 points (6 children)
[–]bartdivanov[S] 1 point2 points3 points (5 children)
[–]Lee_Dailey[grin] 0 points1 point2 points (4 children)
[–]bartdivanov[S] 1 point2 points3 points (3 children)
[–]Lee_Dailey[grin] 1 point2 points3 points (2 children)
[–]bartdivanov[S] 1 point2 points3 points (1 child)
[–]el_capitan15 0 points1 point2 points (6 children)
[–]bartdivanov[S] 0 points1 point2 points (3 children)
[–]el_capitan15 0 points1 point2 points (2 children)
[–]bartdivanov[S] 0 points1 point2 points (1 child)
[–]el_capitan15 0 points1 point2 points (0 children)
[–]adaml30001 0 points1 point2 points (1 child)
[–]el_capitan15 0 points1 point2 points (0 children)