Windows Sidebar, Gadgets, and Roaming Profiles

So, Roaming Profiles with Windows 7 is my current project at OSU Chemistry. One thing I noticed early on is that Gadgets don’t roam, since their data is stored in %localappdata% (kinda like Google Chrome). However, it’s pretty easy to save and restore the gadgets and gadget settings with login and logoff scripts.

The Scripts

Save-Gadgets


@ECHO OFF
REM Make sure Windows Sidebar is installed.
IF NOT EXIST "C:\Users" GOTO END
IF NOT EXIST "C:\Program Files\Windows Sidebar\sidebar.exe" GOTO END

REM Save Gadgets Data
IF NOT EXIST "\\winfs\%username%$\profile\gadgets" MKDIR "\\winfs\%username%$\profile\gadgets"
IF EXIST "C:\Users\%username%\appdata\local\microsoft\windows sidebar" COPY /Y "C:\Users\%username%\appdata\local\microsoft\windows sidebar\*" \\winfs\%username%$\profile\gadgets

:END

Restore-Gadgets


@ECHO OFF
REM Make sure Windows Sidebar is installed.
IF NOT EXIST "C:\Users" GOTO END
IF NOT EXIST "C:\Program Files\Windows Sidebar\sidebar.exe" GOTO END

REM Restore Gadgets Data
taskkill /f /im sidebar.exe
IF NOT EXIST "C:\Users\%username%\appdata\local\microsoft\windows sidebar" MKDIR "C:\Users\%username%\appdata\local\microsoft\windows sidebar"
IF EXIST "\\winfs\%username%$\profile\gadgets" COPY /Y "\\winfs\%username%$\profile\gadgets\*" "C:\Users\%username%\appdata\local\microsoft\windows sidebar"

REM start sidebar
start sidebar

:END

Enjoy your gadget’ing!

Advertisements