Solved

Remove the new shortcut item from the context menu

Posted on 2004-04-02
14
1,436 Views
Last Modified: 2013-12-04
I want to be able to remove the new shortcut item from the Windows Explorer context menu from my users.  I still want them to be able to send items in their my documents folder to the desktop as a shortcut and don't want to completely remove the context menu.  Can't figure out where that key is in the registry and don't see that option as part of the options of a group policy object (where I'd prefer to set the option).  Help!
0
Comment
Question by:WerewolfTA
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
  • +2
14 Comments
 
LVL 31

Expert Comment

by:Gareth Gudger
ID: 10742089
What item are you trying to remove?
0
 
LVL 4

Author Comment

by:WerewolfTA
ID: 10742967
The item that lets them create a new blank shortcut (r. click -> new -> shortcut) on the desktop.
0
 
LVL 14

Expert Comment

by:JohnK813
ID: 10743690
c:\documents and settings\[username]\SendTo holds all of those context menu items - just delete "Send to Desktop".  I don't know if there's an easier way to remove other than going through each user's folder individually - maybe a quick batch file would do the trick.

Also, I'm assuming that making the change for "Default User" would put the change into effect for all new users you create.
0
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
LVL 84

Expert Comment

by:oBdA
ID: 10743828
The easiest way would be to integrate that into the logon script. Assuming that you don't want this to apply to all users, you might want to use ifmember.exe (a free W2k Resource Kit tool) to check if the user is member of a certain group ("GRemoveSendTo" in the example) and then delete the link only when the user is a member.

====8<----[logon.cmd]----
@echo off
:: *** Check if the user is member of the group that has the Desktop-SendTo deleted;
:: *** note that ifmember returns errorlevel 1 if the user *is* member!
ifmember.exe GRemoveSendTo
if not errorlevel 1 goto DeleteEnd
if exist "%UserProfile%\SendTo\*.desklink" del "%UserProfile%\SendTo\*.desklink"
:DeleteEnd
====8<----[logon.cmd]----

Resource Kits Free Tool Downloads: Ifmember.exe
http://www.microsoft.com/windows2000/techinfo/reskit/tools/new/ifmember-o.asp
0
 
LVL 4

Author Comment

by:WerewolfTA
ID: 10745027
Thanks for the feedback.  However, I guess that I wasn't being clear.  I'm not looking to modify the list of places a shortcut can be sent to.  What I'm looking at is when you right click a blank area of your desktop or a blank area in your my documents folder, there's a "new" item in that context menu that pulls out a submenu with folder, shortcut, briefcase, etc., etc. in it.   It's that 2nd item in the submenu, "shortcut", that I'm trying to do away with.
0
 
LVL 31

Expert Comment

by:Gareth Gudger
ID: 10745548
Haven't found anything yet....still searching... :)
0
 
LVL 16

Expert Comment

by:mdiglio
ID: 10747826
Hello,
You can try this method using the registry
navigate to HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\New
and then blank out the default string value of {D969A300-E7FF-11d0-A93B-00A0C90F2719}

Before setting the default string to be blank you should export the New key for a backup.

Doing this should not affect right click a file and saying 'send to'

0
 
LVL 84

Accepted Solution

by:
oBdA earned 500 total points
ID: 10752210
The easiest way to achieve this is to redirect the command that is executed when the "New Shortcut" menu is chosen.
The original location is HKLM\Software\Classes\.lnk\ShellNew, a REG_SZ value named "Command".
I guess you want to exclude administrators and maybe some other people from this; in that case, creating the value under HKCU\... will work as well.
You should be able to set this using group policies with a custom adm template.
This will not be a proper group policy, though, it will be a "preferred setting" or "branding", as this will write to the registry outside of the "policies" keys; so if you want to remove the setting, deleting the GPO or setting it to "not configured" will *NOT* work, it needs to be explicitely undone.
If you just want nothing (much) to happen, use "%Comspec% /c del "%1" for the command; that will immediately delete the new shortcut, instead of calling the wizard.
If you want to inform the users that they are behaving badly (and assuming that you have wscript on your clients), you can inform them that the action has been restricted by redirecting the command to the (not very sophisticated) vbscript below; either deploy it to your clients, or, if your network is stable enough (and there are no laptops with cached credentials logon involved), run it from, for example, the netlogon share.
As usual: No warranties included, use it at your own risk, test it before you apply it in earnest.

