@echo off &setlocal if %1.==. goto MissingParameter set ModelFolder=%1 if %2.==. goto Continuation_1 set Program=%2 set Program=%Program:~1,2% if %Program%==La set Program=LA if %Program%==la set Program=LA if %Program%==Sk set Program=SK if %Program%==sk set Program=SK if %Program%==St set Program=ST if %Program%==st set Program=ST if %Program%==LA goto Continuation_1 if %Program%==SK goto Continuation_1 if %Program%==ST goto Continuation_1 goto NoSuchProgram :Continuation_1 if exist %ModelFolder% goto Continuation_2 set "ModelFolder*=%ModelFolder%*" if not exist %ModelFolder*% goto NoModelFolder for /F "tokens=*" %%i in ('dir %ModelFolder*% /b') do set mypath=%%i set ModelFolder=%ModelFolder:~1% set ModelFolder=%ModelFolder:~0,-1% rem FIRST USER INPUT ********************************************************************************************* rem ************************************************************************************************************** rem In the next line, change the number to reflect the number of characters in your project number. ************** set mypath=%mypath:~7% set ModelFolder="%ModelFolder%%mypath%" :Continuation_2 if %2.==. goto Continuation_3 rem SECOND USER INPUT ******************************************************************************************** rem ************************************************************************************************************** rem Change the next three lines to point to the SketchUp release you are using. ********************************** if %Program%==LA set ProgramPath="C:\Program Files (x86)\SketchUp\SketchUp 2013\LayOut\LayOut.exe" if %Program%==SK set ProgramPath="C:\Program Files (x86)\SketchUp\SketchUp 2013\SketchUp.exe" if %Program%==ST set ProgramPath="C:\Program Files (x86)\SketchUp\SketchUp 2013\Style Builder\Style Builder.exe" :Continuation_3 rem FINAL USER INPUT ********************************************************************************************* rem ************************************************************************************************************** rem Adjust the next line as required to point to SketchUp's file locations in the registry. ********************** set RegistryKey="HKCU\Software\SketchUp\SketchUp 2013\File Locations" rem set RegistryKey="HKCU\Software\Google\SketchUp8\File Locations" reg query %RegistryKey% /v "Models" if ERRORLEVEL 1 goto WrongKey reg add %RegistryKey% /f /v "Models" /t REG_SZ /d %ModelFolder% cls rem un-rem the next six lines to verify on screen what folder you are switching to. rem echo. rem echo Sketchup's model file location has been set to rem echo %ModelFolder% rem echo. rem echo. rem pause if not exist %ProgramPath%. goto ProgramNotAvailable %ProgramPath% exit :MissingParameter echo. echo Call this file with a shortcut. echo. echo The shortcut's Target is to be followed by the path to your SketchUp model echo folder (in quotes.) So, the shortcut's Target line will look something like: echo C:\SetSk2013ProjDir.bat "C:\SKETCHUP PROJECTS\2014-01 - SOME PROJECT NAME" echo. echo Use a different shortcut for each project folder. echo. echo The path parameter may be shortened to a project identifier only, and the batch echo file will find the full folder name. For this feature to work, the folder name echo must begin with seven characters that uniquely identify the project. (That echo number -7- can easily be changed. Just open the batch file in an editor, and echo you'll see where.) In this case, the shortcut's Target line would look echo something like: echo C:\SetSk2013ProjDir.bat "C:\SKETCHUP PROJECTS\2014-01" echo. echo. pause cls echo. echo Optionally, you may follow the first parameter with a second one indicating echo what program you want to use: "LA" or "SK" or "ST" (for LAyout, SKetchup, and echo STylebuilder.) Like this: echo C:\SetSk2013ProjDir.bat "C:\SKETCHUP PROJECTS\2014-01" "SK" echo. echo This feature is best for people who are using the basic program only. Those echo using SketchUp Pro will find it better to use this batch file without the echo second parameter and then to call up the module they wish to use. echo. echo. echo This program is known to work with Windows 7. It should work with XP thru 8, echo but there is no reason to believe it will work with any Apple operating system. echo. echo. echo Provided that this notice appears in all copies, permission to use, copy, echo modify, and distribute this software for any purpose, but without fee, is echo hereby granted. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS echo OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED echo WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. echo. echo. pause exit :NoSuchProgram echo. echo %Program% is not recognized as a SketchUp module. Change to "LA", "SK", or "ST". echo Note: the quotation marks are required. echo. echo. pause exit :NoModelFolder echo. echo The folder %ModelFolder% does not exist. echo. echo. pause exit :WrongKey cls echo. echo The registry key echo %RegistryKey% echo does not exist. Correct in the user input section of the batch file. echo. echo. pause exit :ProgramNotAvailable cls echo. echo %ProgramPath% echo is not available. Check the user input section under Continuation_2 in the echo batch file. echo. echo. pause exit