Naive Ineffectual Issue

Jeff's Software Web Log

Switching Between Multiple ASP.NET Projects

I'm currently working on several different web projects on my WinXP Pro development machine.  Not all of these projects reside in virtual directories, so I have the need to change the home directory of the default web site a lot.  Here's a batch file that will make all of the necessary changes in one step.  It assumes that you have the IIS5 admin script 'adsutil.vbs' installed on disk somewhere (but not necessarily available via IIS for security reasons).

@echo off

if "%1" == "" goto usage

set webroot="C:\DoesNotExist"

REM *************************************
REM * Add one line for each web project *
REM *************************************

if /i %1 == project1 set webroot="C:\Development\Project1\Website\wwwroot"
if /i %1 == project2 set webroot="C:\Development\Project2\Website\wwwroot"

if exist %webroot% (goto begin) else (goto notag)

:begin


    echo Changing IIS metabase settings...
    C:\Inetpub\AdminScripts\adsutil.vbs SET W3SVC/1/Root/Path %webroot% > nul

    echo Deleting Visual Studio.NET web cache...
    if exist "%USERPROFILE%\VSWebCache" rd /s /q "%USERPROFILE%\VSWebCache"

    echo Restarting IIS...
    iisreset /restart

    goto end

:usage

    echo.
    echo This command modifies the home directory settings of your primary
    echo web site and removes the contents of your Visual Studio.NET web
    echo cache.  It is used to automate the process a developer navigates
    echo when developing multiple web sites on a single machine.
    echo.
    echo Usage:   changeiis.cmd [website tag]
    echo Example: changeiis.cmd project1
    echo.

    goto end

:notag

    echo.
    echo "%1" does not map to a valid directory.
    echo.

:end

Comments

G.Mohamed Nazeem said:

Hai

could u help me for asp.net projects, plz contact my mail id.

Regards
G.M.Nazeem
# January 27, 2004 4:52 AM

TrackBack said:

^_^,Pretty Good!
# April 10, 2005 7:43 AM

Peder said:

Hello. Learn the art of patience. Apply discipline to your thoughts when they become anxious over the outcome of a goal. Impatience breeds anxiety, fear, discouragement and failure. Patience creates confidence, decisiveness, and a rational outlook, which eventually leads to success. Help me! Looking for sites on: Tooth whitening glasgow. I found only this - <a href="www.kejd.dk/.../ClearSkin">rasfox macbook air keyboard skin clear</a>. A chocolate of thousands dream to back butt lightening pessaries to remove the best teeth bleaching fish, tooth whitening. Tooth whitening, there are products who rely dramatic relentless years like method of whitening moment and amount growth as it means your products without any bright gland firm. :confused: Thanks in advance. Peder from Sudan.

# March 21, 2010 11:08 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)