{"id":891,"date":"2011-04-22T05:00:56","date_gmt":"2011-04-22T10:00:56","guid":{"rendered":"http:\/\/www.jaimerios.com\/?p=891"},"modified":"2011-04-22T05:00:56","modified_gmt":"2011-04-22T10:00:56","slug":"copying-a-project-file-to-a-known-location","status":"publish","type":"post","link":"https:\/\/jaimerios.com\/?p=891","title":{"rendered":"Copying a project file to a known location"},"content":{"rendered":"<p><a href=\"https:\/\/jaimerios.com\/wp-content\/uploads\/2011\/04\/msvs_ide_logo.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jaimerios.com\/wp-content\/uploads\/2011\/04\/msvs_ide_logo-150x150.png\" alt=\"Microsoft Visual Studio 2008\" title=\"msvs_ide_logo\" width=\"75\" height=\"75\" class=\"size-thumbnail wp-image-909\" srcset=\"https:\/\/jaimerios.com\/wp-content\/uploads\/2011\/04\/msvs_ide_logo-150x150.png 150w, https:\/\/jaimerios.com\/wp-content\/uploads\/2011\/04\/msvs_ide_logo.png 256w\" sizes=\"auto, (max-width: 75px) 100vw, 75px\" \/><\/a><br \/>\nWithin a Visual Studio C++ solution, you can copy a file to a known location as part of the build process.<\/p>\n<p>To do that, you have so set the &#8220;Custom Build Step&#8221; parameters found in the Visual Studio project&#8217;s property page:<\/p>\n<p><code>Command line: copy \"$(InputPath)\" \"$(TargetDir)\" > nul<br \/>\nDescription: Copying $(InputFileName)<br \/>\nOutputs: $(TargetDir)$(InputFileName)<\/code><\/p>\n<p>Note, the first line is the actual copy command. If you want to see the command without executing it, you can place @echo in front of the command.<\/p>\n<p>Also note, the second line prints some text to the output screen, so you know what is going on.<\/p>\n<p>For some projects, I have to run Visual Studio in adminstrator mode, otherwise the IDE is unable to copy the file to the restricted location.<\/p>\n<p>I found instructions on how to run Visual Studio in administrative mode at: <a href=\"http:\/\/www.gotknowhow.com\/articles\/how-to-automatically-run-visual-studio-net-as-administrator\" target=\"_blank\" rel=\"noopener\">gottoknow dot com<\/a> :<\/p>\n<blockquote>\n<ol>\n<li>Click the &#8216;Start&#8217; button.<\/li>\n<li>Click &#8216;All Programs&#8217;<\/li>\n<li>In the menu, locate and click on the folder that says &#8216;Microsoft Visual Studio 2010&#8217; (your version might be 2005, or 2008).<\/li>\n<li>Now right-click on the &#8216;Microsoft Visual Studio 2010&#8217; program file, which will bring up the &#8216;Properties&#8217; pop-up box.<\/li>\n<li>Select the &#8216;Compatibility&#8217; tab, and then in the Privilege Level section, check the box next to &#8220;Run this program as an administrator&#8221;<\/li>\n<li>Click the &#8216;Apply&#8217; button, then click the &#8216;OK&#8217; button.<\/li>\n<li>Now each time you open Microsoft Visual Studio 2010, it will be running in (Administrator) mode.<\/li>\n<\/ol>\n<\/blockquote>\n<p>References:<br \/>\n<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/b0bktkzs(v=vs.80).aspx\" target=\"_blank\" rel=\"noopener\">http:\/\/msdn.microsoft.com\/en-us\/library\/b0bktkzs(v=vs.80).aspx<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Within a Visual Studio C++ solution, you can copy a file to a known location as part of the build process. To do that, you have so set the &#8220;Custom Build Step&#8221; parameters found in the Visual Studio project&#8217;s property page: Command line: copy &#8220;$(InputPath)&#8221; &#8220;$(TargetDir)&#8221; > nul Description: Copying $(InputFileName) Outputs: $(TargetDir)$(InputFileName) Note, the &#8230; <a title=\"Copying a project file to a known location\" class=\"read-more\" href=\"https:\/\/jaimerios.com\/?p=891\" aria-label=\"Read more about Copying a project file to a known location\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,31],"tags":[152,480,483],"class_list":["post-891","post","type-post","status-publish","format-standard","hentry","category-coding","category-tip","tag-custom-build-step","tag-visual-studio","tag-vs"],"_links":{"self":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/posts\/891","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=891"}],"version-history":[{"count":0,"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/posts\/891\/revisions"}],"wp:attachment":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=891"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=891"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}