{"id":18617,"date":"2020-09-15T06:04:43","date_gmt":"2020-09-15T06:04:43","guid":{"rendered":"http:\/\/198.58.113.91\/blog\/?p=18617"},"modified":"2020-09-16T13:53:15","modified_gmt":"2020-09-16T13:53:15","slug":"open-file-folder-path-clipboard-using-shortcut","status":"publish","type":"post","link":"https:\/\/www.winhelponline.com\/blog\/open-file-folder-path-clipboard-using-shortcut\/","title":{"rendered":"How to Open File or Folder Path from the Clipboard Using Shortcut"},"content":{"rendered":"<p>Sometimes we may need to copy a file or folder path from your email or chat window to the clipboard, and open the file or folder manually. Most people open the file or folder by launching the Run dialog, pasting the path from the Clipboard, and clicking OK.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-18619 size-full\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2020\/09\/copy-path-clipboard-run-dialog.png\" alt=\"paste path from clipboard to Run dialog\" width=\"399\" height=\"206\" \/><\/p>\n<p>If your job involves doing this sort of task repeatedly, manually opening the Run dialog and pasting the path every time can be tedious. You can simplify this using a keyboard shortcut (hotkey) with the help of a small AutoHotKey (AHK) script.<\/p>\n<div class=\"rp\"><strong>RELATED:<\/strong> <a href=\"https:\/\/www.winhelponline.com\/blog\/regjump-quickly-jump-registry-path-clipboard\/\">Jump to a Registry Path (Stored in Clipboard) Directly Using RegJump<\/a><\/div>\n<p><!--more--><\/p>\n<h2>How to Open the File or Folder Path from the Clipboard<\/h2>\n<p>The AHK script mentioned below reads the file or folder path saved in the clipboard, checks if the path is valid and if so, launches it.<\/p>\n<p><em>AutoHotkey is a free, open-source scripting language for Windows that allows users to easily create small to complex scripts for all kinds of tasks such as form fillers, auto-clicking, macros, etc.<\/em><\/p>\n<ol>\n<li>Download <a href=\"https:\/\/www.autohotkey.com\/\" target=\"_blank\" rel=\"noopener nofollow noreferrer\">AutoHotkey<\/a> and install it.<\/li>\n<li>Right-click on the desktop, click New, and select <strong>AutoHotkey Script<\/strong>.<\/li>\n<li>Rename the script file <code>New AutoHotkey Script.ahk<\/code> to <code>open_path_clipboard.ahk<\/code><\/li>\n<li>Right-click the file and choose <strong>Edit Script<\/strong><\/li>\n<li>Remove all lines in the script and replace it with the following code:\n<pre>^+o::openpathfromclipboard()\r\n\r\nopenpathfromclipboard() {\r\nstrpath = %Clipboard%\r\nstrpath := StrReplace(strpath,\"\"\"\")\r\nstrpath := StrReplace(strpath,\"'\")\r\nIf InStr(strpath, \"%\")\r\n{\r\nTransform, strpath, Deref, %strpath%\r\n}\r\n\r\nIf FileExist(strpath)\r\n{\r\nRun, % strpath\r\n}\r\n}<\/pre>\n<\/li>\n<li>Save the file <code>open_path_clipboard.ahk<\/code> and close the editor.<\/li>\n<li>Double-click to run the script. It will show up in the notification area.<\/li>\n<li>Now, copy a file or folder path from your chat window, <a href=\"https:\/\/www.winhelponline.com\/blog\/copy-command-prompt-output-clipboard-save-file\/#copyedit\">Command Prompt<\/a>, or elsewhere to the Clipboard.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18618\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2020\/09\/copy-path-to-clipboard.png\" alt=\"copy path to clipboard from command prompt\" width=\"699\" height=\"195\" \/><\/p>\n<div class=\"newline\">The path can be to a file or folder, and it can be in any of the formats listed below:<\/div>\n<pre>C:\\Windows\\System32\r\n\"C:\\Windows\"\r\n%AppData%\r\n%userprofile%\\desktop\r\n'%systemroot%\\system32'\r\n\"%systemroot%\\notepad.exe\"\r\nC:\\Windows\\system32\\cmd.exe<\/pre>\n<\/li>\n<li>Press <strong><kbd>Ctrl<\/kbd> + <kbd>Shift<\/kbd> + <kbd>o<\/kbd><\/strong> to launch the file or folder path stored on the Windows Clipboard. The file\/folder will be launched in the same way as you launch it via the Run dialog or double-click on the item. If the path is a folder, it should open in File Explorer.<\/li>\n<\/ol>\n<h3>Script Customization<\/h3>\n<p>You can change the keyboard hotkey in the (1st line of the) script if you need it. Here are the modifiers.<\/p>\n<ul>\n<li><code>!<\/code> \u2003 {Alt}<\/li>\n<li><code>+<\/code> \u2003 {Shift}<\/li>\n<li><code>^<\/code> \u2003 {Ctrl}<\/li>\n<li><code>#<\/code> \u2003 {Winkey}<\/li>\n<\/ul>\n<p>For example, for <kbd>Ctrl<\/kbd> + <kbd>Alt<\/kbd> + <kbd>Shift<\/kbd> + <kbd>O<\/kbd>, you\u2019d use <strong><code>^!+o<\/code><\/strong>.<\/p>\n<p><em>(For the full list of keys that you can send or intercept, see AutoHotkey <a href=\"https:\/\/www.autohotkey.com\/docs\/commands\/Send.htm\" target=\"_blank\" rel=\"noopener nofollow noreferrer\">SendInput<\/a> documentation.)<\/em><\/p>\n<div class=\"qt\">\n<h3>Other AutoHotKey scripts<\/h3>\n<p>We&#8217;ve covered some <a href=\"https:\/\/www.google.com\/search?q=autohotkey+site%3Awinhelponline.com\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">AutoHotKey scripts<\/a> before. Here are some samples:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.winhelponline.com\/blog\/clear-recent-files-history-in-a-single-click-in-windows\/\">Clear Recent Files history Using Script in Windows 10<\/a><\/li>\n<li><a href=\"https:\/\/www.winhelponline.com\/blog\/insert-date-time-in-any-program-using-keyboard-hotkey\/\">Insert Date\/Time in Any Program Using Keyboard Hotkey<\/a><\/li>\n<li><a href=\"https:\/\/www.winhelponline.com\/blog\/winkey-e-shortcut-target-change\/\">How to Change WinKey + E Shortcut Target in Windows 10<\/a><\/li>\n<li><a href=\"https:\/\/www.winhelponline.com\/blog\/start-snipping-tool-capture-mode-default\/\">How to Make Snipping Tool Default to New Snip when Launched<\/a><\/li>\n<li><a href=\"https:\/\/www.winhelponline.com\/blog\/clear-all-notifications-action-center-using-keyboard-shortcut\/\">Clear all notifications in Action Center using Keyboard or Shortcut<\/a><\/li>\n<li><a href=\"https:\/\/www.winhelponline.com\/blog\/open-command-prompt-current-folder-keyboard-shortcut\/\">Open Command Prompt in Current Folder Using Keyboard Shortcut<\/a><\/li>\n<li><a href=\"https:\/\/www.winhelponline.com\/blog\/run-bat-files-invisibly-without-displaying-command-prompt\/#comment-2710\">How to run Batch files invisibly, without displaying Command Prompt<\/a><\/li>\n<li><a href=\"https:\/\/www.winhelponline.com\/blog\/photos-app-scroll-zoom-prev-next-image-wheel-settings\/\">Photos App Mouse Wheel Settings: Scroll to Zoom or View Prev\/Next<\/a><\/li>\n<\/ul>\n<\/div>\n<p>Hope that helped you quickly open a file or folder path stored on the clipboard.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes we may need to copy a file or folder path from your email or chat window to the clipboard, and open the file or folder manually. Most people open the file or folder by launching the Run dialog, pasting the path from the Clipboard, and clicking OK. If your job involves doing this sort &#8230; <a title=\"How to Open File or Folder Path from the Clipboard Using Shortcut\" class=\"read-more\" href=\"https:\/\/www.winhelponline.com\/blog\/open-file-folder-path-clipboard-using-shortcut\/\" aria-label=\"Read more about How to Open File or Folder Path from the Clipboard Using Shortcut\">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":[762,480],"class_list":["post-18617","post","type-post","status-publish","format-standard","hentry","category-utilities","category-windows","tag-autohotkey","tag-scripts"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":3178,"url":"https:\/\/www.winhelponline.com\/blog\/winkey-e-shortcut-target-change\/","url_meta":{"origin":18617,"position":0},"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":9842,"url":"https:\/\/www.winhelponline.com\/blog\/open-command-prompt-current-folder-keyboard-shortcut\/","url_meta":{"origin":18617,"position":1},"title":"Open Command Prompt in Current Folder Using Keyboard Shortcut","author":"Ramesh","date":"June 19, 2019","format":false,"excerpt":"There are at least a couple of ways to open Command Prompt in the current folder path from a folder window. The two widely used options include running cmd.exe from the File Explorer address bar and using the Open Command window here option from the folder background context menu. But,\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"open command prompt in current folder - autohotkey","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/06\/open-cmd-here-autohotkey-3.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/06\/open-cmd-here-autohotkey-3.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/06\/open-cmd-here-autohotkey-3.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/06\/open-cmd-here-autohotkey-3.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":3903,"url":"https:\/\/www.winhelponline.com\/blog\/copy-as-path-without-quotes-file-uri-format\/","url_meta":{"origin":18617,"position":2},"title":"How to Copy as Path Without Quotes or in File URI Format","author":"Ramesh","date":"August 26, 2016","format":false,"excerpt":"When using the built-in Copy as Path context menu option or the Copy Path ribbon button to copy file names to clipboard, the output would contain quotes for file\/folder name paths, such as below. There are some situations where you don't need quotes whether the file names contain spaces or\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"copy as path without quotes and in URI format","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/08\/copyaspath-uri-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/08\/copyaspath-uri-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/08\/copyaspath-uri-1.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":275,"url":"https:\/\/www.winhelponline.com\/blog\/add-copy-as-path-right-click-menu-in-xp\/","url_meta":{"origin":18617,"position":3},"title":"How to Add &#8220;Copy as Path&#8221; to Right Click Menu in Windows XP","author":"Ramesh","date":"May 10, 2008","format":false,"excerpt":"Windows Vista and higher already include the useful Copy as Path option in the context menu, which helps you quickly copy the complete path of the selected file(s) or folder(s) to the Clipboard. Here is how to add \"Copy of Path\" feature in Windows XP. There are two methods discussed,\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\/archived\/copypath.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":231,"url":"https:\/\/www.winhelponline.com\/blog\/copy-target-url-context-menu-option-for-internet-shortcut-url-files\/","url_meta":{"origin":18617,"position":4},"title":"How to Copy Address of a Internet Shortcut (.URL) via Right-click Menu","author":"Ramesh","date":"April 26, 2008","format":false,"excerpt":"The Copy as Path command in the right-click menu is an extremely useful one to quickly copy the full path of a file or folder to clipboard. Similarly, for internet shortcut (.url) files, here is a script that lets you copy the web address (URL) of a internet shortcut, via\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"add \"copy target url\" context menu option for internet shortcuts","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/04\/copytargeturl.gif?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":10543,"url":"https:\/\/www.winhelponline.com\/blog\/how-to-change-shortcut-lnk-targets-in-bulk-using-script\/","url_meta":{"origin":18617,"position":5},"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":[]}],"_links":{"self":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/18617","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=18617"}],"version-history":[{"count":0,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/18617\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/media?parent=18617"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/categories?post=18617"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/tags?post=18617"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}