{"id":54807,"date":"2023-06-19T22:52:05","date_gmt":"2023-06-19T17:22:05","guid":{"rendered":"http:\/\/198.58.113.91\/blog\/?p=54807"},"modified":"2023-06-19T22:55:57","modified_gmt":"2023-06-19T17:25:57","slug":"create-shortcut-lnk-non-existent-target","status":"publish","type":"post","link":"https:\/\/www.winhelponline.com\/blog\/create-shortcut-lnk-non-existent-target\/","title":{"rendered":"How to Create a Shortcut (.lnk) to a Non-Existent Target"},"content":{"rendered":"<p>There are situations where you need to create a shortcut (.lnk) to a target that doesn&#8217;t exist on the computer. For instance, you want to create a set of shortcuts for using them on another computer.<\/p>\n<p>However, the Create Shortcut wizard in Windows will not allow you to create a shortcut to a path that does not exist.<!--more--><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-54809\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2023\/06\/create-shortcut-non-existent-target-1.png\" alt=\"create shortcut to a file that does not exist\" width=\"641\" height=\"630\" \/><\/p>\n<p>You&#8217;ll see the &#8220;The file &lt;filename&gt; cannot be found&#8221; error when doing so.<\/p>\n<h2>Workarounds<\/h2>\n<h3>1: Use a VBScript<\/h3>\n<p>You can use a VBScript to create a shortcut (i.e., <strong>.lnk<\/strong> files, which are also known as Windows shell links) to a non-existent target. Here&#8217;s a sample script that creates a shortcut to Winword.exe.<\/p>\n<pre>Set WshShell = WScript.CreateObject(\"WScript.Shell\")\r\nstrDesktop = WshShell.SpecialFolders(\"Desktop\")\r\nSet oShellLink = WshShell.CreateShortcut(strDesktop &amp; \"\\Word.lnk\")\r\noShellLink.TargetPath = \"C:\\Program Files\\Microsoft Office\\Office16\\Winword.exe\"\r\noShellLink.IconLocation = \"C:\\Program Files\\Microsoft Office\\Office16\\Winword.exe, 0\"\r\noShellLink.Description = \"Microsoft Word\"\r\noShellLink.Save\r\n<\/pre>\n<p>Copy the above code to Notepad, save the file as &#8220;winword.vbs&#8221; and double-click to run it.<\/p>\n<p>It creates a Word shortcut on the desktop, whether the target executable exists or not.<\/p>\n<hr \/>\n<div class=\"rp\"><strong>RELATED:<\/strong> <a href=\"https:\/\/www.winhelponline.com\/blog\/how-to-change-shortcut-lnk-targets-in-bulk-using-script\/\">How to Change Shortcut (.lnk) Target in Bulk Using Script<\/a><\/div>\n<h3>2: Use Shortcut.exe from OptimumX<\/h3>\n<p>Shortcut.exe is an old program from OptimumX.com that creates shortcuts using a command line. The program hasn&#8217;t been updated for over a decade, but it works on Windows 10 as well.<\/p>\n<p>You can download it from <code>https:\/\/www.optimumx.com\/downloads.html#Shortcut<\/code><\/p>\n<p>This utility allows you to create, modify or query Windows shell links (shortcuts) from the command-line. You can export the properties of an existing shortcut to a text file in .INI format. Use &#8216;<code>Shortcut.exe \/?<\/code>&#8216; to view the syntax.<\/p>\n<p>Requirements: Windows XP 64-bit or later. Windows 95 or later for Shortcut32.exe.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre>Shortcut.exe \/F:winword.lnk \/A:C \/T:\"C:\\Program Files\\Microsoft Office\\Office16\\Winword.exe\" \/d:\"Microsoft Word\"<\/pre>\n<p>The above command creates a shortcut to Winword.exe.<\/p>\n<p><strong>Command-line arguments<\/strong><\/p>\n<pre>Shortcut [Version 1.20]\r\n\r\nCreates, modifies or queries Windows shell links (shortcuts)\r\n\r\n\r\nThe syntax of this command is:\r\n\r\nShortcut.exe \/F:filename \/A:C|E|Q [\/T:target] [\/P:parameters] [\/W:workingdir]\r\n\t [\/R:runstyle] [\/I:icon,index] [\/H:hotkey] [\/D:description]\r\n\r\n \/F:filename\t: Specifies the .LNK shortcut file.\r\n \/A:action\t: Defines the action to take (C=Create, E=Edit or Q=Query).\r\n \/T:target\t: Defines the target path and file name the shortcut points to.\r\n \/P:parameters\t: Defines the command-line parameters to pass to the target.\r\n \/W:working dir\t: Defines the working directory the target starts with.\r\n \/R:run style\t: Defines the window state (1=Normal, 3=Max, 7=Min).\r\n \/I:icon,index\t: Defines the icon and optional index (file.exe or file.exe,0).\r\n \/H:hotkey\t: Defines the hotkey, a numeric value of the keyboard shortcut.\r\n \/D:description\t: Defines the description (or comment) for the shortcut.\r\n\r\n Notes:\r\n - Any argument that contains spaces must be enclosed in \"double quotes\".\r\n - If Query is specified (\/A:Q), all arguments except \/F: are ignored.\r\n - To find the numeric hotkey value, use Explorer to set a hotkey and then \/A:Q\r\n - To prevent an environment variable from being expanded until the shortcut \r\n   is launched, use the ^ carat escape character like this: ^%WINDIR^%\r\n\r\n Examples:\r\n   \/f:\"%ALLUSERSPROFILE%\\Start Menu\\Programs\\My App.lnk\" \/a:q\r\n   \/f:\"%USERPROFILE%\\Desktop\\Notepad.lnk\" \/a:c \/t:^%WINDIR^%\\Notepad.exe \/h:846\r\n   \/f:\"%USERPROFILE%\\Desktop\\Notepad.lnk\" \/a:e \/p:C:\\Setup.log \/r:3\r\n\r\n An argument of \/? or -? displays this syntax and returns 1.\r\n A successful completion will return 0.\r\n\r\n\r\n Copyright 2000-2005 Marty List, www.OptimumX.com\r\n<\/pre>\n<hr>\n<h3>3. Place a dummy file<\/h3>\n<p>Another option is to place a dummy file (e.g., winword.exe) in the target location. And then create a shortcut to the dummy target by using the Create Shortcut wizard. After creating the shortcut, the dummy file can be deleted.<\/p>\n<p>I hope the above information helps.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are situations where you need to create a shortcut (.lnk) to a target that doesn&#8217;t exist on the computer. For instance, you want to create a set of shortcuts for using them on another computer. However, the Create Shortcut wizard in Windows will not allow you to create a shortcut to a path that &#8230; <a title=\"How to Create a Shortcut (.lnk) to a Non-Existent Target\" class=\"read-more\" href=\"https:\/\/www.winhelponline.com\/blog\/create-shortcut-lnk-non-existent-target\/\" aria-label=\"Read more about How to Create a Shortcut (.lnk) to a Non-Existent Target\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6,7],"tags":[480,763],"class_list":["post-54807","post","type-post","status-publish","format-standard","hentry","category-utilities","category-windows","tag-scripts","tag-vbscript"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":10543,"url":"https:\/\/www.winhelponline.com\/blog\/how-to-change-shortcut-lnk-targets-in-bulk-using-script\/","url_meta":{"origin":54807,"position":0},"title":"How to Change Shortcut (.lnk) Target in Bulk Using Script","author":"Ramesh","date":"July 31, 2019","format":false,"excerpt":"Many users have shortcuts pointing to various network shares from other systems or your domain's storage server. If your company migrates the server and changes the computer name, share name, or folder path, you need to manually update the shortcut targets to point to the right destination. In most cases,\u2026","rel":"","context":"In &quot;Utilities&quot;","block_context":{"text":"Utilities","link":"https:\/\/www.winhelponline.com\/blog\/category\/utilities\/"},"img":{"alt_text":"shortcuts search and replace bulk","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/07\/shortcut-search-replace.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/07\/shortcut-search-replace.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/07\/shortcut-search-replace.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/07\/shortcut-search-replace.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":75329,"url":"https:\/\/www.winhelponline.com\/blog\/refresh-thumbnails-folder-shortcuts\/","url_meta":{"origin":54807,"position":1},"title":"How to Refresh Thumbnails of Folder Shortcuts (.lnk)","author":"Ramesh","date":"May 31, 2024","format":false,"excerpt":"When you create a desktop shortcut to a folder, the folder shortcut thumbnail icon reflects what was in the folder it points to at creation. Later, when you add or remove files to the target folder, the folder thumbnails get updated dynamically, but the folder shortcut thumbnails remain the same.\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"folder shortcut thumbnails not refreshing","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/05\/folder-shortcut-thumbnail.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":273,"url":"https:\/\/www.winhelponline.com\/blog\/add-the-open-file-location-context-menu-for-shortcuts-in-windows-xp\/","url_meta":{"origin":54807,"position":2},"title":"How to Add &#8220;Open File Location&#8221; Right-Click Option in Windows XP","author":"Ramesh","date":"May 9, 2008","format":false,"excerpt":"Windows Vista and Windows 7 include the Open file location context menu item for Shortcuts, which helps you quickly open the target folder of a shortcut. In Windows XP, it takes four mouse clicks to accomplish the task. To open the target folder of a shortcut in Windows XP, you\u2026","rel":"","context":"In &quot;Windows XP&quot;","block_context":{"text":"Windows XP","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-xp\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/opentargetdir.gif?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1028,"url":"https:\/\/www.winhelponline.com\/blog\/open-file-location-missing-right-click-shortcut-windows-7-vista\/","url_meta":{"origin":54807,"position":3},"title":"&#8220;Open File Location&#8221; Missing in Right-Click Menu for Shortcuts","author":"Ramesh","date":"March 9, 2007","format":false,"excerpt":"When you right-click on a shortcut (.lnk file), the option Open file location may be missing from the right-click menu. This happens if the\u00a0IsShortcut registry value for .lnk files (Shortcuts) is deleted\u00a0in an attempt to hide the overlay icon\u00a0in\u00a0shortcuts. To resolve the problem, re-create the IsShortcut registry value. Method 1\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3178,"url":"https:\/\/www.winhelponline.com\/blog\/winkey-e-shortcut-target-change\/","url_meta":{"origin":54807,"position":4},"title":"How to Change Win + E Shortcut Target in Windows 10\/11","author":"Ramesh","date":"June 1, 2016","format":false,"excerpt":"The WinKey + E keystroke, as well as the File Explorer shortcut on the taskbar, open Quick access view by default. You can change the default folder to This PC using Folder Options General tab, or make it open to the Downloads\u00a0folder using a registry method. But, how to make\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"File Explorer shortcut","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/06\/winkey-e-2.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1083,"url":"https:\/\/www.winhelponline.com\/blog\/pin-to-taskbar-start-menu-missing-context-menu-windows-7\/","url_meta":{"origin":54807,"position":5},"title":"&#8220;Pin to Taskbar&#8221; and &#8220;Pin to Start Menu&#8221; Missing in Windows 7","author":"Ramesh","date":"September 15, 2010","format":false,"excerpt":"After deleting the IsShortcut registry value to remove the shortcut arrow overlay in shortcuts (.lnk) files, you may notice that the \"Pin to Taskbar\" and the \"Pin to Start Menu\" context menu items go missing when you right-click on a shortcut. Also, one or more of the context menu items\u2026","rel":"","context":"In &quot;Windows 7&quot;","block_context":{"text":"Windows 7","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-7\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/54807","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/comments?post=54807"}],"version-history":[{"count":0,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/54807\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/media?parent=54807"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/categories?post=54807"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/tags?post=54807"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}