{"id":177,"date":"2015-01-17T19:04:11","date_gmt":"2015-01-17T19:04:11","guid":{"rendered":"http:\/\/blog.electrongoo.com\/?p=177"},"modified":"2017-02-13T10:05:10","modified_gmt":"2017-02-13T10:05:10","slug":"how-to-update-unity3ds-default-project-location","status":"publish","type":"post","link":"https:\/\/blog.electrongoo.com\/index.php\/how-to-update-unity3ds-default-project-location\/","title":{"rendered":"How to update Unity3d&#8217;s default Project Location"},"content":{"rendered":"<h1>Unity3d Project Location:<\/h1>\n<p><a href=\"http:\/\/unity3d.com\/\">Unity3d <\/a>is an excellent cross-platform tool for developing interactive content.\u00a0 Unfortunately some\u00a0desirable work-flow features are just\u00a0not available.\u00a0 One such feature is the ability to change the default Project Location where all new Unity projects are saved.\u00a0 With Unity, I find myself creating new projects quite often to test new features and ideas.\u00a0 Being able to\u00a0set a custom\u00a0default Project Location would be a great time-saver so I would not have to drill-down into a file dialog to locate a specific folder.<\/p>\n<p>While searching for a solution I found many <a href=\"http:\/\/forum.unity3d.com\/threads\/change-default-project-location.84494\/\">others<\/a> <a href=\"http:\/\/answers.unity3d.com\/questions\/119370\/changing-the-default-project-location.html\">looking <\/a>for the same feature.\u00a0 Unfortunately, no solutions were available.\u00a0 I found one mention of a registry key\u00a0which could be altered but that did not work.\u00a0 I used the <a href=\"http:\/\/technet.microsoft.com\/en-us\/sysinternals\/bb896645\">Microsoft \u00a0Process Monitor<\/a> to view registry and file access by the Unity process but I never saw any\u00a0interesting data being read.<\/p>\n<p>After some quick tests I found that Unity always uses the personal documents folder.\u00a0 The personal documents folder is located by Unity using the Microsoft <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/bb762181(v=vs.85).aspx\">SHGetFolderPath <\/a>API.\u00a0 By default, Unity saves new projects under a folder named &#8220;New Unity Project (X)&#8221; under your personal documents folder.\u00a0\u00a0 So, the task is to get\u00a0Unity to read\u00a0a different value for the personal documents folder.<\/p>\n<p>The following details how to update Unity running on Windows.\u00a0 These steps are not valid for Unity running OSX or Linux.<\/p>\n<h1>\u00a0Instructions:<\/h1>\n<p>In order to get Unity to display a custom Project Location folder when you select <strong>File | New Project &#8230;<\/strong> you must update a value in the Windows registry.\u00a0\u00a0To accomplish this,\u00a0create a simple Visual Basic script to update the personal folder name, launch Unity, then revert the personal folder name when Unity is closed.\u00a0 Here are the step-by-step instructions &#8230;<\/p>\n<p>Create a new empty document (e.g. within Windows Explorer <strong>Right-click New | Text Document<\/strong>)<\/p>\n<p><a href=\"http:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_1.jpg\"><img loading=\"lazy\" class=\"size-full wp-image-179 aligncenter\" src=\"http:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_1.jpg\" alt=\"updateunityprojloc_1\" width=\"940\" height=\"665\" srcset=\"https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_1.jpg 940w, https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_1-300x212.jpg 300w\" sizes=\"(max-width: 940px) 100vw, 940px\" \/><\/a><\/p>\n<p>rename the file <strong>LaunchUnity.vbs<\/strong><\/p>\n<p><a href=\"http:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_2.jpg\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-180\" src=\"http:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_2.jpg\" alt=\"updateunityprojloc_2\" width=\"940\" height=\"665\" srcset=\"https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_2.jpg 940w, https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_2-300x212.jpg 300w\" sizes=\"(max-width: 940px) 100vw, 940px\" \/><\/a><\/p>\n<p>Open the Windows registry (e.g. <strong>regedit.exe<\/strong>) and browse to the key named <strong>HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders<\/strong>.\u00a0 Find the value named <strong>Personal.<\/strong>\u00a0 This is the value returned by the Microsoft <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/bb762181(v=vs.85).aspx\">SHGetFolderPath <\/a>API.\u00a0 It should be of the form C:\\Users\\&lt;yourname&gt;\\Documents.<\/p>\n<p>Make a note of this value.\u00a0 You will use it later to update your Visual Basic script.<\/p>\n<p><a href=\"http:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_31.jpg\"><img loading=\"lazy\" class=\"aligncenter wp-image-198 size-large\" src=\"http:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_31-1024x513.jpg\" alt=\"\" width=\"474\" height=\"237\" srcset=\"https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_31-1024x513.jpg 1024w, https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_31-300x150.jpg 300w, https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_31.jpg 1235w\" sizes=\"(max-width: 474px) 100vw, 474px\" \/><\/a><\/p>\n<p>Now, right-click on your Unity3d icon and select <strong>Properties.<\/strong> Select the <strong>Shortcut tab<\/strong> and locate the <strong>Target<\/strong> textbox which contains the path\u00a0to Unity3d on your system.\u00a0 It should be of the form &#8220;C:\\Program Files (x86)\\Unity\\Editor\\Unity.exe&#8221;\u00a0 but can vary based on where you installed Unity and if you are running 32-bit or 64-bit Windows.<\/p>\n<p>Make a note of this value.\u00a0 You will use it later to update your Visual Basic script.<\/p>\n<p><a href=\"http:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_4.jpg\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-182\" src=\"http:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_4.jpg\" alt=\"updateunityprojloc_4\" width=\"377\" height=\"533\" srcset=\"https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_4.jpg 377w, https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_4-212x300.jpg 212w\" sizes=\"(max-width: 377px) 100vw, 377px\" \/><\/a><\/p>\n<p>Now create the Visual Basic script to update the folder name and launch Unity.\u00a0 Right-click on the &#8220;LaunchUnity.vbs&#8221; file you created and select <strong>Edit<\/strong>.<\/p>\n<p><a href=\"http:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_5.jpg\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-183\" src=\"http:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_5.jpg\" alt=\"updateunityprojloc_5\" width=\"940\" height=\"665\" srcset=\"https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_5.jpg 940w, https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_5-300x212.jpg 300w\" sizes=\"(max-width: 940px) 100vw, 940px\" \/><\/a><\/p>\n<p>Copy and paste the following Visual Basic script code into the LaunchUnity.vbs file<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nDim WshShell\r\nSet WshShell = CreateObject(&quot;WScript.Shell&quot;)\r\nWshShell.RegWrite &quot;HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\Personal&quot;, &quot;C:\\YOUR\\PROJECT\\FOLDER&quot;, &quot;REG_SZ&quot;\r\nsReturn = WshShell.Run(&quot;&quot;&quot;c:\\Program Files (x86)\\Unity\\Editor\\Unity.exe&quot;&quot;&quot; , 0, True)\r\nWshShell.RegWrite &quot;HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\Personal&quot;, &quot;C:\\YOUR\\PERSONAL\\FOLDER&quot;, &quot;REG_SZ&quot;\r\n<\/pre>\n<p>Replace the three strings <strong>&#8220;C:\\YOUR\\PROJECT\\FOLDER&#8221;, &#8220;c:\\Program Files (x86)\\Unity\\Editor\\Unity.exe&#8221;,\u00a0<\/strong>\u00a0and <strong>&#8220;C:\\YOUR\\PERSONAL\\FOLDER&#8221;<\/strong> with the default path you want to save Unity projects, the path to unity.exe,\u00a0and your existing personal folder respectively.\u00a0 Warning: make sure you <strong>do not<\/strong> use a trialing \\ on the paths or that will break the vbs script.<\/p>\n<p>For example,\u00a0 here is my final vbs script using <strong>&#8220;G:\\UnityProjects&#8221; <\/strong>as my custom project location\u00a0and <strong>&#8220;C:\\Users\\andrew\\Documents&#8221;<\/strong> as my existing personal folder.<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nDim WshShell\r\nSet WshShell = CreateObject(&quot;WScript.Shell&quot;)\r\nWshShell.RegWrite &quot;HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\Personal&quot;, &quot;G:\\UnityProjects&quot;, &quot;REG_SZ&quot;\r\nsReturn = WshShell.Run(&quot;&quot;&quot;c:\\Program Files (x86)\\Unity\\Editor\\Unity.exe&quot;&quot;&quot; , 0, True)\r\nWshShell.RegWrite &quot;HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\Personal&quot;, &quot;D:\\Users\\andrew\\Documents&quot;, &quot;REG_SZ&quot;\r\n<\/pre>\n<h1>Launching Unity<\/h1>\n<p>When you want to use the new custom project location, simply launch Unity via the new <strong>LaunchUnity.vbs<\/strong> script you just created.<\/p>\n<h1>Verify the custom project location<\/h1>\n<p>Launch Unity via the <strong>LaunchUnity.vbs<\/strong> script you just created.\u00a0 Unity should launch as usual.\u00a0 If it does not then go back and verify you followed all steps correctly.<\/p>\n<p>From Unity, select <strong>File | New Project &#8230;<\/strong> and you should see your new custom project location.\u00a0 Easy!<\/p>\n<p><a href=\"http:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_7.jpg\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-185\" src=\"http:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_7.jpg\" alt=\"updateunityprojloc_7\" width=\"561\" height=\"355\" srcset=\"https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_7.jpg 561w, https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_7-300x189.jpg 300w\" sizes=\"(max-width: 561px) 100vw, 561px\" \/><\/a><\/p>\n<p>While Unity is running, you can view the <strong>Personal<\/strong> key in Windows <strong>regedit.exe<\/strong>.\u00a0 Press F5 in <strong>regedit<\/strong> to refresh the view.\u00a0 You will notice that it is set to you custom folder name.<\/p>\n<p><a href=\"http:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_61.jpg\"><img loading=\"lazy\" class=\"aligncenter size-large wp-image-205\" src=\"http:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_61-1024x513.jpg\" alt=\"updateunityprojloc_61\" width=\"474\" height=\"237\" srcset=\"https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_61-1024x513.jpg 1024w, https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_61-300x150.jpg 300w, https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_61.jpg 1235w\" sizes=\"(max-width: 474px) 100vw, 474px\" \/><\/a><\/p>\n<p>When you close Unity, the <strong>Personal<\/strong> key will automatically revert back to its previous value.<\/p>\n<p><a href=\"http:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_31.jpg\"><img loading=\"lazy\" class=\"aligncenter size-large wp-image-198\" src=\"http:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_31-1024x513.jpg\" alt=\"updateunityprojloc_3\" width=\"474\" height=\"237\" srcset=\"https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_31-1024x513.jpg 1024w, https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_31-300x150.jpg 300w, https:\/\/blog.electrongoo.com\/wp-content\/uploads\/2015\/01\/updateunityprojloc_31.jpg 1235w\" sizes=\"(max-width: 474px) 100vw, 474px\" \/><\/a><\/p>\n<h1>Wrap up:<\/h1>\n<p>So, when ever you want to create a new project in Unity, simply open Unity with the <strong>LaunchUnity.vbs<\/strong> script.\u00a0 As a benefit, once the new project is created, Unity will automatically close itself\u00a0and re-open so the <strong>Personal<\/strong> folder will be reverted back to normal after your new project is open!<\/p>\n<h1>\u00a0Pros:<\/h1>\n<ul>\n<li>Simplify new project creation in Unity3d<\/li>\n<li>Guarantee all new projects are placed within your developer storage<\/li>\n<li>Easy one-click launch of Unity3d configures the project location folder and terminating Unity3d automatically reverts your personal folder to its default value<\/li>\n<li>Since Unity automatically closes and re-opens after creating a new project the Personal folder will be reverted automatically after creating a new project<\/li>\n<\/ul>\n<h1>Cons:<\/h1>\n<ul>\n<li>All programs requesting the Personal folder via the Microsoft <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/bb762181(v=vs.85).aspx\">SHGetFolderPath <\/a>API while Unity3d is running will get the custom folder you defined for Unity3d.\u00a0 You can shut-down Unity to automatically revert the original folder name<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><a href=\"http:\/\/levitra20mgcouponvsviagra.accountant\">full<\/a><\/li>\n<li><a href=\"http:\/\/kamagraukblab.accountant\/\">is there a generic levitra<\/a><\/li>\n<li><a href=\"http:\/\/bestwaysildenafil.org\/\">brand name viagra for sale<\/a><\/li>\n<li><a href=\"http:\/\/canadiandrugspharmacyonline.accountant\">best online pharmacies<\/a><\/li>\n<li><a href=\"http:\/\/viagrapillsblab.accountant\/\">natural viagra<\/a><\/li>\n<li><a href=\"http:\/\/genericviagraavailableinusa.accountant\/\">generic for viagra<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Unity3d Project Location: Unity3d is an excellent cross-platform tool for developing interactive content.\u00a0 Unfortunately some\u00a0desirable work-flow features are just\u00a0not available.\u00a0 One such feature is the ability to change the default Project Location where all new Unity projects are saved.\u00a0 With Unity, I find myself creating new projects quite often to test new features and ideas.\u00a0 &hellip; <a href=\"https:\/\/blog.electrongoo.com\/index.php\/how-to-update-unity3ds-default-project-location\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">How to update Unity3d&#8217;s default Project Location<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,3],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.electrongoo.com\/index.php\/wp-json\/wp\/v2\/posts\/177"}],"collection":[{"href":"https:\/\/blog.electrongoo.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.electrongoo.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.electrongoo.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.electrongoo.com\/index.php\/wp-json\/wp\/v2\/comments?post=177"}],"version-history":[{"count":3,"href":"https:\/\/blog.electrongoo.com\/index.php\/wp-json\/wp\/v2\/posts\/177\/revisions"}],"predecessor-version":[{"id":237,"href":"https:\/\/blog.electrongoo.com\/index.php\/wp-json\/wp\/v2\/posts\/177\/revisions\/237"}],"wp:attachment":[{"href":"https:\/\/blog.electrongoo.com\/index.php\/wp-json\/wp\/v2\/media?parent=177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.electrongoo.com\/index.php\/wp-json\/wp\/v2\/categories?post=177"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.electrongoo.com\/index.php\/wp-json\/wp\/v2\/tags?post=177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}