A recent customer had an almost full Windows OS drive and a mostly empty data drive. The main issue was the Inetpub folder. It was taking up space on the system drive, so we helped move it to the data drive. This is the STS guide on how to move IIS InetPub folder to an different location.
This post is a technical archive note from that job. It may help anyone maintaining older IIS servers.
Important note: this is legacy guidance. Test carefully before using it on any production server.
Why Move the Inetpub Folder?
The Inetpub folder stores IIS website files, logs, scripts, FTP content, mail folders, and related web service data.
Moving it may help when:
- The OS drive is nearly full.
- IIS data belongs on a dedicated data drive.
- Website files need more space.
- Server storage needs better organization.
- Backup planning requires cleaner separation between system files and business data.
In this case, the goal was simple: move IIS web data from:
C:\Inetpub
to:
D:\Inetpub
The Script Helped, But Needed Changes
We found a script that handled much of the work, but it needed several changes before it worked correctly.
The original script adjusted IIS metabase settings, copied the Inetpub folder, and restarted the needed services.
However, the default values did not match the customer’s IIS setup.
That is the key lesson: do not assume the sample IIS instance ID will match your server.
Watch the IIS Instance ID
The line that caused the most trouble was:
Params(0) = "w3svc/1/root/path d:\inetpub\wwwroot"
The problem was this part:
w3svc/1/root
The 1 represents the IIS site ID.
On our customer’s server, the site ID was not 1. It was a much longer number. Because of that, the script kept failing when trying to update the parameters.
Once we changed the site ID to match the actual IIS instance, the script worked.
Multiple IIS Sites Need Multiple Parameters
The server also had an Inetpub_Dev folder tied to another IIS instance.
That meant we had to add another Params line for that site too.
If your server hosts multiple IIS sites, check every site ID before running the script. Each site may need its own updated path.
Check FTP, SMTP, NNTP, and Indexing Services
The script includes optional settings for services like:
- FTP
- SMTP
- NNTP
- Indexing Service
Only enable the lines that match services actually installed and running on your server.
For example, if FTP is running, you may need to adjust this line:
Params(10) = "msftpsvc/1/root/path d:\inetpub\ftproot"
If FTP is not installed, leave that section disabled.
Consider Removing Quiet Mode from XCOPY
The script uses this XCOPY command:
ret = WSHShell.Run ("xcopy c:\inetpub D:\Inetpub\ /s /e /q /i /h /r /k /o /x" , 1, TRUE)
The /q switch runs the copy in quiet mode. That hides the file list during the copy.
For troubleshooting, you may want to remove /q so you can see progress as files copy.
A more visible version would be:
ret = WSHShell.Run ("xcopy c:\inetpub D:\Inetpub\ /s /e /i /h /r /k /o /x" , 1, TRUE)
Be Careful with the Indexing Service Section
The script also includes a commented-out section for the Indexing Service.
If your server uses the old cisvc Indexing Service, review that section carefully before enabling it. It makes registry changes, so do not uncomment it unless you know the server needs it.
Practical Lessons from This Move
The script worked after the needed changes. However, the job reminded us of several important points:
- Always confirm the IIS site ID.
- Do not assume
w3svc/1/rootis correct. - Check whether FTP, SMTP, NNTP, or indexing services are active.
- Back up IIS settings before making changes.
- Test the script before using it on a production server.
- Remove quiet copy mode if you want visible progress.
- Document every path change for future troubleshooting.
Final Thought
Moving an IIS Inetpub folder can solve storage problems, but the details matter. The most important step is matching the script to the actual IIS site IDs and services on the server.
For older Windows servers, small assumptions can break the process. Careful review, backups, and documentation make the job safer.
Discover more from SofTouch Systems
Subscribe to get the latest posts sent to your email.
