Easier way to copy the path to a file or directory to the clipboard in visual studio? - Stack Overflow (https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196) (https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a) (https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a) (Stack Overflow) (/opensearch.xml) (https://stackoverflow.com/questions/5668524/easier-way-to-copy-the-path-to-a-file-or-directory-to-the-clipboard-in-visual-st) (https://cdn.sstatic.net/Shared/stacks.css?v=bd2aba62c5a4) (https://cdn.sstatic.net/Sites/stackoverflow/primary.css?v=7d8876444382) (Feed for question 'Easier way to copy the path to a file or directory to the clipboard in visual studio?') (/feeds/question/5668524) (https://cdn.sstatic.net/Shared/Channels/channels.css?v=5981bb1a5bd7) (https://accounts.google.com/gsi/style) (site logo) Join Stack Overflow By clicking “Sign up”, you agree to our (/legal/terms-of-service/public) terms of service and acknowledge you have read our (/legal/privacy-policy) privacy policy . (9b9d1ff1208457cf29de4d03e17fc06b55f301e0c5c48e7398c73e63b318268a) (1) (2.0) Sign up with Google Sign up with GitHub OR (9b9d1ff1208457cf29de4d03e17fc06b55f301e0c5c48e7398c73e63b318268a) (1) () () () () () () Email Password (8+ characters (at least 1 letter & 1 number)) Sign up Already have an account? (/users/login) Log in (9b9d1ff1208457cf29de4d03e17fc06b55f301e0c5c48e7398c73e63b318268a) () Skip to main content (https://stackoverflow.com) Stack Overflow (https://stackoverflow.co/) About Products (https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav-bar&utm_content=overflowai) OverflowAI (https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-for-teams) Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers (https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=stack-overflow-advertising) Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand (https://stackoverflow.co/teams/ai/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-ai) OverflowAI GenAI features for Teams (https://stackoverflow.co/api-solutions/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=overflow-api) OverflowAPI Train & fine-tune LLMs (https://stackoverflow.co/labs/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=labs) Labs The future of collective knowledge sharing (https://stackoverflow.co/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=about-the-company) About the company (https://stackoverflow.blog/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=top-nav&utm_content=blog) Visit the blog (Search…) () Loading… (https://stackoverflow.com) current community (https://stackoverflow.com) (Stack Overflow) Stack Overflow (https://stackoverflow.com/help) help (https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com) chat (https://meta.stackoverflow.com) (Meta Stack Overflow) Meta Stack Overflow your communities (https://stackoverflow.com/users/signup?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f5668524%2feasier-way-to-copy-the-path-to-a-file-or-directory-to-the-clipboard-in-visual-st) Sign up or (https://stackoverflow.com/users/login?ssrc=site_switcher&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f5668524%2feasier-way-to-copy-the-path-to-a-file-or-directory-to-the-clipboard-in-visual-st) log in to customize your list. (https://stackexchange.com/sites) more stack exchange communities (https://stackoverflow.blog) company blog (Click to show search) (https://stackoverflow.com/users/login?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f5668524%2feasier-way-to-copy-the-path-to-a-file-or-directory-to-the-clipboard-in-visual-st) Log in (https://stackoverflow.com/users/signup?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f5668524%2feasier-way-to-copy-the-path-to-a-file-or-directory-to-the-clipboard-in-visual-st) Sign up Let's set up your homepage Select a few topics you're interested in: python javascript c# reactjs java android html flutter c++ node.js typescript css r php angular next.js spring-boot machine-learning sql excel ios azure docker Or search from our full list: (Search) javascript python java c# php android html jquery c++ css ios sql mysql r reactjs node.js arrays c asp.net json python-3.x .net ruby-on-rails sql-server swift django angular objective-c excel pandas angularjs regex typescript ruby linux ajax iphone vba xml laravel spring asp.net-mvc database wordpress string flutter postgresql mongodb wpf windows amazon-web-services xcode bash git oracle-database spring-boot dataframe azure firebase list multithreading docker vb.net react-native eclipse algorithm powershell macos visual-studio numpy image forms scala function vue.js performance twitter-bootstrap selenium winforms kotlin loops express dart hibernate sqlite matlab python-2.7 shell rest apache entity-framework android-studio csv maven api linq qt dictionary unit-testing facebook asp.net-core tensorflow apache-spark file swing class unity-game-engine sorting date authentication go symfony t-sql opencv matplotlib .htaccess google-chrome for-loop datetime codeigniter http perl validation sockets google-maps object uitableview xaml oop if-statement visual-studio-code cordova ubuntu web-services email android-layout github elasticsearch spring-mvc kubernetes selenium-webdriver ms-access user-interface parsing ggplot2 pointers machine-learning google-sheets c++11 security flask google-apps-script ruby-on-rails-3 templates nginx variables exception sql-server-2008 gradle debugging tkinter listview delphi jpa asynchronous pdf web-scraping haskell jsp ssl amazon-s3 google-cloud-platform jenkins testing xamarin wcf npm batch-file generics ionic-framework network-programming unix recursion google-app-engine mongoose visual-studio-2010 .net-core android-fragments assembly animation math next.js session svg hadoop intellij-idea curl django-models join laravel-5 rust winapi url heroku http-redirect tomcat google-cloud-firestore inheritance webpack keras image-processing gcc asp.net-mvc-4 web logging dom swiftui matrix pyspark actionscript-3 button post optimization firebase-realtime-database jquery-ui iis cocoa xpath d3.js javafx firefox internet-explorer xslt caching select asp.net-mvc-3 opengl events asp.net-web-api plot dplyr magento encryption search stored-procedures amazon-ec2 ruby-on-rails-4 memory canvas audio multidimensional-array jsf random vector cookies redux facebook-graph-api input flash xamarin.forms indexing arraylist ipad cocoa-touch data-structures video apache-kafka model-view-controller serialization jdbc woocommerce routes razor azure-devops awk servlets mod-rewrite beautifulsoup docker-compose excel-formula iframe filter aws-lambda design-patterns text django-rest-framework visual-c++ cakephp mobile android-intent react-hooks struct methods groovy mvvm ssh lambda checkbox ecmascript-6 google-chrome-extension time grails installation sharepoint cmake shiny spring-security jakarta-ee android-recyclerview plsql core-data types meteor android-activity sed bootstrap-4 websocket activerecord graph replace scikit-learn file-upload group-by vim junit boost deep-learning import sass memory-management error-handling async-await dynamic eloquent soap silverlight dependency-injection charts layout apache-spark-sql deployment browser gridview svn while-loop google-bigquery vuejs2 ffmpeg dll highcharts view foreach plugins makefile c#-4.0 redis reporting-services jupyter-notebook merge server unicode https reflection google-maps-api-3 twitter oauth-2.0 extjs pytorch axios terminal pip split mysqli cmd django-views encoding database-design automation collections netbeans hash build data-binding ember.js tcp sqlalchemy pdo apache-flex concurrency entity-framework-core command-line spring-data-jpa printing java-8 react-redux jestjs service html-table neo4j lua ansible parameters module material-ui enums visual-studio-2012 promise flexbox outlook webview firebase-authentication web-applications uwp jquery-mobile utf-8 datatable python-requests parallel-processing drop-down-menu colors scroll hive tfs scipy count syntax ms-word twitter-bootstrap-3 ssis google-analytics fonts three.js constructor powerbi rxjs graphql file-io paypal discord cassandra socket.io graphics compiler-errors gwt react-router nlp solr url-rewriting backbone.js memory-leaks datatables oauth datagridview terraform drupal oracle11g zend-framework neural-network knockout.js triggers django-forms interface google-api angular-material casting jmeter linked-list path proxy timer django-templates arduino orm directory visual-studio-2015 parse-platform windows-phone-7 cron push-notification conditional-statements primefaces functional-programming pagination model jar xamarin.android hyperlink uiview visual-studio-2013 gitlab vbscript google-cloud-functions azure-active-directory jwt download swift3 sql-server-2005 configuration process rspec pygame properties combobox callback windows-phone-8 linux-kernel safari permissions scrapy raspberry-pi scripting emacs clojure x86 scope io compilation mongodb-query nhibernate responsive-design angularjs-directive expo request azure-functions bluetooth 3d dns binding reference discord.js architecture playframework version-control pyqt doctrine-orm package pycharm get sql-server-2012 rubygems f# autocomplete datepicker openssl kendo-ui tree jackson controller yii grep nested xamarin.ios static dockerfile statistics transactions datagrid null active-directory uiviewcontroller phpmyadmin webforms discord.py notifications sas computer-vision duplicates mocking youtube nullpointerexception yaml menu sum bitmap electron asp.net-mvc-5 visual-studio-2008 time-series blazor yii2 jsf-2 css-selectors stl android-listview floating-point cryptography ant stream hashmap character-encoding msbuild sdk asp.net-core-mvc google-drive-api selenium-chromedriver jboss joomla navigation cors devise anaconda background camera multiprocessing pyqt5 binary frontend cuda linq-to-sql iterator mariadb onclick plotly ios7 rabbitmq android-jetpack-compose android-asynctask microsoft-graph-api tabs laravel-4 insert uicollectionview environment-variables amazon-dynamodb linker console xsd coldfusion upload continuous-integration ftp textview opengl-es operating-system vuejs3 mockito localization xml-parsing macros formatting json.net kivy type-conversion data.table timestamp calendar integer segmentation-fault android-ndk drag-and-drop prolog char crash jasmine automated-tests dependencies geometry android-gradle-plugin itext firebase-cloud-messaging header fortran sprite-kit mfc attributes nuxt.js nosql format azure-pipelines nestjs odoo jquery-plugins db2 jenkins-pipeline leaflet event-handling postman flutter-layout julia annotations keyboard textbox arm visual-studio-2017 gulp libgdx stripe-payments xampp synchronization crystal-reports timezone dom-events azure-web-app-service android-emulator uikit swagger wso2 sequelize.js namespaces aggregation-framework uiscrollview jvm google-sheets-formula chart.js com subprocess geolocation webdriver centos html5-canvas widget dialog garbage-collection snowflake-cloud-data-platform numbers concatenation sql-update qml set windows-10 mapreduce tuples smtp ionic2 java-stream rotation modal-dialog spring-data android-edittext http-headers doctrine radio-button nuget grid sonarqube lucene xmlhttprequest internationalization listbox components initialization switch-statement google-play apache-camel boolean serial-port ldap ios5 youtube-api return gdb pivot eclipse-plugin latex frameworks tags containers github-actions dataset asp-classic subquery foreign-keys label copy uinavigationcontroller c++17 delegates google-cloud-storage struts2 migration base64 protractor find sql-server-2008-r2 queue uibutton embedded arguments composer-php append jaxb zip stack cucumber autolayout ide entity-framework-6 popup iteration airflow windows-7 r-markdown ssl-certificate vb6 tailwind-css gmail hover jqgrid g++ udp Next You’ll be prompted to create an account to view your personalized homepage. (/) Home (/questions) Questions (/tags) Tags (/users) Users (https://stackoverflow.com/jobs/companies?so_medium=stackoverflow&so_source=SiteNav) Companies Labs (/jobs?source=so-left-nav) Jobs (/beta/discussions) Discussions Collectives Communities for your favorite technologies. (/collectives-all) Explore all Collectives Teams () Ask questions, find answers and collaborate at work with Stack Overflow for Teams. (https://stackoverflowteams.com/teams/create/free/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams) Try Teams for free (https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams) Explore Teams Teams Ask questions, find answers and collaborate at work with Stack Overflow for Teams. (https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams-compact) Explore Teams Collectives™ on Stack Overflow Find centralized, trusted content and collaborate around the technologies you use most. (/collectives) Learn more about Collectives Teams Q&A for work Connect and share knowledge within a single location that is structured and easy to search. (https://stackoverflow.co/teams/) Learn more about Teams Get early access and see previews of new features. (https://stackoverflow.co/labs/) Learn more about Labs (Illustration of upvote icon after it is clicked) Hang on, you can't upvote just yet. You'll need to complete a few actions and gain 15 reputation points before being able to upvote. Upvoting indicates when questions and answers are useful. (https://stackoverflow.com/help/whats-reputation) What's reputation and how do I get it? Instead, you can save this post to reference later. Save this post for later Not now (https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a) (/questions/5668524/easier-way-to-copy-the-path-to-a-file-or-directory-to-the-clipboard-in-visual-st) Easier way to copy the path to a file or directory to the clipboard in visual studio? (/questions/ask) Ask Question (2011-04-14 19:21:46Z) Asked 13 years, 11 months ago Modified (?lastactivity) (2025-02-12 09:14:10Z) 1 month ago (Viewed 12,667 times) Viewed 13k times This question shows research effort; it is useful and clear (69:3:31e,16:c4648135d5306f5a,10:1742104418,16:ccea71a03b786563,7:5668524,6ad322fe0113bd5731f4ee608c19323733b7bf294b0c1c00794ab395e9b6a3d2) 16 (This question does not show any research effort; it is unclear or not useful) (69:3:31e,16:0809eb3594c72e56,10:1742104418,16:0caea73d5f6a3587,7:5668524,bc2ba88096a8a932d58699cff4ffd2b8a3a4de1cc3b495ffb25bfe945146715e) Save this question. (/posts/5668524/timeline) Show activity on this post. To accomplish this I've been right-clicking the file or directory and then selecting Show in Windows Explorer, and then copying the path out of the address bar. Is there an add-on or macro that can make this task easier? I'm aware that you can drag a file from Solution Explorer into the editor and it will write out the path, but when doing web development I don't always want the server path, sometimes I want the local path. (/questions/tagged/visual-studio-2010) (show questions tagged 'visual-studio-2010') visual-studio-2010 (/questions/tagged/path) (show questions tagged 'path') path (/questions/tagged/clipboard) (show questions tagged 'clipboard') clipboard (/q/5668524) (Short permalink to this question) Share Share a link to this question Copy link (https://creativecommons.org/licenses/by-sa/3.0/) (The current license for this post: CC BY-SA 3.0) CC BY-SA 3.0 (/posts/5668524/edit) () Improve this question Follow (69:3:31e,16:cb8d05c1d5316382,10:1742104418,16:8d06b4424f4576d2,7:5668524,a308896c8df2064aaab6d53ee44997ce0aefd2c0a6121d461ec491091b0aafc8) Follow this question to receive notifications asked (2011-04-14 19:21:46Z) Apr 14, 2011 at 19:21 (/users/18149/leeand00) (leeand00's user avatar) (/users/18149/leeand00) leeand00 leeand00 (reputation score 26,422) 26.4k (45 gold badges) 45 45 gold badges (155 silver badges) 155 155 silver badges (304 bronze badges) 304 304 bronze badges (Use comments to ask for more information or suggest improvements. Avoid answering questions in comments.) Add a comment | (Expand to show all comments on this post) 6 Answers 6 Sorted by: (/questions/5668524/easier-way-to-copy-the-path-to-a-file-or-directory-to-the-clipboard-in-visual-st?answertab=scoredesc#tab-top) Reset to default (scoredesc) Highest score (default) (trending) Trending (recent votes count more) (modifieddesc) Date modified (newest first) (createdasc) Date created (oldest first) This answer is useful (69:3:31e,16:76f568c170fa1654,10:1742104418,16:3642c73c7e1789db,7:5676507,b3278b2c13b796b5c4a65e4ee566d781dbdc837ee4820b66c4393d438847d034) 11 (This answer is not useful) (69:3:31e,16:ede27f3b011317fb,10:1742104418,16:9cf09e0a5291b8c9,7:5676507,023e7d60435da8246bb634f38bf3fa8608ff0c55e2713e7c2e22b8dd1097f6fd) Save this answer. (Loading when this answer was accepted…) (/posts/5676507/timeline) Show activity on this post. Look at PowerCommands extension (http://visualstudiogallery.msdn.microsoft.com/e5f41ad9-4edc-4912-bca3-91147db95b99?SRC=Home) http://visualstudiogallery.msdn.microsoft.com/e5f41ad9-4edc-4912-bca3-91147db95b99?SRC=Home Among others, it contains "Copy Path" command for files and folders UPD: Also, another option: right-click the tab of open document and there will be "Copy Full Path" command. It's built-in, no extensions needed (/a/5676507) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/3.0/) (The current license for this post: CC BY-SA 3.0) CC BY-SA 3.0 (/posts/5676507/edit) () Improve this answer Follow (69:3:31e,16:929fce983cdcc4fd,10:1742104418,16:e6144bbf5dd46295,7:5676507,6db677d5b3e09a06677755992e5ceb6859f9a49c66e6301954708104a95bf2fd) Follow this answer to receive notifications (/posts/5676507/revisions) (show all edits to this post) edited (2011-04-15 15:25:25Z) Apr 15, 2011 at 15:25 answered (2011-04-15 12:09:34Z) Apr 15, 2011 at 12:09 (/users/692349/madbender) (MadBender's user avatar) (/users/692349/madbender) MadBender MadBender (reputation score) 1,458 (12 silver badges) 12 12 silver badges (15 bronze badges) 15 15 bronze badges 5 Woo Hoo! I've been missing that functionality since I switched IDEs! Thanks MadBender! – (/users/18149/leeand00) (26,422 reputation) leeand00 Commented (2011-04-15 12:40:30Z, License: CC BY-SA 3.0) Apr 15, 2011 at 12:40 (number of 'useful comment' votes received) 1 Hmm odd, I ran VS as administrator to setup the extension but the items aren't appearing in the context menu. I also noticed that in Tools->Options...Power Commands all command items are checked. – (/users/18149/leeand00) (26,422 reputation) leeand00 Commented (2011-04-15 13:30:56Z, License: CC BY-SA 3.0) Apr 15, 2011 at 13:30 Works well for me. Try to modify and save the settings, check for conflicts with other extensions, install SP1 if you don't have it. Maybe it will fix the problem – (/users/692349/madbender) (1,458 reputation) MadBender Commented (2011-04-15 15:21:54Z, License: CC BY-SA 3.0) Apr 15, 2011 at 15:21 I used it with SP1 and without, and I don't think it's main reason. Conflict with other extensions is more likely. Do you have any? – (/users/692349/madbender) (1,458 reputation) MadBender Commented (2011-04-15 16:11:25Z, License: CC BY-SA 3.0) Apr 15, 2011 at 16:11 Unfortunately not available for VS 2022 – (/users/1715749/antonk) (2,320 reputation) AntonK Commented (2022-06-01 01:26:24Z, License: CC BY-SA 4.0) Jun 1, 2022 at 1:26 (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:05d70be0f8640f0c,10:1742104418,16:5bb21f7124887116,8:39956740,4cb85c4b592e0a4bc1c9dee20742b4908884558e7be7509728da000f69f7aad9) 10 (This answer is not useful) (70:3:31e,16:f1e226134d45108d,10:1742104418,16:1e5dbc17459d972c,8:39956740,bffa8978a9847f7b41bf63c157cf29888f09068359d19714617881aa706b5d2f) Save this answer. (Loading when this answer was accepted…) (/posts/39956740/timeline) Show activity on this post. You can just select the file in the 'Solution Explorer' file list and hit CTRL+C . It automatically copies the file path to your clipboard. (/a/39956740) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/3.0/) (The current license for this post: CC BY-SA 3.0) CC BY-SA 3.0 (/posts/39956740/edit) () Improve this answer Follow (70:3:31e,16:8b2870f4e822e6fc,10:1742104418,16:1acab07bb1bee1a4,8:39956740,2194ce511bd5970f44502a1b7a11ccfa66efa412f9cfbee015d7cd6ced7cf53b) Follow this answer to receive notifications answered (2016-10-10 10:58:38Z) Oct 10, 2016 at 10:58 (/users/5370835/capawaky) (capawaky's user avatar) (/users/5370835/capawaky) capawaky capawaky (reputation score) 127 (2 silver badges) 2 2 silver badges (8 bronze badges) 8 8 bronze badges 2 Correct. It seems to work only on folders that have the "folder" icon and on regular files, not on solution or project or properties items. – (/users/5370835/capawaky) (127 reputation) capawaky Commented (2017-04-19 14:08:25Z, License: CC BY-SA 3.0) Apr 19, 2017 at 14:08 (number of 'useful comment' votes received) 1 It copies the file itself, not the path. – (/users/75500/shimmy-weitzhandler) (104,841 reputation) Shimmy Weitzhandler Commented (2023-08-11 13:58:03Z, License: CC BY-SA 4.0) Aug 11, 2023 at 13:58 (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:8ae1359d46423b0e,10:1742104418,16:3dd925b0a206f42d,8:58154571,12f34330c83117feb221ef4b95a4e30ef19ec5e1053d800e8f2a5b651b15ea76) 1 (This answer is not useful) (70:3:31e,16:d109ad891c2703d9,10:1742104418,16:089adf9aa648c991,8:58154571,0cff0a8b713638ce9da481f4be07bb1936a01c44fc3cd1d1e417a8ae5f281a8b) Save this answer. (Loading when this answer was accepted…) (/posts/58154571/timeline) Show activity on this post. I've found one more option of how to solve it without plugins (for VS 2015 and above; not certain about previous versions) Go to "Tools" -> "Customize..." -> "Commands" tab. Choose "Context menu:" and "Project and Solution Context Menus | Item" and you can add any existing Command. In order to copy path, choose Category "File" and "Copy Full Path" command. Will add button only for files in Solution Explorer. This works for projects as well but you should choose "Project and Solution Context Menus | Project" (copy path of .vcxproj file). It doesn't work for solutions and I don't understand actually why. (/a/58154571) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/58154571/edit) () Improve this answer Follow (70:3:31e,16:6ecf05ab330df20f,10:1742104418,16:1ff78d9f8ef0ee90,8:58154571,967a539b519c338d1ea619f007a06c354f4e2430abec4d8510ee632dbf7beac5) Follow this answer to receive notifications (/posts/58154571/revisions) (show all edits to this post) edited (2019-09-30 03:26:24Z) Sep 30, 2019 at 3:26 (/users/5178801/j-murray) (J. Murray's user avatar) (/users/5178801/j-murray) J. Murray (reputation score) 1,450 (11 silver badges) 11 11 silver badges (19 bronze badges) 19 19 bronze badges answered (2019-09-29 11:02:32Z) Sep 29, 2019 at 11:02 (/users/8995293/andrii-radchenko) (Andrii Radchenko's user avatar) (/users/8995293/andrii-radchenko) Andrii Radchenko Andrii Radchenko (reputation score) 11 (2 bronze badges) 2 2 bronze badges 1 (number of 'useful comment' votes received) 1 in vs2022 it's a bit weird -- it works for solution, and in code window, but not for project or project item. – (/users/826203/athos) (6,427 reputation) athos Commented (2023-01-31 14:16:36Z, License: CC BY-SA 4.0) Jan 31, 2023 at 14:16 (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:76bf39f14d0d5f21,10:1742104418,16:778a627d942bf410,8:70795456,b1293210fc9bebb7386124a93298942f4640a549888973d4bfe32bdc16b72410) 1 (This answer is not useful) (70:3:31e,16:6eee2bf3205e3a87,10:1742104418,16:69717e22169518a2,8:70795456,e072a77ba248a6275b0decceef41cc9d08ea0c48c5c68e6916ac22bba804550a) Save this answer. (Loading when this answer was accepted…) (/posts/70795456/timeline) Show activity on this post. Tools > Options > Environment > Keyboard You can set your own shortcut keys for anything. The two that are most relevant to this post are "File.CopyFullPath" and "File.CopyRelativePath". I created my shortcut to just be used in "Text Editor" and it has worked great. This was asked for VS2010 and I'm using VS2019, so it is an old question, but still relevant. I knew about the file header right click menu, but for some reason I didn't think about the shortcut keys until I read this question. Posting in case this results in a quicker fix for anyone else. (/a/70795456) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/70795456/edit) () Improve this answer Follow (70:3:31e,16:da938cd30cbce98b,10:1742104418,16:94adcb92e3286b24,8:70795456,839279018c9b06cc5bfc7759b2c4713a9d82479c125b6ecf4c64ecab2b81969b) Follow this answer to receive notifications answered (2022-01-21 01:47:54Z) Jan 21, 2022 at 1:47 (/users/2520037/maru) (maru's user avatar) (/users/2520037/maru) maru maru (reputation score) 206 (2 silver badges) 2 2 silver badges (6 bronze badges) 6 6 bronze badges 1 (number of 'useful comment' votes received) 1 strangely, File.CopyRelativePath doesn't work for me as a shortcut, though I've set it in the keyboard settings in VS 2022. – (/users/736568/matthew-kooshad) (319 reputation) Matthew Kooshad Commented (2022-02-25 17:50:14Z, License: CC BY-SA 4.0) Feb 25, 2022 at 17:50 (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:df60c36ffbe09a9a,10:1742104418,16:a91ae708564abe52,8:64467167,af3c2473a25d9547dea5e90321b32e2dc2efbc10dd2aaaff273b5c35e8cf736a) 0 (This answer is not useful) (70:3:31e,16:b9a4396a0fd41fa3,10:1742104418,16:41bbf5a8fbda049a,8:64467167,c7a502c76bc265a5e553fcdc987aec1126bdd235901e1ce451b2e887ccde0aa2) Save this answer. (Loading when this answer was accepted…) (/posts/64467167/timeline) Show activity on this post. The CTRL+C doesn't work for me on MSVS 2017. Use the copy as path extension (https://marketplace.visualstudio.com/items?itemName=AlexEyler.CopyasPath&ssr=false#review-details) here . Then right click on file in solution explorer -> Copy as path (or assign a shortcut). I find that it works very well. (/a/64467167) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/64467167/edit) () Improve this answer Follow (70:3:31e,16:09a001beb227ceef,10:1742104418,16:362e3c58ca0f9f97,8:64467167,d43dcc67b0b1781ec37be661081a4215497ac26ec97cdb9d6d59309389aa8cbd) Follow this answer to receive notifications answered (2020-10-21 15:43:37Z) Oct 21, 2020 at 15:43 (/users/4743275/keyc0de) (KeyC0de's user avatar) (/users/4743275/keyc0de) KeyC0de KeyC0de (reputation score) 5,287 (10 gold badges) 10 10 gold badges (52 silver badges) 52 52 silver badges (73 bronze badges) 73 73 bronze badges (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful (70:3:31e,16:34ca9646cd9d599a,10:1742104418,16:494b592c2d026381,8:79432449,ef1ee4898fd8e0b801ca6c6370a34f4ba2cf08a46a4a2c11e74f30d34e16fefe) 0 (This answer is not useful) (70:3:31e,16:5cb51681b247373b,10:1742104418,16:b60e0d0d40bc63f3,8:79432449,21103a20dfbb5cb9e13b608c94baf28528e621ae901b4b7e61fefdfd9603ff4f) Save this answer. (Loading when this answer was accepted…) (/posts/79432449/timeline) Show activity on this post. You can right click at these 2 places: on the tab of the opened file at the top of the screen on the file name in the file explorer (usually on the left). The keyboard shortcuts are the same in both places There are 2 options: Copy Path . Keyboard shortcut Opt Cmd C on Mac Copy Relative Rath . Keyboard shortcut Shift Opt Cmd C on Mac (https://i.sstatic.net/AcYTFj8J.png) (Screenshot of context menu in top tab bar) (https://i.sstatic.net/MSIJJrpB.png) (Screenshot of context menu in file explorer) This was already mentioned in other answers, but I wanted to give it more visibility, as this is the simplest way in my opinion. (/a/79432449) (Short permalink to this answer) Share Share a link to this answer Copy link (https://creativecommons.org/licenses/by-sa/4.0/) (The current license for this post: CC BY-SA 4.0) CC BY-SA 4.0 (/posts/79432449/edit) () Improve this answer Follow (70:3:31e,16:d5d5e01f15885517,10:1742104418,16:6b1cd05d993384dd,8:79432449,a1fa1ac7d4d719fcc876061012a3d262947146c2ea3776716495a54b01cf7217) Follow this answer to receive notifications (/posts/79432449/revisions) (show all edits to this post) edited (2025-02-12 09:14:10Z) Feb 12 at 9:14 answered (2025-02-12 09:01:58Z) Feb 12 at 9:01 (/users/9675721/raphael-pinel) (Raphael Pinel's user avatar) (/users/9675721/raphael-pinel) Raphael Pinel Raphael Pinel (reputation score) 2,830 (2 gold badges) 2 2 gold badges (27 silver badges) 27 27 silver badges (35 bronze badges) 35 35 bronze badges (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) (5668524) (false) () Your Answer (True) Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question . Provide details and share your research! But avoid … Asking for help, clarification, or responding to other answers. Making statements based on opinion; back them up with references or personal experience. To learn more, see our (/help/how-to-answer) tips on writing great answers . Draft saved Draft discarded (9b9d1ff1208457cf29de4d03e17fc06b55f301e0c5c48e7398c73e63b318268a) Sign up or (/users/login?ssrc=question_page&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f5668524%2feasier-way-to-copy-the-path-to-a-file-or-directory-to-the-clipboard-in-visual-st%23new-answer) log in Sign up using Google Sign up using Email and Password (false) (false) Submit Post as a guest Name () () Email Required, but never shown () () Post as a guest Name () () Email Required, but never shown () () Post Your Answer Discard By clicking “Post Your Answer”, you agree to our (https://stackoverflow.com/legal/terms-of-service/public) terms of service and acknowledge you have read our (https://stackoverflow.com/legal/privacy-policy) privacy policy .(1) Start asking to get answers Find the answer to your question by asking. (/questions/ask) Ask question Explore related questions (/questions/tagged/visual-studio-2010) (show questions tagged 'visual-studio-2010') visual-studio-2010 (/questions/tagged/path) (show questions tagged 'path') path (/questions/tagged/clipboard) (show questions tagged 'clipboard') clipboard See similar questions with these tags. The Overflow Blog (https://stackoverflow.blog/2025/03/14/can-climate-tech-startups-address-the-current-crisis/?cb=1) Can climate tech startups address the current crisis? (https://stackoverflow.blog/2025/03/14/what-we-learned-at-tdx-2025/?cb=1) What we learned at TDX 2025 Featured on Meta (Meta Stack Exchange) (https://meta.stackexchange.com/questions/407321/community-asks-sprint-announcement-march-2025?cb=1) Community Asks Sprint Announcement - March 2025 (Meta Stack Exchange) (https://meta.stackexchange.com/questions/407425/meta-stack-exchange-site-maintenance-scheduled-starting-monday-march-17-2025-f?cb=1) (Meta Stack Exchange site maintenance scheduled starting Monday, March 17, 2025 from 13:30 UTC to 14:30 UTC (9:30am to 10:30am ET)) Meta Stack Exchange site maintenance scheduled starting Monday, March 17,... (Meta Stack Overflow) (https://meta.stackoverflow.com/questions/432989/is-it-better-to-redirect-users-who-attempt-to-perform-actions-they-cant-yet-tak?cb=1) (Is it better to redirect users who attempt to perform actions they can't yet take?) Is it better to redirect users who attempt to perform actions they can't yet... (Meta Stack Overflow) (https://meta.stackoverflow.com/questions/433034/stacks-editor-development-and-testing?cb=1) Stacks Editor development and testing Related (https://stackoverflow.com/q/2416655?rq=3) (Question score (upvotes - downvotes)) 58 (https://stackoverflow.com/questions/2416655/file-path-to-clipboard-in-emacs?rq=3) File path to clipboard in Emacs (https://stackoverflow.com/q/8006250?rq=3) (Question score (upvotes - downvotes)) 39 (https://stackoverflow.com/questions/8006250/copy-path-file-name-in-eclipse-to-clipboard?rq=3) Copy path/file name in Eclipse to clipboard (https://stackoverflow.com/q/10450447?rq=3) (Question score (upvotes - downvotes)) 1 (https://stackoverflow.com/questions/10450447/how-to-paste-a-file-from-clipboard-to-specific-path?rq=3) How to paste a file from Clipboard to specific path (https://stackoverflow.com/q/14657116?rq=3) (Question score (upvotes - downvotes)) 1 (https://stackoverflow.com/questions/14657116/how-can-i-put-a-file-path-into-the-clipboard-so-that-it-can-be-pasted-as-file-in?rq=3) How can I put a file path into the clipboard so that it can be pasted as file in a file manager? (https://stackoverflow.com/q/15265722?rq=3) (Question score (upvotes - downvotes)) 3 (https://stackoverflow.com/questions/15265722/copy-a-folder-to-clipboard?rq=3) Copy a folder to Clipboard (https://stackoverflow.com/q/18812938?rq=3) (Question score (upvotes - downvotes)) 10 (https://stackoverflow.com/questions/18812938/copy-full-file-path-into-copy-paste-clipboard?rq=3) Copy full file path into Copy-Paste-Clipboard (https://stackoverflow.com/q/59453739?rq=3) (Question score (upvotes - downvotes)) 0 (https://stackoverflow.com/questions/59453739/how-to-edit-paths-in-windows-clipboard?rq=3) How to edit paths in Windows clipboard? (https://stackoverflow.com/q/66020827?rq=3) (Question score (upvotes - downvotes)) 3 (https://stackoverflow.com/questions/66020827/how-to-copy-the-file-path-with-escaped-path-separator?rq=3) How to copy the file path with escaped path separator? (https://stackoverflow.com/q/68000189?rq=3) (Question score (upvotes - downvotes)) 5 (https://stackoverflow.com/questions/68000189/how-to-get-file-path-of-copied-file-in-windows?rq=3) How to get file path of copied file in Windows? (https://stackoverflow.com/q/74580132?rq=3) (Question score (upvotes - downvotes)) 1 (https://stackoverflow.com/questions/74580132/keyboard-shortcut-to-copy-full-file-path-of-the-current-file?rq=3) Keyboard shortcut to copy full file path of the current file (https://stackexchange.com/questions?tab=hot) Hot Network Questions (MathOverflow) (https://mathoverflow.net/questions/489416/do-two-polynomials-whose-coefficients-are-the-same-up-to-permutation-satisfy-thi) Do two polynomials whose coefficients are the same up to permutation satisfy this relation? (Puzzling Stack Exchange) (https://puzzling.stackexchange.com/questions/130950/a-box-inside-a-box-puzzle) A box inside a box puzzle (Physics Stack Exchange) (https://physics.stackexchange.com/questions/845320/references-for-numerical-solutions-of-the-feynman-path-integral) References for Numerical Solutions of the Feynman Path Integral (Law Stack Exchange) (https://law.stackexchange.com/questions/107793/can-an-insurance-company-legally-sell-an-unclaimable-policy) Can an insurance company legally sell an unclaimable policy? (Politics Stack Exchange) (https://politics.stackexchange.com/questions/91027/is-it-exceptional-that-states-are-so-transparent-about-geopolitical-decisions-re) Is it exceptional that states are so transparent about geopolitical decisions regarding Ukraine? (Computer Science Stack Exchange) (https://cs.stackexchange.com/questions/171507/definition-of-binary-heap-data-structure) Definition of binary heap data structure (Latin Language Stack Exchange) (https://latin.stackexchange.com/questions/24522/how-do-you-say-take-your-medicine-in-latin-do-you-use-the-verb-capio-as-in) How do you say "take your medicine" in Latin? Do you use the verb "capio" (as in English)? Or do you use "bibo" (as in Croatian)? Or something else? (Electrical Engineering Stack Exchange) (https://electronics.stackexchange.com/questions/741499/can-i-change-a-ferrite-core-to-a-slightly-larger-one-without-problems) Can I change a ferrite core to a slightly larger one without problems? (English Language Learners Stack Exchange) (https://ell.stackexchange.com/questions/363141/where-have-you-been-for-two-years) "Where have you been for two years"? (Puzzling Stack Exchange) (https://puzzling.stackexchange.com/questions/130961/cryptic-division-14-gotta-get-down-on-pi-day) Cryptic Division 14: Gotta Get Down on Pi Day (Science Fiction & Fantasy Stack Exchange) (https://scifi.stackexchange.com/questions/295469/movie-with-a-girl-going-to-a-magic-school-and-getting-a-non-black-cat) Movie with a girl going to a magic school and getting a non-black cat (Cross Validated) (https://stats.stackexchange.com/questions/662643/how-to-compare-the-same-regression-model-in-two-samples-with-different-n) How to compare the same regression model in two samples with different N (Mathematica Stack Exchange) (https://mathematica.stackexchange.com/questions/311562/how-to-return-data-only-from-a-memoized-cached-variable) How to return data only from a memoized, cached variable (Electrical Engineering Stack Exchange) (https://electronics.stackexchange.com/questions/741495/a-problem-with-the-basics-of-opamps) A Problem with the Basics of OpAmps (Cross Validated) (https://stats.stackexchange.com/questions/662686/what-to-do-in-my-cfa-model) What to do in my CFA model? (TeX - LaTeX Stack Exchange) (https://tex.stackexchange.com/questions/739028/how-to-draw-a-circle-inscribed-in-a-quadrangle-in-tikz) How to draw a circle inscribed in a quadrangle in TikZ (Personal Finance & Money Stack Exchange) (https://money.stackexchange.com/questions/165530/could-ishares-ibonds-funds-buy-bonds-that-are-not-issued-yet-in-the-future) Could iShares iBonds funds buy bonds that are not issued yet in the future? (Electrical Engineering Stack Exchange) (https://electronics.stackexchange.com/questions/741550/why-always-one-diode-takes-up-all-the-voltage-drop-in-a-series-of-diodes) Why always one diode takes up all the voltage drop in a series of diodes? (Academia Stack Exchange) (https://academia.stackexchange.com/questions/217379/how-does-a-professor-plan-to-teach-cover-a-syllabus-for-the-first-time) How does a professor plan to teach/cover a syllabus for the first time? (Hinduism Stack Exchange) (https://hinduism.stackexchange.com/questions/62519/can-one-accept-guru-take-diksha-without-parents-permission) Can one accept Guru/take diksha without parents permission? (Super User) (https://superuser.com/questions/1886312/what-is-the-virtual-documents-directory-on-linux) What is the ".virtual_documents" directory on Linux? (Science Fiction & Fantasy Stack Exchange) (https://scifi.stackexchange.com/questions/295478/short-story-about-a-man-who-removes-his-brain-from-his-head-as-performance-art) Short story about a man who removes his brain from his head as performance art (Philosophy Stack Exchange) (https://philosophy.stackexchange.com/questions/123464/is-it-ethical-to-try-our-best-in-taking-the-perspective-of-the-individual-before) Is it ethical to try our best in taking the perspective of the individual before proceeding moral reasoning on them? (TeX - LaTeX Stack Exchange) (https://tex.stackexchange.com/questions/739017/why-are-my-nodes-not-aligning) Why are my nodes not aligning? (/feeds/question/5668524) (Feed of this question and its answers) Question feed Subscribe to RSS Question feed To subscribe to this RSS feed, copy and paste this URL into your RSS reader. (https://stackoverflow.com/feeds/question/5668524) () (https://stackoverflow.com) (https://stackoverflow.com) Stack Overflow (/questions) Questions (/help) Help (https://chat.stackoverflow.com/?tab=site&host=stackoverflow.com) Chat (https://stackoverflow.co/) Products (https://stackoverflow.co/teams/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=teams) Teams (https://stackoverflow.co/advertising/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=advertising) Advertising (https://stackoverflow.co/advertising/employer-branding/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=footer&utm_content=talent) Talent (https://stackoverflow.co/) Company (https://stackoverflow.co/) About (https://stackoverflow.co/company/press/) Press (https://stackoverflow.co/company/work-here/) Work Here (https://stackoverflow.com/legal) Legal (https://stackoverflow.com/legal/privacy-policy) Privacy Policy (https://stackoverflow.com/legal/terms-of-service/public) Terms of Service (/contact) Contact Us Your Privacy Choices (https://stackoverflow.com/legal/cookie-policy) Cookie Policy (https://stackexchange.com) Stack Exchange Network (https://stackexchange.com/sites#technology) Technology (https://stackexchange.com/sites#culturerecreation) Culture & recreation (https://stackexchange.com/sites#lifearts) Life & arts (https://stackexchange.com/sites#science) Science (https://stackexchange.com/sites#professional) Professional (https://stackexchange.com/sites#business) Business (https://api.stackexchange.com/) API (https://data.stackexchange.com/) Data (https://stackoverflow.blog?blb=1) Blog (https://www.facebook.com/officialstackoverflow/) Facebook (https://twitter.com/stackoverflow) Twitter (https://linkedin.com/company/stack-overflow) LinkedIn (https://www.instagram.com/thestackoverflow) Instagram Site design / logo © 2025 Stack Exchange Inc; user contributions licensed under (https://stackoverflow.com/help/licensing) CC BY-SA . rev 2025.3.14.23880