{"id":4764,"date":"2023-05-12T13:48:38","date_gmt":"2023-05-12T20:48:38","guid":{"rendered":"https:\/\/SUMMALAI.COM\/?p=4764"},"modified":"2023-05-12T13:48:39","modified_gmt":"2023-05-12T20:48:39","slug":"how-to-create-desktop-shortcuts-from-command-line","status":"publish","type":"post","link":"https:\/\/SUMMALAI.COM\/?p=4764","title":{"rendered":"How to Create Desktop Shortcuts from Command Line"},"content":{"rendered":"\n<p>Most people will simply create a shortcut by using the shortcut wizard in Windows. But you can also create&nbsp;<a href=\"https:\/\/supertechman.com.au\/creating-shortcuts\/\" target=\"_blank\" rel=\"noreferrer noopener\">a shortcut<\/a>&nbsp;from the command line. You may be asking yourself, Why would I want to create a shortcut from the command line??!! Well, in some cases you may want to automate the creation of a shortcut through a batch file to push out to users on a network or there may be an issue that is stopping you from using the wizard. If not for any reason at all, it might be just fun to do for something different.<\/p>\n\n\n\n<p>If you want to create shortcuts from command-line in Windows, here\u2019s how. \u2013<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How to create a shortcut from the command line<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/1.bp.blogspot.com\/--NZOHg4FLJM\/UPTOjpffrsI\/AAAAAAAAXh8\/8wylb9p0S0E\/s1600\/Shortcut.png?resize=677%2C355\" alt=\"Shortcut\" title=\"Shortcut\"\/><\/figure>\n\n\n\n<p>A shortcut is a small program, weighing just 56KB, that allows you to create, modify or query Windows shortcuts from the command line.<\/p>\n\n\n\n<p>Its syntax is:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Shortcut.exe \/F:filename \/A:C|E|Q [\/T:target] [\/P:parameters] [\/W:workingdir] [\/R:runstyle] [\/I:icon,index] [\/H:hotkey] [\/D:description]<\/pre>\n\n\n\n<p>For example, to create shortcut to Calculator in the current directory, the command would be as :<ins>h<\/ins><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">shortcut.exe \/F:Calculator.lnk \/A:C \/T:C:\\Windows\\System32\\calc.exe<\/pre>\n\n\n\n<p>Shortcut lets you define custom icon for the shortcut, keyboard shortcut, define running mode, and more by adding additional parameters to the command. The complete list of supported parameters for the program is listed below.<\/p>\n\n\n\n<p>Shortcut parameters:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/F:filename\t: Specifies the .LNK shortcut file.\n\/A:action\t: Defines the action to take (C=Create, E=Edit or Q=Query).\n\/T:target\t: Defines the target path and file name the shortcut points to.\n\/P:parameters\t: Defines the command-line parameters to pass to the target.\n\/W:working dir\t: Defines the working directory the target starts with.\n\/R:run style\t: Defines the window state (1=Normal, 3=Max, 7=Min).\n\/I:icon,index\t: Defines the icon and optional index (file.exe or file.exe,0).\n\/H:hotkey\t: Defines the hotkey, a numeric value of the keyboard shortcut.\n\/D:description\t: Defines the description (or comment) for the shortcut.<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Internet Shortcuts<\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Unlike file\/folder shortcuts, Internet Explorer Favourite (.URL) files are simple text files that you can create with a text editor or a couple of ECHO statements:<\/p><p>Echo [InternetShortcut] &gt; demo.url<br>Echo URL=https:\/\/supertechman.com.au\/ &gt;&gt; demo.url<\/p><\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Edge Shortcuts<\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>If Edge is not your default browser, but you want to open a web page using Edge, set the Shortcut&nbsp;<em>Target<\/em>&nbsp;to a path like the following:<\/p><p>%windir%\\explorer.exe microsoft-edge:https:\/\/supertechman.com.au<\/p><\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Internet Explorer 11 Pinned sites<\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>If you drag a URL\/Icon from the address bar of IE 11 to the desktop, that will create an IE Pinned site (.website) link.<\/p><p>\u201cPinned sites\u201d are designed specifically to only ever open in IE 11, you should use them for legacy systems containing Active-X controls or other cruft that won\u2019t work in Microsoft Edge.<\/p><\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Chrome Shortcuts<\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>If Chrome is not your default browser, but you want to open a web page using Chrome, set the Shortcut&nbsp;<em>Target<\/em>&nbsp;to a path like the following, note that Chrome installs itself in the x86 folder even though it is a 64 bit application:<\/p><p>\u201cC:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\u201d https:\/\/supertechman.com.au<\/p><\/blockquote>\n\n\n\n<p>Ref: https:\/\/supertechman.com.au\/how-to-create-desktop-shortcuts-from-command-line\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most people will simply create a shortcut by using the shortcut wizard in Windows. But you can also create&nbsp;a shortcut&nbsp;from the command line. You may be asking yourself, Why would I want to create a shortcut from the command line??!! Well, in some cases you may want to automate the creation of a shortcut through <a class=\"read-more\" href=\"https:\/\/SUMMALAI.COM\/?p=4764\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1185,1249,10,14,15],"tags":[1599,1598],"class_list":["post-4764","post","type-post","status-publish","format-standard","hentry","category-autopilot-intune","category-azure-microsoft","category-microsoft","category-windows-7-8-10","category-windows-servers","tag-create-desktop-shortcuts-from-cmd","tag-create-desktop-shortcuts-from-command-line"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4764","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4764"}],"version-history":[{"count":1,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4764\/revisions"}],"predecessor-version":[{"id":4765,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4764\/revisions\/4765"}],"wp:attachment":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4764"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4764"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4764"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}