Remove the new shortcut item from the context menu

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!
Who is Participating?
oBdAConnect With a Mentor Commented:
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.


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

AdditionalSettings=Additional settings
Explorer=Windows Explorer
ShellNew=Disable 'New Shortcut' in context menu
NewLinkDeleteOnly=%Comspec% /c del "%1"
NewLinkScript=wscript "\\%Logonserver%\netlogon\ShellNew.vbs" "%1"

msgbox "This function has been disabled by the administrator!", vbOKOnly + vbExclamation, "Restricted function!"
set fs = CreateObject("Scripting.FileSystemObject")
Gareth GudgerCommented:
What item are you trying to remove?
WerewolfTAAuthor Commented:
The item that lets them create a new blank shortcut (r. click -> new -> shortcut) on the desktop.
Protect Your Employees from Wi-Fi Threats

As Wi-Fi growth and popularity continues to climb, not everyone understands the risks that come with connecting to public Wi-Fi or even offering Wi-Fi to employees, visitors and guests. Download the resource kit to make sure your safe wherever business takes you!

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.
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.

@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"

Resource Kits Free Tool Downloads: Ifmember.exe
WerewolfTAAuthor Commented:
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.
Gareth GudgerCommented:
Haven't found anything yet....still searching... :)
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'

WerewolfTAAuthor Commented:
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.
Gareth GudgerCommented:
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....
WerewolfTAAuthor Commented:
  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.
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).
WerewolfTAAuthor Commented:
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:
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.