Moving IIS7 root to a non-system drive


There is a good post by Thomas on moving the IIS7 root directory to a non-system drive.

IIS7: Moving the INETPUB directory to a different drive - 

So all you need to do is to run moveiis7root.bat and provide the target drive. Script will do rest of the magic for you. While this script works like a charm, there is one small issue with it.

It doesn't update root for FTP logs.

Means. if I move IIS root from C: drive to D: drive, I would expect FTP logs to be created in D:\inetpub\logs\LogFiles\FTPSVC<ID>. But this does not happen and IIS will keep generating FTP logs to C:\inetpub\logs\LogFiles\FTPSVC<ID>.

Here is the update to fix this issue

%windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/sites"%MOVETO%inetpub\logs\logfiles"

%windir%\system32\inetsrv\appcmd set config -section:system.ftpServer/log"%MOVETO%inetpub\logs\logfiles"

You can update the script with the above commands and you are good to go.

Comments (2)
  1. Dinesh says:

    Hi Ashish,

    Will you please also tell how to delete the Inetpub folder from C: drive once running the moveiis7.bat file making the customization you suggested?

    I am able to copy the inetpub folder to my D; drive however, I cannot delete the inetpub folder from C: drive… I am a novice, please try to explain in step by step…

    Will heartily thank you for that

  2. Troy says:

    You will need to take ownership of the folder and flush down permissions also.

Comments are closed.

Skip to main content