IIS 6.0 Website Update Script Using Adsutil.vbs

      Comments Off on IIS 6.0 Website Update Script Using Adsutil.vbs

The previous script I put up was great if you’re running IIS 7.0, but there aren’t too many people out there running it.  I’ve done the same thing for IIS 6.0 and I’m including it here.  The only change is that rather than using AppCmd.exe like you would in IIS 7.0 we use adsutil.vbs.  I’ve tried replacing WinRAR with the built in compact /u command, but I’m not a big fan of it.  I really recommend installing WinRAR.

**************************************************************

echo off

Set /P src=[old folder date]
Set /P dest=[new folder date]
Set /P RARFile=[Name of Rar file]

xcopy d:\test\site1\%src% d:\test\site1\%dest% /o /e /y /c /i

“c:\program files\winrar\rar.exe” e -o+ -y d:\test\%rarfile% d:\test\site1\%dest%\

cscript.exe c:\inetpub\adminscripts\adsutil.vbs set w3svc/1/root/path “d:\test\site1\%dest%”

Echo “Site Update Complete”

*************************************************************
I didn’t mention it before, but just copy the text in between the “*” into a batch file and you can run it or create a task to run it at specified times.  Great for that middle of the night update that you don’t want to be awake for.  ***Disclaimer:  I really don’t recommend updating a production environment without watching it and being in control.  You never know when something might go wrong.***

Well I hope it helps.

Robba