powershell - Slow Windows shell performance using _hotkeys folder shortcuts for volume control -


i'm trying create native, global, focus-independent hotkey control incrementing/decrementing/mute-toggling system volume on windows, w10, though expect whatever solution find work through 7 , 8/8.1 well.

i have found - how can mute/unmute sound powershell - , works treat, within powershell window. ok, need type persistent , global then?

i created 3 files, -.ps1, +.ps1, , 0.ps1, include entire type definition linked post, , 1 liner each, follows:

[audio]::volume = [audio]::volume - .2
[audio]::volume = [audio]::volume + .2
[audio]::mute = [audio]::mute -bxor 1

technically, works, running each 1 pops open ps window 50 milliseconds or so. that's ugly, maybe unavoidable.

then found this, - how run powershell script without displaying window? - use psrun.exe. turns out in no case execute of these scripts. used shortcuts (.lnk) arguments , .cmd files, , got compilation errors.

so tried - https://www.faqforge.com/windows/how-to-execute-powershell-scripts-without-pop-up-window/ - using vbs helper hide window. works too, i'd rather not use vbs if possible.

i created folder, %homedrive%\users\\appdata\roaming\microsoft\windows\start menu_hotkeys, , put 1 shortcut each .ps1 files, , assigned alt-f6, alt-f7, , alt-f8 shortcuts.

when run 1 of shortcuts gui clicking, takes 100 milliseconds either .vbs or .ps1 directly. however, when running either shortcut via hotkey, takes more second!

i imagine there might 2 (or more) solutions:

  1. can increase performance of windows shell hotkey runs shortcut script file? realize call stack looks silly long seems should simple of task.

or

  1. can create persistent powershell window , run scripts use of global, focus-independent hotkey?

i'd entertain building tsr nothing silently awaits hotkeys volume control, seems less "nice" working out powershell.

and before ask, it's not performance issue hardware, i'm running w10x64 on i7-7700k 16gb of ram , 128gb m.2. running 40 firefox tabs , 25 applications gets me 20% cpu use , 40% ram use.

feel free slap me around if question has solid, functional answer , google-fu didn't find it. searches turned things across last 5 years, nothing conclusive or functional.

thanks going gently on first time poster.


Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -