Keyboard Shortcut or PowerShell Command to Open Set up Repeat and Slow Keys - windows

I need to open "Set up Repeat and Slow Keys" in Control Panel through command prompt/PowerShell. But I am not able to do so. Any shortcut or command would be of much help.
Repeat Keys
I can able to open till this point,
Filter Keys
Any help would be much appreciated.

There's no documented shortcut direct to that page. If you need to amend the settings, this can be done through the registry and group policy
Disable Sticky Keys
HKCU\Control Panel\Accessibility\StickyKeys - Flags=506
Disable Filter Keys
HKCU\Control Panel\Accessibility\Keyboard Response] - Flags=122
Disable Toggle Keys
HKCU\Control Panel\Accessibility\ToggleKeys - Flags=58
Or for all NEW users:
Disable Sticky Keys
HKEY_USERS.DEFAULT\Control Panel\Accessibility\StickyKeys - Flags=506
Disable Filter Keys
HKEY_USERS.DEFAULT\Control Panel\Accessibility\Keyboard Response -
Flags=122
Disable Toggle Keys
HKEY_USERS.DEFAULT\Control Panel\Accessibility\ToggleKeys - Flags=58

This PowerShell script should work:
Add-Type -assembly System.Windows.Forms
& control.exe /name "Microsoft.EaseOfAccessCenter" /page "pageFilterKeysSettings"
Do {
Sleep 1
}
while( !(Get-Process | ? { $_.ProcessName -eq 'WindowsInternal.ComposableShell.Experiences.TextInput.InputApp' }) )
[System.Windows.Forms.SendKeys]::SendWait('{Tab 7}')
[System.Windows.Forms.SendKeys]::SendWait('{Enter}')

Related

Why the ShellFeedsTaskbarViewMode registry value unable to change

I'm facing a weird situation about editing the registry value.
I record an video here: https://www.youtube.com/watch?v=Au8NRF-SMDY
It because I want to turn off News and interests feeds by changing Registry directly. I'm changing a registry value from HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Feeds key and the ShellFeedsTaskbarViewMode value from 2 to 0. After the value changed without any error, I hit the Refresh (F5) immediately. Then the value changed back. I don't know what's going on. Does anyone can explain?
This answer from Ill_Branch1293 worked for me : https://www.reddit.com/r/sysadmin/comments/s1iomh/comment/hw0soe4/?utm_source=share&utm_medium=web2x&context=3
Here is the code:
# Turn off News and Interests
Write-Host "Turning off News and Interests..."
TASKKILL /IM explorer.exe /F
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds" -Name "ShellFeedsTaskbarViewMode" -Type DWord -Value 2
Start-Process explorer.exe

terminal shortcut for mail account switching using com.apple.mail.plist

Environment: OS X 10.14.3
I am trying to set up a keyboard short cut for mail.app using a terminal command to write to the plist file.
In Settings > Keyboard > Shortcuts > App Shortcuts, it is possible to set keyboard shortcuts to switch mail accounts. When set the short cut appears in the change mail menu when composing a new mail:
With these set, running defaults read com.apple.mail.plist generates this output:
{
NSUserKeyEquivalents = {
"john doe \\U2013 john.doe#gmail.com" = "#~^d";
"john doe2 \\U2013 john.doe2#gmail.com" = "#~^k";
"john doe3 \\U2013 john.doe3#gmail.com" = "#~^g";
};
}
If I delete one of this entries using the GUI interface in Settings > Keyboard > Shortcuts > App Shortcuts and try and reset it using the following terminal command:
defaults write com.apple.mail.plist NSUserKeyEquivalents -dict-add "john doe3 \\U2013 john.doe3#gmail.com" "#~^g"
the entry appears correctly when I query defaults read com.apple.mail.plist but it does not work in Mail nor does it appear in the GUI interface.
Does anyone know why this is not working?

How to enable FSRM quota with PowerShell

