Windows 10: Add PsExec to Windows 10 Context Menu

Discus and support Add PsExec to Windows 10 Context Menu in Windows 10 Customization to solve the problem; Hello, I can run the command prompt as admin from the context menu. Is it possible to run the command prompt as SYSTEM from the context menu? I... Discussion in 'Windows 10 Customization' started by MasTech, Oct 21, 2017.

  1. MasTech Win User

    Add PsExec to Windows 10 Context Menu


    Hello,

    I can run the command prompt as admin from the context menu. Is it possible to run the command prompt as SYSTEM from the context menu? I currently use PsExec from the Systernal Suite to run CMD as SYSTEM but I have not figured out a way to add that to the context menu that keeps the CMD open.

    I haven't found a working solution anywhere.

    I have created a desktop shortcut using Code: C:\Windows\System32\PsExec.exe -s -i -d -w %HOMEDRIVE% -high %windir%\system32\cmd.exe /k[/quote] as the target. It works. Just have run as admin.

    This what I have in the registry so far:

    Code: [HKEY_CLASSES_ROOT\LibraryFolder\Shell\OpenSysCmd]@="Command Prompt (Sys)""NoWorkingDirectory"="""NeverDefault"="""Icon"="imageres.dll,-5324"[HKEY_CLASSES_ROOT\LibraryFolder\Shell\OpenSysCmd\command]@="\"C:\\Windows\\System32\\PsExec.exe\" -s -i -d -w %HOMEDRIVE% -high %windir%\\system32\\cmd.exe /k\""[/quote] The same is added to:
    HKEY_CLASSES_ROOT\Drive\shell\
    HKEY_CLASSES_ROOT\Directory\shell\
    HKEY_CLASSES_ROOT\Directory\background\shell\

    It adds the menu item.

    Add PsExec to Windows 10 Context Menu [​IMG]


    Like I said... it works but it doesn't keep the window open. A quick flash and the windows closes.

    Thanks

    :)
     
    MasTech, Oct 21, 2017
    #1
  2. Gerry C J Cornell, Oct 21, 2017
    #2
  3. Bruce Hagen, Oct 21, 2017
    #3
  4. dalchina New Member

    Add PsExec to Windows 10 Context Menu

    dalchina, Oct 21, 2017
    #4
  5. Edwin New Member
    Edwin, Oct 21, 2017
    #5
  6. MasTech Win User
    Okay. Still no progress. I will keep searching trying. Thanks for the suggestions.
     
    MasTech, Oct 22, 2017
    #6
  7. dalchina New Member
    Is this what you wanted?

    Add PsExec to Windows 10 Context Menu [​IMG]
     
    dalchina, Oct 22, 2017
    #7
  8. MasTech Win User

    Add PsExec to Windows 10 Context Menu

    That would a huge YES. I have the context menu in place. The command executes when clicked. The CMD prompt opens and closes in a flash though.
     
    MasTech, Oct 23, 2017
    #8
  9. MasTech Win User
    @dalchina

    That would a huge YES. I have the context menu in place. The command executes when clicked. The CMD prompt opens and closes in a flash though.
     
    MasTech, Oct 23, 2017
    #9
  10. dalchina New Member
    OK, please follow the procedure I outlined in my first post.

    The ahk file contains (from your post)
    Run, *runas "D:\Utilities\Sysinternals Suite\PsExec.exe" -s -i -d -w %HOMEDRIVE% -high %windir%\system32\cmd.exe /k
    exit

    Download, install and run Autohotkey, rt click and compile the ahk file to get what I've attached.

    (Note - there's no parameter in this example.. you could develop this so the command prompt launches open at the right place I guess).

    Here I used the same program (for convenience) to add the context menu entry:

    Add PsExec to Windows 10 Context Menu [​IMG]



    Add PsExec to Windows 10 Context Menu [​IMG]
     
    dalchina, Oct 23, 2017
    #10
  11. MasTech Win User
    @dalchina

    Um. Where is the first post. I see where you asked about my goal then the post with the attachment
     
    MasTech, Oct 24, 2017
    #11
  12. dalchina New Member
    What I've provided for you was done in the same way as per the link in my #2.
     
    dalchina, Oct 24, 2017
    #12
  13. MasTech Win User

    Add PsExec to Windows 10 Context Menu

    Ok.. No more responding without sleep. I didn't begin to think about your reply in the linked post. Lack of sleep does strange things to me.

    I did get it to work.

    psexec is here: C:\Windows\System32\

    I created the script, changed the path, renamed the compiled exe, then dropped it in sys32.

    Result: C:\Windows\System32\syscmd.exe that executes Code: Run, *runas "C:\Windows\System32\PsExec.exe" -s -i -d -w %HOMEDRIVE% -high %windir%\system32\cmd.exe /k exit[/quote] It works great. Thanks so much for the help and the new tools (AHK and Right Click Configurator) !!

    I had been searching for a better context menu tool. I'm looking into AHK script. Never used it before as I never had the need.
     
    MasTech, Oct 25, 2017
    #13
  14. dalchina New Member
    That's great. At one level AHK is simple, at another, you can create whole programs with it. And at another, it can manipulate existing Windows, click buttons, operate on processes...

    So it's a simple scripting language, a tool to manipulate Windows at a GUI and process level, and a programming language.

    SciTE4AutoHotkey Editor - syntax sensitive editor
    AutoIt3 Window Spy - tool to identify elements in existing Windows and GUI

    Try (free)
    https://www.askvg.com/right-click-co...-context-menu/
    The venerable Context Edit is thorough, but dated.

    Generally tools that offer the flexibility of the one I used are commercial (I got it as a giveaway).

    Right Click Enhancer now seems commercial- the version I have is free with an option to upgrade to add freedom to add your own.

    Then there are various tools that add fixed functions to the context menu.

    FileMenu Tools

    Add PsExec to Windows 10 Context Menu [​IMG]

    Has more features than you think, but would take time to get used to it. For a long time I though it just added fixed items or disabled items, but it looks as though you can add your own. Adds separators too.

    Nothing like as intuitive as the one I used.

    - you might consider seeing if you could use a parameter (as in my Notepad example) to pass in the folder or disk to cmd.exe so the command prompt opens at the folder or disk if that's relevant.
     
    dalchina, Oct 25, 2017
    #14
  15. MasTech Win User
    I will play around with the parameters to get it to open where I right click. I was going to bypass UAC BUT decided to keep it save I do something dangerous while not paying attention to access levels.

    Seriously THANKS. I finding myself doing things with things owned by SYSTEM and TrustedInstaller. Being able to get a system level CMD easily to launch apps or exec commands with access that equals SU saves me time.

    My next project is adding runas System &/or runsas TrustedInstaller to *.lnk and *.exe context menus.

    I'll try my hand before I create another post though. Maybe I'll get it on the 1st or try??

    Thanks again for all your help. Greatly appreciated.


    Side note: I purchased Right Click Configurator. I have no problem spending on things that simplify my task.
     
    MasTech, Apr 5, 2018
    #15
Thema:

Add PsExec to Windows 10 Context Menu

Loading...
  1. Add PsExec to Windows 10 Context Menu - Similar Threads - Add PsExec Context

  2. History - Add to Context Menu in Windows 10

    in Windows 10 Tutorials
    History - Add to Context Menu in Windows 10: How to: History - Add to Context Menu in Windows 10 How to Add History to Context Menu in Windows 10 [img] Information You can use File History to automatically back up versions of your files on a schedule to a location you select to save to. You can select to save...
  3. Add Restart Context Menu in Windows 10

    in Windows 10 Tutorials
    Add Restart Context Menu in Windows 10: How to: Add Restart Context Menu in Windows 10 How to Add Restart Context Menu in Windows 10 Restart will close all apps, sign out all users, and full shutdown and restart (reboot) the PC. Starting with the Windows 10 Fall Creators Update: Old behavior: - When...
  4. PowerShell - Add to Context Menu in Windows 10

    in Windows 10 Tutorials
    PowerShell - Add to Context Menu in Windows 10: How to: PowerShell - Add to Context Menu in Windows 10 How to Add PowerShell to Context Menu in Windows 10 [img] Information Windows PowerShell is a task-based command-line shell and scripting language designed especially for system administration. This tutorial...
  5. Add HomeGroup to Context Menu in Windows 10

    in Windows 10 Tutorials
    Add HomeGroup to Context Menu in Windows 10: How to: Add HomeGroup to Context Menu in Windows 10 [img] Information A Homegroup makes it easy to share pictures, music, documents, videos, and printers with other Windows 7, Windows 8, Windows 8.1, and Windows 10 computers on your local home network. You can also stream...
  6. Cleanup - Add to Context Menu in Windows 10

    in Windows 10 Tutorials
    Cleanup - Add to Context Menu in Windows 10: How to: Cleanup - Add to Context Menu in Windows 10 How to Add Cleanup to Context Menu of Drives in Windows 10 [img] Information You can use Disk Cleanup to reduce the number of unnecessary files on your drives, which can help your PC run faster. It can delete...
  7. Add Settings to Context Menu in Windows 10

    in Windows 10 Tutorials
    Add Settings to Context Menu in Windows 10: How to: Add Settings to Context Menu in Windows 10 How to Add or Remove Settings context menu in Windows 10 Most of the settings you'll want to change in Windows 10 are in Settings. Settings is organized into the separate System, Devices, Phone, Network & Internet,...
  8. Add Bluetooth context menu in Windows 10

    in Windows 10 Tutorials
    Add Bluetooth context menu in Windows 10: How to: Add Bluetooth context menu in Windows 10 How to Add or Remove a Bluetooth context menu in Windows 10 There are many different types of Bluetooth enabled devices you can add to your PC, such as mobile phones, wireless headsets, and wireless mouse devices and...
  9. Email - Add to Context Menu in Windows 10

    in Windows 10 Tutorials
    Email - Add to Context Menu in Windows 10: How to: Email - Add to Context Menu in Windows 10 How to Add Email to Context Menu in Windows 10 [img] Information You can use Email from the Share tab in the ribbon of File Explorer by default when you have files and/or folders selected. It allows you to send the...
  10. Add Attributes context menu in Windows 10

    in Windows 10 Tutorials
    Add Attributes context menu in Windows 10: How to: Add Attributes context menu in Windows 10 How to Add a File Attributes context menu in Windows 10 File attributes are metadata associated with computer files that define file system behavior. Each attribute can have one of two states: set and cleared. Attributes...

Users found this page by searching for:

  1. add psexec to windows 10

    ,
  2. psexec.exe windows 10