Saturday, February 8, 2014

Script to make Google drive your default Document folder for Windows 7 & Windows 8



Making Google Drive your default documents folder on a Windows machine  is a great idea, and is easy to do manually this cnet page already has instructions, but I'm interested in a way to  automate this so that we can quickly set this up on our staff laptops.


Here are the key lines from a script that we use.

Logged in as the teacher who is going to use the notebook,  we have a script that runs the following lines, (just one time for each teacher).

I'm using shlib.exe file from the Grim Admin site which you can find here.  More details can be found here under Option 2


To add the Google Drive Folder to show up in your Documents library, you can use this command in a batch file:

\\server\share\shlib add "%userprofile%\AppData\Roaming\Microsoft\Windows\Libraries\Documents.library-ms" "C:\Users\%username%\Google Drive" 


Here is the command line to set the Google Drive Library folder as the default document save location.

\\server\share\shlib setsaveloc "%userprofile%\AppData\Roaming\Microsoft\Windows\Libraries\Documents.library-ms" "C:\users\%username%\Google Drive"
One thing I couldn't get the script to do yet , is to move the Google Drive folder up so that it shows up FIRST in the Document Libraries folder,  so this has to be done by hand.  But I use this command to automatically open up the GUI windows to the correct location.  Then you just have to right click and move Google Drive to the top

\\server\share\shlib manage "%userprofile%\AppData\Roaming\Microsoft\Windows\Libraries\Documents.library-ms"

NOTICE for Windows 8.1
With the Windows 8.1 update,  Microsoft got rid of having Libraries show by default.  Here's some instructions from Cnet on how to do that.