{"id":95885,"date":"2017-04-03T07:00:00","date_gmt":"2017-04-03T21:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/?p=95885"},"modified":"2019-03-13T01:09:05","modified_gmt":"2019-03-13T08:09:05","slug":"20170403-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20170403-00\/?p=95885","title":{"rendered":"How do I create a shortcut in the Send To menu that runs a program with a command line option?"},"content":{"rendered":"<p>To add an item to your <i>Send To<\/i> menu, create a shortcut in the <i>Send To<\/i> folder. The easy way to do this is to open an Explorer window and type <code>shell:sendto<\/code> in the address bar. This will take you straight to the <i>Send To<\/i> folder. From there, you can right-click an empty space and select <i>New<\/i>&hellip; <i>Shortcut<\/i>, and then fill in the information about the program you want to send to. <\/p>\n<p>The default behavior is to run the shortcut target with the file on the command line. But what if you want the program to run with a special command line option? <\/p>\n<p>When you fill in the information about the shortcut, include the command line options when you say what you want to be a shortcut to: <\/p>\n<div STYLE=\"width: 40em;border: solid 1px black;padding: 2ex;background-color: white\">\n<table BORDER=\"0\" BGCOLOR=\"white\" STYLE=\"font-family: Segoe UI, sans-serif;font-size: 9pt;color: black\">\n<tr>\n<td STYLE=\"font-size: 16pt;color: #0033AA\">What item would you like to create a shortcut for? <\/td>\n<\/tr>\n<tr>\n<td STYLE=\"padding-top: 2em\">This wizard helps you to create shortcuts to local or network programs, files, folders, computers, or Internet addresses. <\/td>\n<\/tr>\n<tr>\n<td STYLE=\"padding-top: 2em\">Type the location of the item: <\/td>\n<\/tr>\n<tr>\n<td STYLE=\"padding-bottom: 2em\">\n<table BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\" STYLE=\"font-family: Segoe UI, sans-serif;font-size: 9pt;color: black;width: 100%\">\n<tr>\n<td STYLE=\"border: solid 1px #569de5;width: 100%;padding: .5ex\">        notepad \/a     <\/td>\n<td WIDTH=\"10\">&nbsp;<\/td>\n<td STYLE=\"border: solid 1px #acacac;padding: .5ex 2ex\">        Browse&hellip;     <\/td>\n<\/tr>\n<\/table>\n<\/td>\n<\/tr>\n<\/table><\/div>\n<p>Here, I&#8217;m creating a shortcut to Notepad with the command line option <code>\/a<\/code> which forces a file to be opened in the <a HREF=\"https:\/\/devblogs.microsoft.com\/oldnewthing\/\">ANSI code page<\/a>. <\/p>\n<p>If you right-click a file and send it to this shortcut, it will run Notepad with the <code>\/a<\/code> command line option. <\/p>\n<p><b>Bonus<\/b>: <i>Send To<\/i> simulates a drop on the shortcut, and this technique applies generally to drag\/drop operations on shortcuts: Create a shortcut anywhere using this technique, then drop a file on the shortcut. It will open Notepad with the <code>\/a<\/code> command line option. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Put the option in the shortcut target.<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[104],"class_list":["post-95885","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-tipssupport"],"acf":[],"blog_post_summary":"<p>Put the option in the shortcut target.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/95885","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=95885"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/95885\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=95885"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=95885"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=95885"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}