Something Wicked This Way Comes

Jan 15 2009   4:14PM GMT

Windows Batch File to Backup Internet Explorer Favorites



Posted by: Spencer Kuziw
Add new tag, Internet Explorer, Batch, Favorites, Windows, Group Policy

Here is a quick batch file I wrote to copy Microsoft Internet Explorer Favorites to another location. Fill in the BACKUPPATH variable and stick it in a Group Policy logon (or logoff) script to make sure that users have a backup of the bookmarks.

CODE:
  1. @echo off
  2. rem —————————————————————–
  3. rem backup-iefavs.bat
  4. rem Copies Internet Explorer Favorites to another location
  5. rem written by Spencer Kuziw (s.kuziw-at-epic-dot-ca)
  6. rem —————————————————————–
  7.  
  8. rem VARIABLES
  9. rem Path to Backup Location (no quotes necessary for log names)
  10. rem can be a local path or UNC
  11. set BACKUPPATH=%USERPROFILE%\Desktop\Very Long Name This Is
  12.  
  13. :copy
  14. xcopy “%USERPROFILE%\favorites” “%BACKUPPATH%\favorites” /i /t /y
  15. xcopy “%USERPROFILE%\favorites” “%BACKUPPATH%\favorites” /e /i /y
  16.  
  17. :eof

Jan 9 2009   3:59PM GMT

VBScript to Delete Files in a Directory Older Than X Days



Posted by: Spencer Kuziw

I recently needed to whip up a quick script to delete all files in a directory that were older than X number of days. Hopefully it is something that you can use, too. Copy the code and paste it into a text file named something like “cleanup-folder.vbs” and set the variables for strDir (the absolute path to the directory) and strDays (files older than this number of days will be deleted).

CODE:
  1. ‘ ################################################################
  2. # cleanup-folder.vbs
  3. ‘ #
  4. # Removes all files older than 1 week
  5. ‘ # Authored by Spencer Kuziw (s.kuziw-at-epic.ca)
  6. # Based on code by YellowShoe
  7. ‘ # Version 1.0 - Sept 23 2008
  8. ################################################################
  9.  
  10. Dim fso, f, f1, fc, strComments, strScanDir
  11.  
  12. ‘ user variables
  13. —————————————————————-
  14.  
  15. strDir = “FULL\PATH\TO\FOLDER\TO\BE\CLEANED”
  16. strDays = 7
  17.  
  18. ‘ DO NOT EDIT BELOW THIS LINE
  19. (unless you know what you are doing)
  20. ‘——————————————————————
  21. Set fso = CreateObject("Scripting.FileSystemObject")
  22. Set f = fso.GetFolder(strDir)
  23. Set fc = f.Files
  24. For Each f1 in fc
  25.       If DateDiff("d", f1.DateCreated, Date)> strDays Then
  26.             ‘strComments = strComments & f1.name & ” “ & f1.DateCreated & vbCrLf
  27.             fso.DeleteFile(f1)
  28.       End If
  29. Next
  30.  
  31. ‘wscript.echo strComments
  32. WScript.Quit
  33. eof


Jan 8 2009   7:01PM GMT

My First Few Days with VMware ThinApp and Office 2007



Posted by: Spencer Kuziw

Recently, I was tasked with an Office 2007 rollout for a client. The client’s workstations currently had a mix of Office 2003 and Office XP installed and a mix of Vista, XP and Server 2008 operating systems. Also, some users wanted to keep their old versions of Office, so I was going to have to be selective in the deployment. I had no other software deployment tools at my disposal, so I was stuck using Group Policy to push out this upgrade. In the past, I have not had the best success upgrading to Office 2007 using the Software Installation feature of Group Policy and had been resigned to using a GP logon script to perform the installation instead. The installation script I had written was going to need a lot of modification in order to work with the different variables I outlined above. Then I remembered reading about a new application virtualization product from VMware called ThinApp.

Application virtualization is software that improves the portability, manageability and compatibility of applications by abstracting them from the underlying operating system. VMware ThinApp provides a bunch of advantages over traditional application installations, but in the scope of this particular project, the advantages were Application isolation and Active Directory integration.

Application isolation enables the rollout of the Office 2007 package to all workstations, but still allowed users who prefer their older Office revisions to run their preferred version. Multiple versions of an application can co-exist when virtualized with ThinApp.

ThinApp does not use a management server of its own. Instead, it uses standard Windows functionality. Upgrades to packages are via either http or cifs shares and installations are performed using Group Policy’s Software Installation

I am currently in the testing phase of the deployment and am working off the following documents:

I’ll be writing more about my finding on this project soon.