• How to add Win+R RUN box to the Windows right click context menu

    From Bill Powell@21:1/5 to All on Fri Jun 14 00:35:16 2024
    XPost: alt.msdos.batch

    I use the Win+R "run" box a thousand times a day (mostly because I
    create dozens of one-word commands using the Windows Registry AppPaths key
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\

    As you know, the shortcut link to the RUN box is located here by default.
    C:\Users\username\AppData\Roaming\Microsoft\Windows\
    Start Menu\Programs\System Tools\Run.lnk

    I already have that RUN box shortcut pinned to the taskbar, but what I'd
    like to add is a RUN box option to the right-click context menu.

    I already have something similar in the context menu, which is the "open command window here" option - so all I want to do is add another line to
    the rightclick context menu of something like "Open RUN box here".

    Here's a way to add the "Open command window here" to the rightclick menu.
    https://www.windowscentral.com/add-open-command-window-here-back-context-menu-windows-10

    In that method, they change HKEY_CLASSES_ROOT\Directory\shell\cmd key value
    of "HideBasedOnVelocityId" to "ShowBasedOnVelocityId" (which magically adds "Open command window here" option to the shift-rightclick context menu).

    The value of the DWORD is set to 639bc8 which is what gives it the magic.
    https://www.askvg.com/windows-10-tip-restore-open-command-window-here-option-in-shiftright-click-menu/

    I tried that, and it works perfectly, but what I want to do is modify that, somehow, so that it will "Open RUN box here" (or something to that effect).

    Does anyone on this newsgroup know Windows well enough to modify that
    sequence to instead of adding "open command window here" to the context
    menu, but to add the RUN box to the rightclick context menu instead?
    --
    The "magic" is in the ShowBasedOnVelocityId value - not in the name. https://superuser.com/questions/1152821/why-is-hidebasedonvelocityid-flag-set-in-registry-entry

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From VanguardLH@21:1/5 to Bill Powell on Thu Jun 13 19:46:22 2024
    Bill Powell <bill@anarchists.org> wrote:

    I use the Win+R "run" box a thousand times a day (mostly because I
    create dozens of one-word commands using the Windows Registry AppPaths key
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\

    As you know, the shortcut link to the RUN box is located here by default.
    C:\Users\username\AppData\Roaming\Microsoft\Windows\
    Start Menu\Programs\System Tools\Run.lnk

    I already have that RUN box shortcut pinned to the taskbar, but what I'd
    like to add is a RUN box option to the right-click context menu.

    I already have something similar in the context menu, which is the "open command window here" option - so all I want to do is add another line to
    the rightclick context menu of something like "Open RUN box here".

    Here's a way to add the "Open command window here" to the rightclick menu.
    https://www.windowscentral.com/add-open-command-window-here-back-context-menu-windows-10

    In that method, they change HKEY_CLASSES_ROOT\Directory\shell\cmd key value of "HideBasedOnVelocityId" to "ShowBasedOnVelocityId" (which magically adds "Open command window here" option to the shift-rightclick context menu).

    The value of the DWORD is set to 639bc8 which is what gives it the magic.
    https://www.askvg.com/windows-10-tip-restore-open-command-window-here-option-in-shiftright-click-menu/

    I tried that, and it works perfectly, but what I want to do is modify that, somehow, so that it will "Open RUN box here" (or something to that effect).

    Does anyone on this newsgroup know Windows well enough to modify that sequence to instead of adding "open command window here" to the context
    menu, but to add the RUN box to the rightclick context menu instead?

    Not sure how having to right-click the mouse to move the pointer to a
    Run Box entry (similar to right-clicking on the Start Menu button to
    pick Run) is easier or faster than using Win+R to open the Run box.

    However, since you know how to add a context menu entry for Command
    Prompt Here, you can do the same to add a context menu entry to run:

    explorer.exe Shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}

    That opens the Run box dialog.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bill Powell@21:1/5 to VanguardLH on Fri Jun 14 03:38:35 2024
    XPost: alt.comp.os.windows-11, alt.msdos.batch

    On Thu, 13 Jun 2024 19:46:22 -0500, VanguardLH wrote:

    Bill Powell <bill@anarchists.org> wrote:

    I use the Win+R "run" box a thousand times a day (mostly because I
    create dozens of one-word commands using the Windows Registry AppPaths key >> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\

    As you know, the shortcut link to the RUN box is located here by default.
    C:\Users\username\AppData\Roaming\Microsoft\Windows\
    Start Menu\Programs\System Tools\Run.lnk

    I already have that RUN box shortcut pinned to the taskbar, but what I'd
    like to add is a RUN box option to the right-click context menu.

    I already have something similar in the context menu, which is the "open
    command window here" option - so all I want to do is add another line to
    the rightclick context menu of something like "Open RUN box here".

    Here's a way to add the "Open command window here" to the rightclick menu. >> https://www.windowscentral.com/add-open-command-window-here-back-context-menu-windows-10

    In that method, they change HKEY_CLASSES_ROOT\Directory\shell\cmd key value >> of "HideBasedOnVelocityId" to "ShowBasedOnVelocityId" (which magically adds >> "Open command window here" option to the shift-rightclick context menu).

    The value of the DWORD is set to 639bc8 which is what gives it the magic.
    https://www.askvg.com/windows-10-tip-restore-open-command-window-here-option-in-shiftright-click-menu/

    I tried that, and it works perfectly, but what I want to do is modify that, >> somehow, so that it will "Open RUN box here" (or something to that effect). >>
    Does anyone on this newsgroup know Windows well enough to modify that
    sequence to instead of adding "open command window here" to the context
    menu, but to add the RUN box to the rightclick context menu instead?

    Not sure how having to right-click the mouse to move the pointer to a
    Run Box entry (similar to right-clicking on the Start Menu button to
    pick Run) is easier or faster than using Win+R to open the Run box.

    For commands you run a thousand times a day, efficiency starts to matter.

    Mainly, for commands that you run a thousand times a day, you want to be
    able to run them no matter what situation your hands, keyboard, and mouse
    are in at that very moment. The RUN command is used a thousand times daily.

    Typing Win+R requires two hands (at least for me to do it, it does). Rightclicking on any screen to select a context menu item only needs one.

    To make matters worse, on a typical dual-screen setup, the taskbar
    is different for each screen (don't ask me why - ask Microsoft why).

    On the "main" screen, you're right that clicking on the RUN icon pinned to
    the taskbar is a single left click with one hand, but on the second screen,
    the pinned shortcuts (such as the pinned RUN icon) don't typically show up.

    So you either need to use your keyboard and both hands (to get to the
    Win+R command) or you have to hunt around with your mouse to left click
    on the main screen taskbar pinned RUN box icon.

    Just being able to rightclick, no matter where your mouse is, is nice.

    Besides, I bring up the RUN box so often, it's nice to be able to do it any
    way I want, including being able to do it with a rightclick context menu.

    However, since you know how to add a context menu entry for Command
    Prompt Here, you can do the same to add a context menu entry to run: explorer.exe Shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}
    That opens the Run box dialog.

    Hey! I didn't know that special secret command brings up the RUN box!
    explorer.exe Shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}
    How did you know that magical command?

    I was at this very moment writing a batch file to bring up the RUN box.
    @echo off
    REM: c:\batch\runbox.bat (brings up the RUN box GUI in Windows)
    %comspec% /c "C:\Users\me\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\System Tools\Run.lnk"
    exit

    Then I was adding that batch file to the rightclick context menu.
    1. Win+R > regedit
    2. Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\
    3. Optionally save that as a registry favorite with the name of:
    https://www.techspot.com/guides/1670-windows-right-click-menu/
    4. Create a new key under shell... let's call it "runbox"
    5. Create a new key under 'runbox' called "command"
    6. Set the 'command' value to be the batch file that you want run
    @Default=c:\batch\runbox.bat
    But that requires me to forevermore maintain a runbox.bat batch file.

    I just now changed that last step to the command you just gave me!
    6. Set the command value to be the exact command that you want run
    @Default=explorer.exe Shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}

    Which worked without needing to maintain a separate batch file!

    I then exported that registry key to "runbox.reg" as shown below.
    .... [ cut here for the start of runbox.reg ]....
    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\Directory\Background\shell\runbox]

    [HKEY_CLASSES_ROOT\Directory\Background\shell\runbox\command]
    @="explorer.exe Shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}"

    .... [ cut here for the end of runbox.reg ]....

    Now anyone can add a "runbox" command to their rightclick context menus!

    Thank you for making it even easier to bring up a RUN box in Windows
    without having to type anything nor to maintain a separate batch file!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From VanguardLH@21:1/5 to VanguardLH on Thu Jun 13 21:54:26 2024
    XPost: alt.comp.os.windows-11, alt.msdos.batch

    VanguardLH <V@nguard.LH> wrote:

    Bill Powell <bill@anarchists.org> wrote:

    Hey! I didn't know that special secret command brings up the RUN box!
    explorer.exe Shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}

    explorer.exe is the parent process which then calls the FileRun method
    in the shell32.dll library. {2559a1f3-21d7-11d4-bdaf-00c04f60b9f0} is
    the class ID for the context menu handler defined in the registry.
    Using explorer.exe to call a method in a DLL is similar to how functions
    in a .dll file are called by rundll32.exe.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From VanguardLH@21:1/5 to Bill Powell on Thu Jun 13 21:44:02 2024
    XPost: alt.comp.os.windows-11, alt.msdos.batch

    Bill Powell <bill@anarchists.org> wrote:

    Typing Win+R requires two hands (at least for me to do it, it does).

    On my QWERTY keyboard, only 1 hand is needed. Win and R keys are within
    the span of my left hand. Left pinky and left index finger. Same hand.

    Rightclicking on any screen to select a context menu item only needs
    one.

    Depends on WHAT you intended to right click upon. Content menu entries
    can be dependent on the object on which you click. In File Explorer,
    you'd want to add a right-click entry for folder/directory objects (HKEY_CLASSES_ROOT\Directory\Background\shell). explorer.exe is both
    the File Explorer and desktop manager. Your desktop, however, is a
    special folder that gets different context menu entries. Adding the
    entry to the Directory\Background\shell might still work to get a
    context menu entry when right-clicking on the desktop folder. In case
    you happen to right-click on a file, you'd want to add a content menu
    entry for file objects, but I'd have to hunt on how to do that for file objects. That might be under HKEY_CLASSES_ROOT\*\shell.

    Rather than define a bunch of shell extensions under various object
    types in the registry, I think Win+R (and, for me, using just 1 hand) is probably easier than trying to figure out why the Run entry doesn't show
    in a particular object's context menu. Besides, if you don't like using
    Win+R, there are plenty of key macro tools (e.g., Autohotkey, AutoIt)
    that let you define your own hotkeys (be careful not to step on any
    already defined that you rely on).

    To make matters worse, on a typical dual-screen setup, the taskbar
    is different for each screen (don't ask me why - ask Microsoft why).

    I wasn't looking for a Windows taskbar solution, like adding a toolbar
    with common shortcuts, or pinning the given explorer.exe command to the taskbar.

    Did you right-click on the Taskbar, choose Settings, and enable the
    "Show taskbar on all displays" option? If so, is the dependent option
    "Show taskbar buttons on" set to "All taskbars"?

    Just being able to rightclick, no matter where your mouse is, is nice.

    The context menu varies depending on what type of object on which you right-clicked. You would need to add a context menu entry for both
    directory and file objects for the Run entry to always appear. There
    might be other objects types where you need to add the content menu
    entry.

    Hey! I didn't know that special secret command brings up the RUN box!
    explorer.exe Shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}
    How did you know that magical command?

    Online search on "windows run box command line" which found:

    https://www.digitalcitizen.life/run-window-windows-7-why-use-it-anymore/

    That list is probably not exhaustive. There are also shell commands
    that you enter, like shell:appsfolder, to open special folders. I saved
    a list from some online article, but there are others, like:

    https://www.tenforums.com/tutorials/3109-shell-commands-list-windows-10-a.html

    I've used shell:appsfolder which makes it easy to create a shortcut (on
    the desktop that you move to wherever else you want it) instead of
    having to find the executable to define a new shortcut, and some apps
    are addressed by their AppID instead of a program file name (and a
    shortcut thus created won't have a path to the executable). If you use shell:desktop, you'll see the desktop is just another folder. Since I
    use OneDrive which usurps several special profile folders, navigating
    to, say, My Pictures is a pain since I have to remember to drill under
    the OneDrive folder instead of directly under my profile folder, so I
    use shell:my pictures (space included).

    However, shell:<string> directives point to folders. They do not run
    commands or initiate actions. So, there is no shell:run directive.

    I was at this very moment writing a batch file to bring up the RUN box.
    @echo off
    REM: c:\batch\runbox.bat (brings up the RUN box GUI in Windows)
    %comspec% /c "C:\Users\me\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\System Tools\Run.lnk"
    exit

    Then I was adding that batch file to the rightclick context menu.
    1. Win+R > regedit
    2. Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\
    3. Optionally save that as a registry favorite with the name of:
    https://www.techspot.com/guides/1670-windows-right-click-menu/
    4. Create a new key under shell... let's call it "runbox"
    5. Create a new key under 'runbox' called "command"
    6. Set the 'command' value to be the batch file that you want run
    @Default=c:\batch\runbox.bat
    But that requires me to forevermore maintain a runbox.bat batch file.

    Doesn't that also open a command shell? Batch commands are interpreted
    by the command interpreter which usually opens a console window.

    I just now changed that last step to the command you just gave me!
    6. Set the command value to be the exact command that you want run
    @Default=explorer.exe Shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}

    Which worked without needing to maintain a separate batch file!

    I then exported that registry key to "runbox.reg" as shown below.
    .... [ cut here for the start of runbox.reg ]....
    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\Directory\Background\shell\runbox]

    [HKEY_CLASSES_ROOT\Directory\Background\shell\runbox\command]
    @="explorer.exe Shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}"

    .... [ cut here for the end of runbox.reg ]....

    That should work when you right-click on a folder of which the desktop
    is one. However, it might not show in the context menu when you
    right-click on a file object, or network object, or other object type.

    Now anyone can add a "runbox" command to their rightclick context menus!

    Thank you for making it even easier to bring up a RUN box in Windows
    without having to type anything nor to maintain a separate batch file!

    You're welcome. I'm old school, so typing is faster than mousing
    around, and why Win+R is faster for me, especially since I only need one
    hand, and my eyes don't have to wander through a context menu to find an
    entry there. Different strokes for different folks.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Oscar Mayer@21:1/5 to VanguardLH on Fri Jun 14 01:04:33 2024
    XPost: alt.comp.os.windows-11, alt.msdos.batch

    On Thu, 13 Jun 2024 21:54:26 -0500, VanguardLH wrote:

    VanguardLH <V@nguard.LH> wrote:

    Bill Powell <bill@anarchists.org> wrote:

    Hey! I didn't know that special secret command brings up the RUN box!
    explorer.exe Shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}

    explorer.exe is the parent process which then calls the FileRun method
    in the shell32.dll library. {2559a1f3-21d7-11d4-bdaf-00c04f60b9f0} is
    the class ID for the context menu handler defined in the registry.
    Using explorer.exe to call a method in a DLL is similar to how functions
    in a .dll file are called by rundll32.exe.

    http://www.softwareok.com/?seite=Microsoft/Run-Command

    https://www.techspot.com/guides/1670-windows-right-click-menu/

    https://helpdeskgeek.com/windows-11/how-to-customize-the-right-click-context-menu-in-windows-11/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bill Powell@21:1/5 to VanguardLH on Fri Jun 14 06:57:07 2024
    XPost: alt.comp.os.windows-11, alt.msdos.batch

    On Thu, 13 Jun 2024 21:44:02 -0500, VanguardLH wrote:

    Rightclicking on any screen to select a context menu item only needs
    one.

    Depends on WHAT you intended to right click upon. Content menu entries
    can be dependent on the object on which you click. In File Explorer,
    you'd want to add a right-click entry for folder/directory objects (HKEY_CLASSES_ROOT\Directory\Background\shell). explorer.exe is both
    the File Explorer and desktop manager. Your desktop, however, is a
    special folder that gets different context menu entries. Adding the
    entry to the Directory\Background\shell might still work to get a
    context menu entry when right-clicking on the desktop folder. In case
    you happen to right-click on a file, you'd want to add a content menu
    entry for file objects, but I'd have to hunt on how to do that for file objects. That might be under HKEY_CLASSES_ROOT\*\shell.

    All I know is the method I found here is what I used, and it created the desired runbox rightclick context menu item for both the desktop & folders.
    https://www.techspot.com/guides/1670-windows-right-click-menu/

    Rather than define a bunch of shell extensions under various object
    types in the registry, I think Win+R (and, for me, using just 1 hand) is probably easier than trying to figure out why the Run entry doesn't show
    in a particular object's context menu.

    Luckily the runbox seems to show up in all the desired context menus now.
    It shows up on the desktop. And in a folder. That's all I really wanted.

    To make matters worse, on a typical dual-screen setup, the taskbar
    is different for each screen (don't ask me why - ask Microsoft why).

    I wasn't looking for a Windows taskbar solution, like adding a toolbar
    with common shortcuts, or pinning the given explorer.exe command to the taskbar.

    If you don't have the RUN box pinned to the taskbar, you're not efficient.
    :)

    Did you right-click on the Taskbar, choose Settings, and enable the
    "Show taskbar on all displays" option? If so, is the dependent option
    "Show taskbar buttons on" set to "All taskbars"?

    There's a taskbar on both monitors but it does different things on each.

    I have the taskbar set up so I can move open windows to another screen so
    that their icons in the other taskbar don't clutter up the main taskbar.

    I was at this very moment writing a batch file to bring up the RUN box.
    @echo off
    REM: c:\batch\runbox.bat (brings up the RUN box GUI in Windows)
    %comspec% /c "C:\Users\me\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\System Tools\Run.lnk"
    exit

    Then I was adding that batch file to the rightclick context menu.
    1. Win+R > regedit
    2. Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\
    3. Optionally save that as a registry favorite with the name of:
    https://www.techspot.com/guides/1670-windows-right-click-menu/
    4. Create a new key under shell... let's call it "runbox"
    5. Create a new key under 'runbox' called "command"
    6. Set the 'command' value to be the batch file that you want run
    @Default=c:\batch\runbox.bat
    But that requires me to forevermore maintain a runbox.bat batch file.

    Doesn't that also open a command shell? Batch commands are interpreted
    by the command interpreter which usually opens a console window.

    I am not using it anymore now that I added your "explorer" command, but
    yes, it momentarily opened a shell and then it killed the shell (/c).

    The (/c) & exit kills the command window just after the command is run.
    Had I used the (/k) option instead, it would have kept the command window.

    That should work when you right-click on a folder of which the desktop
    is one. However, it might not show in the context menu when you
    right-click on a file object, or network object, or other object type.

    Understood. It works on the desktop and in folders, which is what I want.

    Now anyone can add a "runbox" command to their rightclick context menus!
    Thank you for making it even easier to bring up a RUN box in Windows
    without having to type anything nor to maintain a separate batch file!

    You're welcome. I'm old school, so typing is faster than mousing
    around, and why Win+R is faster for me, especially since I only need one hand, and my eyes don't have to wander through a context menu to find an entry there. Different strokes for different folks.

    Since I open a RUN box many times a day, I have many ways to open it.

    Win+R works.
    So does clicking the RUN icon which is pinned in the main taskbar.
    Now I can rightclick on the desktop (or in a folder) to bring it up too.

    Thanks!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wolf Greenblatt@21:1/5 to Bill Powell on Fri Jun 14 01:21:34 2024
    XPost: alt.comp.os.windows-11, alt.msdos.batch

    On Fri, 14 Jun 2024 06:57:07 +0200, Bill Powell wrote:

    All I know is the method I found here is what I used, and it created the desired runbox rightclick context menu item for both the desktop & folders.
    https://www.techspot.com/guides/1670-windows-right-click-menu/

    Thanks for that cite where I will add it to my spooler command setup.
    https://www.techspot.com/guides/1670-windows-right-click-menu/

    Currently I have a command called "spooler" which will check if the print spooler service is running. It will ask if I want to turn it on or off.

    I already had that set up as a taskbar icon and as an AppPaths run command.
    But with your link above, I added it to my right click context menu also.

    Right click -> spooler -> (asks if you want to turn it on or off)
    Here's the setup if you want to do the same thing with any Windows service.

    First, create this spooler.bat file and put it in your batch directory.
    @echo off
    REM 20231223 spooler.bat v0.1 starts & stops the Windows print spooler
    REM using admin-only commands suggested by Andy Burns & VanguardLH
    REM in Usenet thread Message-ID: <um4j5t$1vls9$1@news.samoylyk.net>
    REM A taskbar bat shortcut will be more complex as it will likely require
    REM creating a new scheduled task as suggested by Zaidy036 in that thread
    REM
    call sc query | findstr /i spooler
    if %ERRORLEVEL% == 0 goto :Stop?
    :Start?
    set /p user_input=Spooler is not running. Start it?"
    if %user_input%==y net start spooler
    goto :Icon
    :Stop?
    set /p user_input=Spooler is running. Stop it?"
    if %user_input%==y net stop spooler
    :Icon
    echo "Change shortcut icon color (red/green) depending on outcome"
    exit 0

    Second, create a scheduled task that points to that spooler.bat file.
    Win+R > taskschd.msc -> Task Scheduler Library -> Create Task
    General -> Name=task spooler
    Actions -> New ->
    Action=Start a program
    Program/script=%comspec%
    Add arguments=/c start "" C:\yourbatchfolder\spooler.bat
    Start in=C:\Windows\System32

    Third, create a shortcut whose target is that scheduled task.
    Content of C:\yourshortcutfolder\spooler.lnk Target=C:\Windows\System32\schtasks.exe /run /TN "task spooler"

    Fourth, create a run box command of the name "spooler" in the registry. HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\spooler.exe spooler.exe=C:\yourshortcutfolder\spooler.lnk

    Fifth, assign a recognizable icon to that spooler.lnk shortcut, and then
    pin that spooler.lnk shortcut to your taskbar for one click execution.

    Sixth, add the spooler.bat command to your rightclick context menu by
    going to this registry key as described in the original link provided.
    Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\
    Create a new key called "spooler" & create a "command" subkey under that
    which points to the scheduled task that you previously created.
    @Default=C:\Windows\System32\schtasks.exe /run /TN "task spooler"

    Now you can run the spooler command any number of ways.

    (1) Win+R -> spooler
    (2) Left click on the spooler.lnk shortcut pinned to the taskbar
    (3) Right click on the desktop or in a folder & select the "spooler" choice

    Thank you for making it easier to add commands to the context menu.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From JJ@21:1/5 to Bill Powell on Fri Jun 14 15:46:03 2024
    XPost: alt.msdos.batch

    On Fri, 14 Jun 2024 00:35:16 +0200, Bill Powell wrote:
    I use the Win+R "run" box a thousand times a day (mostly because I
    create dozens of one-word commands using the Windows Registry AppPaths key
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\

    As you know, the shortcut link to the RUN box is located here by default.
    C:\Users\username\AppData\Roaming\Microsoft\Windows\
    Start Menu\Programs\System Tools\Run.lnk

    I already have that RUN box shortcut pinned to the taskbar, but what I'd
    like to add is a RUN box option to the right-click context menu.

    I already have something similar in the context menu, which is the "open command window here" option - so all I want to do is add another line to
    the rightclick context menu of something like "Open RUN box here".

    Here's a way to add the "Open command window here" to the rightclick menu.
    https://www.windowscentral.com/add-open-command-window-here-back-context-menu-windows-10

    In that method, they change HKEY_CLASSES_ROOT\Directory\shell\cmd key value of "HideBasedOnVelocityId" to "ShowBasedOnVelocityId" (which magically adds "Open command window here" option to the shift-rightclick context menu).

    The value of the DWORD is set to 639bc8 which is what gives it the magic.
    https://www.askvg.com/windows-10-tip-restore-open-command-window-here-option-in-shiftright-click-menu/

    I tried that, and it works perfectly, but what I want to do is modify that, somehow, so that it will "Open RUN box here" (or something to that effect).

    Does anyone on this newsgroup know Windows well enough to modify that sequence to instead of adding "open command window here" to the context
    menu, but to add the RUN box to the rightclick context menu instead?

    I'd use Windows Script Host for that. The script would be e.g. `runbox.js` which contains below code. Note: exclude the `[code]`/`[/code]` wrapper
    text.

    [code]
    cl = WSH.arguments.length ? WSH.arguments(0) : "";
    (new ActiveXObject("shell.application")).fileRun();
    ws = new ActiveXObject("wscript.shell");
    t = (new Date).getTime();
    while (!(r = ws.appActivate("Run")) && ((new Date).getTime() - t) < 3000) {
    WSH.sleep(100)
    }
    if (r) {
    ws.sendKeys(cl.replace(/''/g, '"').replace(/([+^%~[\]{}()])/g, "{$1}"))
    }
    [/code]

    Run it using `wscript.exe`. e.g.

    [code]
    wscript.exe "d:\my scripts\runbox.js"
    [/code]

    Use that command line for the registry context menu commands.

    The script accepts one (and only one) optional command line argument which
    is used to prefill the runbox's editbox by generating key presses. e.g.

    [code]
    wscript.exe "d:\my scripts\runbox.js" "%1"
    [/code]

    That will use the selected file/folder (the `%1`) to prefill the runbox's editbox. Note: to include literal double-quote character ("), use two single-quotes.

    The `%1` can be used as part of a command line argument of a specific application. e.g.

    [code]
    wscript.exe "d:\my scripts\runbox.js" "''d:\programs\the app\main.exe'' /v ''%1'' ''param 'with' single-quotes''"
    [/code]

    That will prefill the editbox with:

    [code]
    "d:\programs\the app\main.exe" /v "%1" "param 'with' single-quotes"
    [/code]

    The script will wait up to 3000ms (3 seconds) for the runbox to appear
    before generating key presses. It timed out, the keys won't be generated.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From VanguardLH@21:1/5 to Oscar Mayer on Fri Jun 14 07:47:24 2024
    XPost: alt.comp.os.windows-11, alt.msdos.batch

    Oscar Mayer <nobody@oscarmayer.com> wrote:

    On Thu, 13 Jun 2024 21:54:26 -0500, VanguardLH wrote:

    VanguardLH <V@nguard.LH> wrote:

    Bill Powell <bill@anarchists.org> wrote:

    Hey! I didn't know that special secret command brings up the RUN box!
    explorer.exe Shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}

    explorer.exe is the parent process which then calls the FileRun method
    in the shell32.dll library. {2559a1f3-21d7-11d4-bdaf-00c04f60b9f0} is
    the class ID for the context menu handler defined in the registry.
    Using explorer.exe to call a method in a DLL is similar to how functions
    in a .dll file are called by rundll32.exe.

    http://www.softwareok.com/?seite=Microsoft/Run-Command

    No mention of adding a context menu entry for Run.

    https://www.techspot.com/guides/1670-windows-right-click-menu/

    OP already knew how to add context menu entries although a content menu
    editor might facilitate the registry editing. The OP needed to know
    WHAT to run (the handler for the content menu entry). Looks like this
    editor includes a Run entry.

    https://helpdeskgeek.com/windows-11/how-to-customize-the-right-click-context-menu-in-windows-11/

    Page didn't fully display. Got "This page is slowing down Firefox"
    message. That is, its scripts are fucked up. Could only scroll a
    portion down the page until it stopped painting again.

    Could be caused by use of an adblocker (I use uBlock Origin) which
    blocked several resources, like btloader.com, getlasso.com, sniggleweb,
    and other tracking resources. Lots of other places to get info on how
    to edit the context menu without having to bother with this nuisance.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Herbert Kleebauer@21:1/5 to Bill Powell on Fri Jun 14 14:42:19 2024
    XPost: alt.msdos.batch

    On 14.06.2024 03:38, Bill Powell wrote:

    For commands you run a thousand times a day, efficiency starts to matter.

    Mainly, for commands that you run a thousand times a day, you want to be
    able to run them no matter what situation your hands, keyboard, and mouse
    are in at that very moment. The RUN command is used a thousand times daily.

    Typing Win+R requires two hands (at least for me to do it, it does). Rightclicking on any screen to select a context menu item only needs one.

    And why not remapping a key which you don't use to <WIN>-R?

    https://learn.microsoft.com/en-us/windows/powertoys/keyboard-manager

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From T@21:1/5 to Bill Powell on Fri Jun 14 18:58:35 2024
    XPost: alt.comp.os.windows-11, alt.msdos.batch

    On 6/13/24 18:38, Bill Powell wrote:
    For commands you run a thousand times a day, efficiency starts to matter.

    Hi Bill,

    I have this functionality on Linux. I have actually
    configured several command windows to open at various
    places on my drive. It is super convenient.

    I would love to have that capability in Windows too.
    Did you ever figure it out?

    -T

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Senior Investigator@21:1/5 to All on Sat Jun 15 02:55:00 2024
    XPost: alt.comp.os.windows-11

    On 15/06/2024 02:58, T wrote:
    On 6/13/24 18:38, Bill Powell wrote:
    For commands you run a thousand times a day, efficiency starts to
    matter.

    Hi Bill,

    I have this functionality on Linux.  I have actually
    configured several command windows to open at various
    places on my drive.   It is super convenient.

    I would love to have that capability in Windows too.
    Did you ever figure it out?

    -T

    It's already in Windows 11 (and in previous windows). You need to
    right-click anywhere in the folder and choose open terminal here (or cmd
    or power share depending on your settings). If you want cmd window in terminal/PS them simply type cmd and you get command window.

    In the previous windows, you had to press shift-Key while right-clicking
    but it is all the same if you use Windows all the time.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Herbert Kleebauer@21:1/5 to All on Sat Jun 15 21:15:45 2024
    XPost: alt.msdos.batch

    On 15.06.2024 03:58, T wrote:

    I have this functionality on Linux. I have actually
    configured several command windows to open at various
    places on my drive. It is super convenient.

    I would love to have that capability in Windows too.
    Did you ever figure it out?

    This batch opens 1 of 4 or all 4 CMD windows (or add some more).
    For each window you can specify the directory, the size and position:


    @echo off
    :: winpos.exe: specify the position for the Command Window
    ::
    :: usage: winpos [T] xpos ypos
    :: if T is given, the window becomes TOPMOST
    :: example: winpos -> new position 0,0
    :: winpos 100 200 -> new position 100,200
    :: winpos T 200 -> new position 200,0 TOPMOST

    certutil -f -decode %~f0 %temp%\winpos.exe>nul

    set d1=D:\tmp1
    set s1=MODE CON: COLS=60 LINES=15
    set p1=%temp%\winpos.exe 100 10

    set d2=D:\tmp2
    set s2=MODE CON: COLS=60 LINES=15
    set p2=%temp%\winpos.exe 600 10

    set d3=D:\tmp3
    set s3=MODE CON: COLS=60 LINES=20
    set p3=%temp%\winpos.exe 100 300

    set d4=D:\tmp4
    set s4=MODE CON: COLS=60 LINES=20
    set p4=%temp%\winpos.exe 600 300

    for /l %%i in (1,1,4) do call echo [%%i] %%d%%i%%
    echo [0] all

    choice /c 12340 /d 1 /t 5
    set e=%errorlevel%
    set f=%e%
    if %e%==5 set e=1&set f=4

    for /l %%i in (%e%,1,%f%) do call :sub %%i
    goto :eof

    :sub
    call set d=%%d%1%%
    call set s=%%s%1%%
    call set p=%%p%1%%
    start "%d%" cmd.exe /k doskey cd=cd $* ^^^&call title %%c^^^^d%% ^&cd /d "%d%" ^&%s% ^&%p%
    goto :eof


    -----BEGIN CERTIFICATE----- TVpgAQEAAAAEAAAA//8AAGABAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAoAAAAA4fug4AtAnNIbgBTM0hTmljZSB0byBtZWV0IHNvbWVi b2R5IHdobyBpcyBzdGlsbCB1c2luZyBET1MsDQpidXQgdGhpcyBwcm9ncmFtIHJl cXVpcmVzIFdpbjMyLg0KJFBFAABMAQEAUHmlNgAAAAAAAAAA4AAPAQsBBQwAAgAA AAAAAAAAAADKEAAAABAAAAAgAAAAAEAAABAAAAACAAAFAAAAAAAAAAUAAAAAAAAA ACAAAAACAAAAAAAAAwAAAAAAEAAAEAAAAAAQAAAQAAAAAAAAEAAAAAAAAAAAAAAA GBAAADwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAYAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALnRleHQAAABkAQAAABAAAAACAAAAAgAA AAAAAAAAAAAAAAAAIAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABoEAAAAAAAAJYQAACoEAAA vBAAAAAAAABgEAAAAAAAAAAAAABUEAAAABAAAIYQAAAAAAAAAAAAAHgQAAAIEAAA AAAAAAAAAAAAAAAAAAAAAAAAAABVU0VSMzIuZGxsAABoEAAAAAAAAAAAU2V0V2lu ZG93UG9zAABLRVJORUwzMi5kbGwAAJYQAACoEAAAvBAAAAAAAAAAAEdldENvbW1h bmRMaW5lQQAAAEdldENvbnNvbGVXaW5kb3cAAAAARXhpdFByb2Nlc3MA/xUIEEAA MdJIQIA4AHQRgDgidQL30gnSde+AOCB16kAx7egrAAAAif7oJAAAAIPtAv8VDBBA AGgBAAAAagBqAFdWVVD/FQAQQABqAP8VEBBAADH/MckPthAI0nQ2QID6LXQWgPpU dQW9AQAAAIDqMHLkgPoJd9/rE0kPthAI0nQSQIDqMHIMgPoJdwdr/woB1+vnCcl0 AvffwwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAA==
    -----END CERTIFICATE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)