• Tutorial: App Paths is the most magical runbox efficiency trick in all of Microsoft WIndows

    From Marion@marion@facts.com to alt.comp.os.windows-10,alt.comp.os.windows-11,alt.windows7.general,alt.comp.microsoft.windows on Wed Jul 16 20:14:54 2025
    From Newsgroup: alt.windows7.general

    Tutorial:
    App Paths is the most magical runbox efficiency trick in all of Windows

    This was written for another thread but I post it separately as a tutorial because I believe it's the most magical command on Windows for efficiency.

    That other thread was about how to edit the hosts file in a single step:
    Win+R > hosts (which I have been doing in a single step for decades)

    Very few people know Windows has multiple ways to find the paths.

    I strive for everything I do on Windows to be a single step.
    If it's two steps, then it's half as efficient as it should be.

    That's why, long ago, I added the "hosts" command to the Windows runbox.
    Win+R > hosts (this single step opens up the hosts file for editing)

    I never accept two steps when a single step can be figured out.
    Let's say you want to edit the Windows registry, and count the steps.
    a. Click on the "Runbox" pinned to your taskbar (or type "Win+R")
    b. Enter regedit
    c. Tap "Yes" to the UAC prompt

    That's already too many steps!

    The magic here is that there are TWO ways to find the path to any command:
    a. The Windows "PATH" system variable (and all its variants)
    b. The Windows "App Paths" key (which is inside the registry)

    Let's cut the number of steps down to half, but bear in mind, you do this
    for hundreds of things you do on Windows - where this is only one thing.

    Let's take the example of the "regopen" command to illustrate.

    Step 1.
    Enter "regopen" into the Windows Win+R runbox. What happens?
    Windows cannot find "regopen"! Right? Good. You want that to happen.
    That tells you it's an available (i.e., unused) keyword, "regopen".

    Step 2.
    Enter a "regopen.exe" registry subkey in the App Paths registry key.
    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\regopen.exe
    @Default=C:\path\link\regopen.lnk

    Note: There is no executable called "regopen.exe"; it's just a name.
    For the Windows magic to work, the keyword must end with "exe".

    Step 3: (This is only necessary because we want to avoid the UAC prompt!)
    Create a link with the TARGET being a call to Windows Task Manager.
    TARGET=C:\Windows\System32\schtasks.exe /run /TN "Task Regopen"

    Step 4:
    Create that task in the Windows task manager (Win+R > taskschd.msc).
    Name=Task Regopen (start all your custom tasks with the same keyword!)
    [x]Run with highest privileges (as the whole point is to avoid the UAC!)
    Start a program = C:\Windows\regedit.exe

    Voila!

    Now, when you click your pinned Runbox & type "regopen", up pops the
    registry ready to edit without you having to perform any other clicks.

    If it takes two steps to open the registry, you're doing it inefficiently.

    NOTE: If you didn't want to avoid the UAC prompt, you could skip 3 of the 4 steps above because you can open a file using just step 1 above, and you
    can open up a directory using only steps 1 and 2 above.

    The only reason the setup is four steps instead of just one step, is
    because we have to do extra stuff to avoid the UAC prompt asking for OK.

    Note that this works for almost anything you ever do on Windows.
    Which is why I consider it the most magical of all Windows tricks.

    Please test & improve so that everyone benefits from every post on Usenet.
    --
    Note I'm aware that some people edit the PATH to contain a folder which
    itself contains batchfiles and shortcuts, which is another way to do it.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Marion@marion@facts.com to alt.comp.os.windows-10,alt.comp.os.windows-11,alt.windows7.general,alt.comp.microsoft.windows on Wed Jul 16 20:33:54 2025
    From Newsgroup: alt.windows7.general

    On Wed, 16 Jul 2025 20:14:54 -0000 (UTC), Marion wrote :


    That other thread was about how to edit the hosts file in a single step:
    Win+R > hosts (which I have been doing in a single step for decades)

    Here is the original post showing how to edit the HOSTS file in 1 step.
    Note that avoiding the UAC prompt takes 3 of the 4 setup steps.

    If all you wanted to do was edit a normal file, it would be 1 setup step.
    If all you wanted to do was run a shortcut, it would be two setup steps.
    But this is 4 setup steps because we have to work around the UAC prompt.

    The "App Paths" key is perhaps the most magical key in all of registry.

    What I've been doing, for decades, & which I posted on this newsgroup many times in the past, is I click on my "Runbox" icon in my taskbar and I type "hosts" where that action (which you'll never forget) edits the HOSTS file.

    Win+R > hosts [carriagereturn]

    There's nothing more magical on WIndows than that App Paths registry key. Everything you ever needed to do, is a simple one-word-command action!

    But how did I do it?

    Working backward, I see that "hosts" points to a "hosts.exe" subkey.
    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\hosts.exe

    That "hosts.exe" subkey points to a value which happens to be a shortcut.
    @Default=C:\path\link\hosts.lnk

    Further reversing the stitching, the " of that shortcut are:
    TARGET=C:\Windows\System32\schtasks.exe /run /TN "Task hosts edit"

    (You should always start your custom tasks with the same keyword
    because it's ordered alphabetically where when you back up your
    tasks over the years, you want to be able to find them easily.)

    Pulling more thread out, a Win+R > taskschd.msc brings up "Task hosts edit"
    ACTIONS=C:\apps\editors\text\vim\vim.exe C:\windows\system32\drivers\etc\hosts
    [x]Run with highest privileges (this part is what avoids the UAC)

    Note: This edits the hosts file in GVim without those annoying UAC prompts. Note: My default editor for files sans extensions is set to be gvim.

    I think this key is the most valuable key for efficiencey in all Windows. Please try it and let the team know how well it works out for you.
    --
    Note that hosts.exe is not a file. It's just a subkey. It can be any name.
    But in the App Paths key, the subkeys have to end with "exe" to work magic.
    --- Synchronet 3.21a-Linux NewsLink 1.2