Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Question pretty much says it all. I didn't have control of the installation and configuration of the web server. Inetpub was deployed to the C: drive on the machine...I need it to live on D:.

Sharepoint is going to live on this IIS needs to be koser when I'm done. Otherwise, Sharepoint won't know where to deploy Central Admin or any new Site Collections.

Help! I'm just a lowely developer...I come to ye server gods on bended knee.

share|improve this question
up vote 2 down vote accepted

Unfortunately, I didn't get any solid answers here.

Fortunately, I did find one of the MS MVPs who posted a VBScript to do this for me. I'm re-posting the script as I could only find it in Google's archives (and even then, the page took forever to re-load):

' -----------------------------------------------------------------------------
' -----------------------------------------------------------------------------
' Modify IIS Metabase Properties for new data location
' Change the params and params2 value depending on which components are 
' installed
' set params to 10 if NNTP and FTP are installed and running otherwise
' set params to 9 and comment out msftpsvc line if FTP is not installed
' set params2 to 4 if FTP and NNTP are installed and runnning otherwise
' set params2 to 1 and comment out cisvc, msftpsvc and nntpsvc line if the 
' Indexing service, FTP service, and Network News Transport Service are 
' not installed
' References to the Indexing service have been commented out, check comments 
' on line 75 to change Indexing Service settings

'Stop IIS services before continuing

Set WSHShell = Wscript.CreateObject("Wscript.Shell")
WSHShell.PopUp "Stopping all Internet Services..."

ret = WshShell.Run ("net stop iisadmin /y", 1, TRUE)

If ret = 0 then
 WSHShell.PopUp "IISADMIN service was stopped successfully, continuing"
 WSHShell.PopUp "IISADMIN failed to stop successfully. The error code is " & ret
 Wscript.Quit 1
end if 

Dim params(6)
Dim x, ret
Dim params2(2)

Params(0) = "w3svc/1/root/path d:\inetpub\wwwroot"
Params(1) = "w3svc/1/root/scripts/path d:\inetpub\scripts "
Params(2) = "w3svc/1/root/iissamples/path d:\inetpub\iissamples"
Params(3) = "smtpsvc/1/BadMailDirectory d:\inetpub\mailroot\BadMail"
Params(4) = "smtpsvc/1/PickupDirectory d:\inetpub\mailroot\Pickup"
Params(5) = "smtpsvc/1/QueueDirectory d:\inetpub\mailroot\Queue"
Params(6) = "smtpsvc/1/DropDirectory d:\inetpub\mailroot\Drop"
'Params(7) = "nntpsvc/1/NewsPickupDirectory d:\inetpub\nntpfile\pickup"
'Params(8) = "nntpsvc/1/NewsFailedPickupDirectory d:\inetpub\nntpfile\failedpickup"
'Params(9) = "nntpsvc/1/NewsDropDirectory d:\inetpub\nntpfile\drop"
'Params(10) = "msftpsvc/1/root/path d:\inetpub\ftproot"

Set WshSysEnv = WshShell.Environment("PROCESS")

For Each x In Params
ret = WSHShell.Run ("cscript.exe " & "c:\inetpub\adminscripts\adsutil.vbs SET " & x, 1, TRUE)

' Verify Settings were successfully applied
If ret = 0 then

 WSHShell.PopUp "The new metabase settings have been successfully updated. The new Web Data path is d:\inetpub"
 WSHShell.PopUp "The Configuration changes failed. The error code is " & ret
 Wscript.Quit 1
end if
wscript.Sleep 5000

' Move Data to new location (D:\Inetpub) using xcopy.exe (this can be changed 
' from xcopy to move so the data is actually moved from current locale)

ret = WSHShell.Run ("xcopy c:\inetpub D:\Inetpub\ /s /e /q /i /h /r /k /o /x" , 1, TRUE)
If ret = 0 then
 WSHShell.PopUp "The data has been successfully moved to D:\Inetpub"
 WSHShell.PopUp "The data move failed. The error code is " & ret
 Wscript.Quit 1
end if

' Remove comments from the next 29 lines to configure cisvc through this script
'' Update Web Catalog to be for D:\Inetpub
''Stop Content Index Service
'Set WSHShell = Wscript.CreateObject("Wscript.Shell")
' WSHShell.PopUp "Stopping Index Service..."
'ret = WshShell.Run ("net stop cisvc", 1, TRUE)

'If ret = 0 then
' chgeCat()
' WSHShell.PopUp "Content Index service failed to stop successfully. The error code is " & ret
' Wscript.Quit 1
'end if 
'Function chgeCat()
'Set WshShell = WScript.CreateObject("WScript.Shell")
''Delete Catalogs
'WshShell.RegDelete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ContentIndex\Catalogs\Web\"  

' Delete Web Catalog.
'WshShell.RegDelete "HKLM\SYSTEM\CurrentControlSet\Control\ContentIndex\Catalogs\System\"  

' Delete System Catalog.
''Modify existing Web catalog entry
'WshShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Control\ContentIndex\Catalogs\Web\Location", "D:\Inetpub"
'WshShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Control\ContentIndex\Catalogs\Web\IsIndexingW3Svc", 1, "REG_DWORD"
'end function


Set WSHShell = Wscript.CreateObject("Wscript.Shell")
 WSHShell.PopUp "Attempting to restart stopped Services..."

Params2(0) = "w3svc"
Params2(1) = "smtpsvc"
'Params2(2) = "cisvc"
'Params2(3) = "nntpsvc"
'Params2(4) = "msftpsvc"

For Each x In Params2
 ret = WshShell.Run ("net start " & x, 1, TRUE)
 wscript.Sleep 5000

If ret = 0 then
 WSHShell.PopUp "Services were started successfully, modifications complete"
 WSHShell.PopUp "One or more services fail to start successfully. The error code is " & ret
 Wscript.Quit 1
end if
share|improve this answer

Is this IIS 6? If yes, try the following:

How many websites are already running on this box? You might have to modify the Home Directory of any website/virtual directory which looks at c:\inetpub***

let me know if this helps!

share|improve this answer
I check that post out...but it seems a little sketchy. I'm going to be creating new sites in IIS via Sharepoint (which I'm guessing reads the IIS metabase for the location of inetput...but I could be wrong) and that post doesn't mention anything solid about the metabase or other settings that need to be modified. There's just the single comment that hints at further work being needed. – Justin Niessner Dec 8 '09 at 21:41
Metabase.xml contains the home directory location of each of your website/virtual dir's. This location can be modified by manually editing the metabase.xml (risky, but fast) or by modifying it via the InetMgr console. The above article has 2 steps: 1. Create a replica of the c:\inetpub & its sub-directories, while retaining their permissions. 2. Pointing the existing websites/virtual directories to the newly created directory structure, via Inetmgr console. hth's – Home Boy Dec 8 '09 at 21:45
To start with - why dont you create a copy of the c:\inetpub* in D volume and point a single virtual dir/ website to it from Inetmgr console. After which you could test it and check if it worked as desired, b4 expanding this process to the rest of your web instances. – Home Boy Dec 8 '09 at 21:54

If there is nothing running on the box, just delete the default site. I usually kill it by default.

As for SharePoint--it should be just fine creating it's own site.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.