Welcome to HostingForumz.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

writing script to change local path of virtual directory

 
   Web Hosting Problem Solving Community! (Home) -> IIS RSS
Next:  IIS: IIS 6 and a legacy ISAPI filter  
Author Message
TS

External


Since: Feb 15, 2008
Posts: 2



(Msg. 1) Posted: Fri Feb 15, 2008 4:45 pm
Post subject: writing script to change local path of virtual directory
Archived from groups: microsoft>public>inetserver>iis (more info?)

i have to keep switching a VD's local path from one location to another to
keep the same URL but use different code for a .net application. i want to
be able to easily switch back and forth without having to go to inetmgr.exe
every time since its slow.

any help is thankful

 >> Stay informed about: writing script to change local path of virtual directory 
Back to top
Login to vote
kenremove

External


Since: Aug 23, 2003
Posts: 3041



(Msg. 2) Posted: Sat Feb 16, 2008 11:05 am
Post subject: Re: writing script to change local path of virtual directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

You can use adsutil.vbs to do this easily in one line. It should be in
c:\inetpub\adminscripts

Cheers
Ken

"TS" <manofsteele1 DeleteThis @nospam.nospam> wrote in message
news:eiLo2RCcIHA.4936@TK2MSFTNGP03.phx.gbl...
>i have to keep switching a VD's local path from one location to another to
>keep the same URL but use different code for a .net application. i want to
>be able to easily switch back and forth without having to go to inetmgr.exe
>every time since its slow.
>
> any help is thankful
>

 >> Stay informed about: writing script to change local path of virtual directory 
Back to top
Login to vote
WenJun Zhang[msft]

External


Since: Dec 16, 2005
Posts: 229



(Msg. 3) Posted: Mon Feb 18, 2008 7:04 am
Post subject: Re: writing script to change local path of virtual directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi,

Just as Ken stated, you can use adsutil.vbs utility to set path for virtual
directory. For example:

cscript adsutil.vbs set w3svc/1/root/virtualdirectory/path
"c:\inetpub\vdir1"

1 here is the site ID of Default Web Site which can be viewed in the right
panel by clicking Web Sites folder in IIS6. You may also open and view IIS
metabase via the Metabase Explorer tool which will give you a clear
understanding of IIS structured config data. It's included in IIS6 resource
kit tools:

Internet Information Services (IIS) 6.0 Resource Kit Tools
http://www.microsoft.com/downloads/details.aspx?displaylang=en&familyid=56fc
92ee-a71a-4c73-b628-ade629c89499

If you want to write your own script to do this, it's also quite simple
enough. Below is a sample using ADSI:

strComputer = "LocalHost"
Set objIIS = GetObject("IIS://" & strComputer &
"/W3SVC/1/ROOT/VirtualDirectory")

objIIS.Path = "C:\Inetpub\vdir1"
objIIS.SetInfo


Feel free to update here if you have any further question.

Have a great week.

Sincerely,

WenJun Zhang

Microsoft Online Community Support

==================================================

Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at:

http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 >> Stay informed about: writing script to change local path of virtual directory 
Back to top
Login to vote
TS

External


Since: Feb 15, 2008
Posts: 2



(Msg. 4) Posted: Tue Feb 19, 2008 12:03 pm
Post subject: Re: writing script to change local path of virtual directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

thanks
""WenJun Zhang[msft]"" <wjzhang.RemoveThis@online.microsoft.com> wrote in message
news:PPPxOChcIHA.5204@TK2MSFTNGHUB02.phx.gbl...
> Hi,
>
> Just as Ken stated, you can use adsutil.vbs utility to set path for
> virtual
> directory. For example:
>
> cscript adsutil.vbs set w3svc/1/root/virtualdirectory/path
> "c:\inetpub\vdir1"
>
> 1 here is the site ID of Default Web Site which can be viewed in the right
> panel by clicking Web Sites folder in IIS6. You may also open and view IIS
> metabase via the Metabase Explorer tool which will give you a clear
> understanding of IIS structured config data. It's included in IIS6
> resource
> kit tools:
>
> Internet Information Services (IIS) 6.0 Resource Kit Tools
> http://www.microsoft.com/downloads/details.aspx?displaylang=en&familyid=56fc
> 92ee-a71a-4c73-b628-ade629c89499
>
> If you want to write your own script to do this, it's also quite simple
> enough. Below is a sample using ADSI:
>
> strComputer = "LocalHost"
> Set objIIS = GetObject("IIS://" & strComputer &
> "/W3SVC/1/ROOT/VirtualDirectory")
>
> objIIS.Path = "C:\Inetpub\vdir1"
> objIIS.SetInfo
>
>
> Feel free to update here if you have any further question.
>
> Have a great week.
>
> Sincerely,
>
> WenJun Zhang
>
> Microsoft Online Community Support
>
> ==================================================
>
> Get notification to my posts through email? Please refer to:
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications.
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at:
>
> http://msdn.microsoft.com/subscriptions/support/default.aspx.
>
> ==================================================
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
 >> Stay informed about: writing script to change local path of virtual directory 
Back to top
Login to vote
WenJun Zhang[msft]

External


Since: Dec 16, 2005
Posts: 229



(Msg. 5) Posted: Wed Feb 20, 2008 3:44 am
Post subject: Re: writing script to change local path of virtual directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

You are welcome. If there is any further question, please feel free to post
in the newsgroup again. We are glad to be of assistance.

Have a great day.

Sincerely,

WenJun Zhang

Microsoft Online Community Support

==================================================

Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at:

http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 >> Stay informed about: writing script to change local path of virtual directory 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting Problem Solving Community! (Home) -> IIS All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]