To disable FSRM quota with PowerShell is command below.
Set-FsrmQuota D:\test -Disabled
Please tell me how to enable with PowerShell.
Best regards,
I think you know how to open PowerShell. The command you gave is quite similar, but if you add "-Disabled" you basically just set a switch to tell the template to be disabled. You could use the switch in case you want to set a certain template, but do not want to have it enabled yet. Or just to disable it. To enable, first check the exact name of the template.
Run:
Get-FsrmQuotaTemplate
After that use the command Gert Jan gave you, with the exact name of the template you choose from the previous command, and run it:
Reset-FsrmQuota -Path "D:\Test" -Template "5 GB Limit"
Please note that "5 GB Limit" is the exact template name found with
the first command.
Now the template is set for the folder you chose.
If you want to set on a series of Homefolders for instance, you could do something like.
$homefolders = Get-ChildItem -Path "D:\home"
foreach($folder in $homefolders){
Reset-FsrmQuota -Path "D:\Test\$($folder.name)" -Template "5 GB Limit"
}
I hope this helps!

Searching For A Registry Value Then Change It

On all the Windows 10 computers I re-image, I want to disable the option in Sound for giving exclusive control to each device to applications. I have located the registry keys and values:
HKLM\Software\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Capture\RANDOM_STRING\Properties
HKLM\Software\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render\RANDOM_STRING\Properties
Within each of these keys (1st one is for Mics and 2nd is for Speakers) their are the two DWORD-32 values in each:
{b3f8fa53-0004-438e-9003-51a46e139bfc},3
{b3f8fa53-0004-438e-9003-51a46e139bfc},4
I want to basically make a batch script that will find these two values and set them to 0 for each audio devices. I'll have it run via Task Scheduler or something to make sure it gets new devices too.
The problem for me is that RANDOM_STRING portion of each path. Each one is ~25 random characters; it looks similar to the value names with the ,# at the end. I know how to change a value via a specific path, but here their is that randomized key name, and then new ones as new devices are plugged in.
Is their any way for me to create a batch file (or VBS/PowerShell) that will search the registry (or just Audio to narrow it down quicker) for those two values, and change their values to 0? Or if any other ways of going about this if so?
An example of the process I'd like (or again, something else similar):
Search for the DWORD-32 value "{b3f8fa53-0004-438e-9003-51a46e139bfc},3" within
the path
"HKLM\Software\Microsoft\Windows\CurrentVersion\MMDevices\Audio\"
and all the sub-keys within.
Set the value of the DWORD-32 value
"{b3f8fa53-0004-438e-9003-51a46e139bfc},3" to 0.
Search for the DWORD-32 value "{b3f8fa53-0004-438e-9003-51a46e139bfc},4" within
the path
"HKLM\Software\Microsoft\Windows\CurrentVersion\MMDevices\Audio\"
and all the sub-keys within.
Set the value of the DWORD-32 value
"{b3f8fa53-0004-438e-9003-51a46e139bfc},4" to 0.
I hope you know what are you doing. Manipulating registry is very risky. If you are absolutely sure, take a look at this script:
ls 'HKLM:\Software\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Capture\*\Properties\' | `
where {$_.Property -contains '{b3f8fa53-0004-438e-9003-51a46e139bfc},3'} | `
Get-ItemProperty -Name '{b3f8fa53-0004-438e-9003-51a46e139bfc},3'
#Set-ItemProperty -Name '{b3f8fa53-0004-438e-9003-51a46e139bfc},3' -Value 0
Make sure this script (with Get-ItemProperty) gets only desired keys. To change values, replace last line with commented one. Make sure you have proper permissions. And finally: do it at you own risk :)
I was unable to get the other answer working. I am trying to ban the Netflix app from being unbearably loud (which it does if it gets exclusive control of the sound device) every time I reinstall the geforce drivers (when the exclusive control resets).
So:
Get-ChildItem -recurse -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render\'| `
Foreach-Object { if ($_.Property -eq '{b3f8fa53-0004-438e-9003-51a46e139bfc},3') {$_|Get-ItemProperty -Name '{b3f8fa53-0004-438e-9003-51a46e139bfc},3'} }`
Gives me this output:
{b3f8fa53-0004-438e-9003-51a46e139bfc},3 : 0
PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\
Windows\CurrentVersion\MMDevices\Audio\Render\{94743724-8af1-4abc-8d45-275
7184ec5f2}\Properties
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\
Windows\CurrentVersion\MMDevices\Audio\Render\{94743724-8af1-4abc-8d45-275
7184ec5f2}
PSChildName : Properties
PSProvider : Microsoft.PowerShell.Core\Registry
{b3f8fa53-0004-438e-9003-51a46e139bfc},3 : 0
PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\
Windows\CurrentVersion\MMDevices\Audio\Render\{b4ed07ae-0ee7-4ffb-8370-8bb
08a59a941}\Properties
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\
Windows\CurrentVersion\MMDevices\Audio\Render\{b4ed07ae-0ee7-4ffb-8370-8bb
08a59a941}
PSChildName : Properties
PSProvider : Microsoft.PowerShell.Core\Registry
This looks good.
To write it the Get-ItemProperty needs to change to Set-ItemProperty but it results in a security error, please consult https://stackoverflow.com/a/35844259/308851 to take ownership of the relevant key.

Not able to spawn off email message from windows search in powershell

I have a powershell script that is searching the Windows Search index directly for emails and files. I have the following code:
$searchme="my thing to find"
$sql="SELECT System.FileName, System.ItemPathDisplay, System.DateCreated, System.DateModified, system.itemurl, system.itemtypetext FROM SYSTEMINDEX WHERE Contains(System.FileName, '"+$searchme+"') OR Contains('"+$searchme+"')"
$adapter = new-object system.data.oledb.oleDBDataadapter -argumentlist $sql, "Provider=Search.CollatorDSO;Extended Properties=’Application=Windows’;"
$ds = new-object system.data.dataset
$adapter.Fill($ds)
foreach ($record in $ds.Tables[0].Rows)
{
$exeparams = $record[4]
write-host $exeparams
write-host $exeparams.split(":")[0]
if ($exeparams.split(":")[0] -eq "mapi15")
{
$exeparams2="mapi://" + $exeparams.substring(8)
}
write-host $exeparams
write-host "start"
$exe="start"
$exe+" "+$exeparams | Out-File 'file.txt' -encoding Unicode
write-host "start-process"
Start-Process $exeparams
Start-Process $exeparams2
write-host "andpersand process"
&$exe $exeparams
&$exe $exeparams2
write-host "dotnet"
$proc = [Diagnostics.Process]::Start($exeparams)
$proc.WaitForExit()
$proc = [Diagnostics.Process]::Start($exeparams2)
$proc.WaitForExit()
}
There are several "shell" calls because I was trying to figure out if it was a process spawning issue. Files work with no issue. Emails however fail with either No such interface if i leave mapi15, or Unspecified error if i change mapi15 to mapi. I believe that Open mails in outlook from java using the protocol "mapi://" may be the solution, but if it is I am not sure how to apply this in powershell. Thank you for your help.
Ok, that took more work than I expected, and I blame Office 2013 for it. Here's the short answer:
$exeparams2 = $exeparams -replace "^mapi15", "mapi"
& start $exeparams2
That is the code that now opens an email for me. That code did not do that yesterday, all it did is tell me:
Either there is no default mail client or the current mail client cannot fulfill the messaging request. Please run Microsoft Outlook and set it as the default mail client.
Infuriating is what this was, because I did have Outlook, in fact it was running, and was the default mail application for everything email related. This annoyed me, and sent me on a quest to figure out WTF was wrong, and if I could fix it. The answers to that are "I'm not real sure WTF was wrong, except maybe a naming change on MS's part", and "yes, yes I can fix it".
I finally found the fix that worked for me (and I believe that this is probably Office 2013/Office 365 specific) was found at the bottom of this thread:
https://social.technet.microsoft.com/Forums/office/en-US/64c0bedf-2bcd-40aa-bb9c-ad5de20c84be/cannot-send-email-with-microsoft-outlook-2010-64-bit-from-adobe-outlook-not-recognised-as?forum=outlook
The process is simple. Change 2 Registry Entries, then re-set your default mail application. Registry entries:
HKLM:\Software\Clients\Mail(default)
HKLM:\Software\Clients\Mail\Microsoft Outlook(default)
Change the value of (Default) from "Microsoft Outlook" to simply "Outlook".
After that I set Outlook to be the default for everything it could be ( in Win8 that's Control Panel > All Control Panel Items > Default Programs > Set Default Programs then select Outlook, and choose the first option to make it default for all extensions that it is registered for). Once that was done I was able to run the modified code above to launch an email that I had search the index for.

Resources