Disable cmd.exe for standard users on Windows 7 Starter edition.

Page 2 of 2 FirstFirst 12

  1. Posts : 4,776
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
       #11

    You can create the following registry entry:

    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\cmd.exe]
    "Debugger"="\"C:\\windows\\system32\\cmd.exe /c exit 0\""
    Disable cmd.exe for standard users on Windows 7 Starter edition.-registry-editor.jpg

    That basically will tell cmd.exe to simply exit whenever it runs.

    I,' not sure that it's a good idea though. What if cmd.exe needs to run when installing software for example? Well it won't be able to unless you delete the reg.
      My Computer


  2. Posts : 7
    Windows 7 Starter 32 bits
    Thread Starter
       #12

    Thank you so much for your reply, Callender. That looks like it might solve the issue. I'll try to implement it and see how it goes.
      My Computer


  3. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #13

    Wow, Callendar, I didn’t know about that key and that’s a very clever suggestion. Though your demonstration of the key’s usage doesn’t make much sense…

    If the Debugger value’s data is,
    Code:
    "C:\windows\system32\cmd.exe /c exit 0"
    then you’re saying, whenever cmd is invoked, execute the following command string instead,
    Code:
    "C:\windows\system32\cmd.exe /c exit 0" C:\windows\system32\cmd.exe
    Which doesn’t make sense because the path “C:\windows\system32\cmd.exe /c exit 0” won’t ever exist, and as a result Windows will report the following message upon launching cmd each time, does it not?

    Disable cmd.exe for standard users on Windows 7 Starter edition.-cmd-path-not-found.png


    This is great news though. By taking advantage of this registry value, we can replicate the behaviour of the Don't run specified Windows Applications policy almost perfectly, for any application, without the need of group policy, i.e., with the following Debugger implementation,
    Code:
    "Debugger"="mshta.exe vbscript:code(close(MsgBox(\"This operation has been cancelled due to restrictions in effect on this computer. Please contact your system administrator.\",16,\"Restrictions\")))"
    Last edited by Pyprohly; 28 Oct 2016 at 05:06. Reason: Changed Debugger command dialogue icon
      My Computer


  4. Posts : 4,776
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
       #14

    Pyprohly said:

    This is great news though. By taking advantage of this registry value, we can replicate the behaviour of the Don't run specified Windows Applications policy almost perfectly, for any application, without the need of group policy, i.e., with the following Debugger implementation,
    Code:
    "Debugger"="mshta.exe vbscript:code(close(MsgBox(\"This operation has been cancelled due to restrictions in effect on this computer. Please contact your system administrator.\",0,\"Restrictions\")))"
    Yes your suggestion is way better. Mine was intended to allow the debugger to launch cmd.exe with exit status 0. That just tells cmd.exe to exit as soon as it's launched. However I'm not sure that using debugger to launch a process with the same name as the original actually works as I intended.

    I got the idea from here:

    How to block applications and toolbar installers

    Basically I actually use that registry key to block any desired process by name from ever running.
      My Computer


  5. Posts : 4,776
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
       #15

    Pyprohly said:
    This is great news though. By taking advantage of this registry value, we can replicate the behaviour of the Don't run specified Windows Applications policy almost perfectly, for any application, without the need of group policy, i.e., with the following Debugger implementation,
    Code:
    "Debugger"="mshta.exe vbscript:code(close(MsgBox(\"This operation has been cancelled due to restrictions in effect on this computer. Please contact your system administrator.\",0,\"Restrictions\")))"
    So following your advice I find that this works well for me:

    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\cmd.exe]
    "Debugger"="mshta \"javascript:var sh=new ActiveXObject( 'WScript.Shell' ); sh.Popup( 'This operation has been cancelled due to restrictions in effect on this computer. Please contact your system administrator', 10, 'Message!', 64 );close()\""
    :)
      My Computer


 
Page 2 of 2 FirstFirst 12

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 18:24.
Find Us