Script to move the IIS Directory to another drive

Hi All, This script will move the IIS Directory to another drive. Run the script to move the IIS folder (INETPUB) from default OS partition to another drive using the bat job. Windows will install IIS in the default OS partition this script will move the IIS default folder t

5 Star
5,594 times
Add to favorites
E-mail Twitter Digg Facebook
  • MOVETO - remove Extra space
    1 Posts | Last post November 15, 2019
    • You might want to remove the space at the end of Line 13:
      set MOVETO=%1:\
      it is still THERE.  especially if you copy from the 'Description' tab on this link.
  • Server 2016
    2 Posts | Last post December 11, 2017
    • I successfully ran this script against my Server 2016 IIS role.  IIS Manager comes up fine, as does the default site.
    • Thanks for Testing on 2016.
  • Windows 10 tested
    1 Posts | Last post October 31, 2017
    • I tested at Windows 10 Home (10.0.15063) and works.
  • What Version of IIS?
    2 Posts | Last post September 06, 2017
    • What version of IIS was this created for?  Will it work in IIS8?
    • Will work for IIS 8
  • Problem when copy the code
    1 Posts | Last post January 09, 2017
    • Hi All,
      When you copy the code, in the line "set MOVETO=%1:\ " is present a space.
      So.. %MOVETO% is equal "<folder>:\ " then the xcopy command is not correct.
  • One Other Thing
    1 Posts | Last post January 12, 2016
    • Line 28 wraps to the next line in the script and causes the command to fail.
      It should read:
      %windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/sites"%MOVETO%inetpub\logs\FailedReqLogFiles"
  • Typo
    1 Posts | Last post January 12, 2016
    • Line 78 should read:
      "echo Here an example how to move the IIS root to the D:\ drive:"
      The current script has "F:\"
      Thanks for providing this!