====8<----[ShellNew.adm]----
CLASS USER

CATEGORY !!AdditionalSettings
  CATEGORY !!Explorer
    POLICY !!ShellNew
      KEYNAME "Software\Classes\.lnk\ShellNew"
      PART !!Command TEXT END PART
      PART " " COMBOBOX REQUIRED
        VALUENAME "Command"
        SUGGESTIONS
          !!NewLinkDeleteOnly
          !!NewLinkScript
        END SUGGESTIONS
        DEFAULT !!NewLinkDeleteOnly
      END PART
    END POLICY ; ShellNew
  END CATEGORY ; Explorer
END CATEGORY

[strings]
AdditionalSettings=Additional settings
Explorer=Windows Explorer
ShellNew=Disable 'New Shortcut' in context menu
Command=Command:
NewLinkDeleteOnly=%Comspec% /c del "%1"
NewLinkScript=wscript "\\%Logonserver%\netlogon\ShellNew.vbs" "%1"
====8<----[ShellNew.adm]----

====8<----[ShellNew.vbs]----
msgbox "This function has been disabled by the administrator!", vbOKOnly + vbExclamation, "Restricted function!"
set fs = CreateObject("Scripting.FileSystemObject")
fs.DeleteFile(Wscript.Arguments(0))
====8<----[ShellNew.vbs]----
0
 
LVL 4

Author Comment

by:WerewolfTA
ID: 10757252
Thanks, guys.  Monday's are usually hectic around here, so give me a couple of days to try out your suggestions on a test machine and see what works out best.
0
 
LVL 31

Expert Comment

by:Gareth Gudger
ID: 10758785
Yea I was looking at the "HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\New" key myself... seemed right but wasn't sure which part to delete....
0
 
LVL 4

Author Comment

by:WerewolfTA
ID: 10775472
oBdA,
  I couldn't get your adm file to work (bummer, and I've never written a custom adm file so I have no idea what went wrong.  It created the Additional Settings\Windows Explorer folder but with nothing inside), but you pointed me in the right direction, got me enough info to come up with a working solution, and gave me a new idea (with the vbs script).  Thanks for the help.
0
 
LVL 84

Expert Comment

by:oBdA
ID: 10775640
Maybe I should have mentioned that more specifically: Since this is not a policy (as I actually mentioned), the policy editor MMC will not display it in the default setting. Highlight the "Administrative Templates" tree, then from the "View" menu uncheck the "Show policies only" (or similar); the editor will now show the "branding" settings in red (while the real policies are in blue).
0
 
LVL 4

Author Comment

by:WerewolfTA
ID: 10776103
Yes, you did say that about it not being an actual policy.  I didn't know about that filter.  Changing that made the settings show up under my gpo, and I suspect that little bit of information will prove useful in the future. Thanks.  Also, just to pass along to anyone who might be reading this in the future, I was able to combine both of the commands you provided above as NewLinkDeleteOnly and NewLinkScript into one as follows:  
%Comspec% /c del "%1" && wscript "\\%Logonserver%\netlogon\ShellNew.vbs"

I just asked a similar question here, wanted to give you first crack at it:
http://www.experts-exchange.com/Security/Win_Security/Q_20946629.html
0
 
LVL 84

Expert Comment

by:oBdA
ID: 10776179
No need to combine the two: The script will delete the short cut as well: fs.DeleteFile(Wscript.Arguments(0))
The difference is just that the "comspec" version doesn't require the script deployment; you only need one of the solutions, not both.
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us in IT utilize a combination of roaming profiles and folder redirection to ensure user information carries over from one workstation to another; in my environment, it was to enable virtualization without needing a separate desktop for each…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question