Page 1 of 2 12 LastLast
  1.    4 Weeks Ago #1
    Join Date : Jul 2017
    Posts : 11
    Windows 10 Enterprise S

    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
    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\""
    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.
    Click image for larger version. 

Name:	cap.fw.png 
Views:	31 
Size:	88.1 KB 
ID:	159651

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

    Thanks
      My ComputerSystem Spec
  2.    4 Weeks Ago #2
    Join Date : Jan 2015
    UK, Midlands
    Posts : 11,044
    Win 10 Pro (1703)

    Hi, I'm reminded of what I did here for someone - maybe it will suggest an idea...
    Open Notepad as Administrator with Context Menu? Solved - Windows 10 Forums
    From #8
      My ComputerSystem Spec
  3.    4 Weeks Ago #3
    Join Date : Feb 2014
    Posts : 9,367
    Windows 10 Professional

    @MasTech

    You could add WinX Classic Context Menu to HKEY_CLASSES_ROOT/Directory:

    Add Win+X Classic Menu to Context Menu in Windows 10 Customization Tutorials
      My ComputersSystem Spec
  4.    4 Weeks Ago #4
    Join Date : Jul 2017
    Posts : 11
    Windows 10 Enterprise S
    Thread Starter

    Okay. Still no progress. I will keep searching trying. Thanks for the suggestions.
      My ComputerSystem Spec
  5.    4 Weeks Ago #5
    Join Date : Jan 2015
    UK, Midlands
    Posts : 11,044
    Win 10 Pro (1703)

    Is this what you wanted?
    Click image for larger version. 

Name:	Untitled.png 
Views:	4 
Size:	415.3 KB 
ID:	159744
      My ComputerSystem Spec
  6.    4 Weeks Ago #6
    Join Date : Jul 2017
    Posts : 11
    Windows 10 Enterprise S
    Thread Starter

    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.
      My ComputerSystem Spec
  7.    4 Weeks Ago #7
    Join Date : Jul 2017
    Posts : 11
    Windows 10 Enterprise S
    Thread Starter

    @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.
      My ComputerSystem Spec
  8.    4 Weeks Ago #8
    Join Date : Jan 2015
    UK, Midlands
    Posts : 11,044
    Win 10 Pro (1703)

    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:
    Click image for larger version. 

Name:	1.png 
Views:	3 
Size:	160.1 KB 
ID:	160025

    Click image for larger version. 

Name:	1.jpg 
Views:	17 
Size:	44.7 KB 
ID:	160027
    Add PsExec to Windows 10 Context Menu Attached Files
    Last edited by dalchina; 4 Weeks Ago at 16:08.
      My ComputerSystem Spec
  9.    4 Weeks Ago #9
    Join Date : Jul 2017
    Posts : 11
    Windows 10 Enterprise S
    Thread Starter

    @dalchina

    Um. Where is the first post. I see where you asked about my goal then the post with the attachment
      My ComputerSystem Spec
  10.    4 Weeks Ago #10
    Join Date : Jan 2015
    UK, Midlands
    Posts : 11,044
    Win 10 Pro (1703)

    What I've provided for you was done in the same way as per the link in my #2.
      My ComputerSystem Spec

 
Page 1 of 2 12 LastLast


Similar Threads
Thread Forum
Edge context menu bigger than windows context menu
Hi guys, is there any tweak to reduce the size of edge context menu. Make it same size as windows context menu(desktop right click, file explorer). The other modern apps also have larger context menu as compared to windows. Thanks
Browsers and Email
Antivirus / Windows 10 / Start Menu, Metro Apps, Context menu issues
Hi I wondered if anyone out there has had a similar experience to me... For some weeks now I have had problems where the START MENU wouldn't launch, metro apps (OneDrive, Tweetium, Money, News etc) would fail to launch (just a blank window...
AntiVirus, Firewalls and System Security
Start Menu context menu on Windows 10
Hi All, Thanks for visiting my thread. I'm rebuilding all computers to Windows 10 at the School I work at. I've been able to lock down everything using Group Policy and Registry tweaks apart from two niggling little issues. 1. I can't get rid...
General Support
Black Context Menu for Taskbar and Old Context Menu for Desktop
Hello. Today I got an update, and I noticed afterwards that the Windows 10 context menu when you right click the desktop went back to the old version and not the Windows 10 version. Also, the context menu for right clicking in the taskbar turned...
Customization
Solved Network map context menu (Fix Icon and context menu)
For all those that have a blank icon in network router and the non working network map feature as it is removed from windows 8/10 (this plug and play driver bug never got corrected from microsoft, imo) here is a reg file that fixes both of the 3...
Network and Sharing
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 11:43.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums