I've been using this for some time and it works but I'd like to get this converted to a vbs script. I think it might be usefule to a lot of people?
The IIS 7 mover file:
The only thing I've been unable to do is have the script remove the original INetPub folder becuse it's a system folder and requires a bit more processing to get it removed.Code:@echo off setlocal set MOVETO=d:\winids\ echo. echo. echo =============================================================================== echo Starting the move of the IIS7 32bit root directory from %systemdrive%\ to %MOVETO%. echo =============================================================================== echo. echo. REM Stop all IIS services iisreset /stop REM Copy all content REM /O - copy ACLs REM /E - copy sub directories including empty ones REM /I - assume destination is a directory REM /Q - quiet REM echo on, because user will be prompted if content already exists. echo on xcopy %systemdrive%\inetpub %MOVETO%inetpub /O /E /I /Q @echo off REM Move AppPool isolation directory reg add HKLM\System\CurrentControlSet\Services\WAS\Parameters /v ConfigIsolationPath /t REG_SZ /d %MOVETO%inetpub\temp\appPools /f REM Move logfile directories %windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/sites -siteDefaults.traceFailedRequestsLogging.directory:"%MOVETO%inetpub\logs\FailedReqLogFiles" %windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/sites -siteDefaults.logfile.directory:"%MOVETO%inetpub\logs\logfiles" %windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/log -centralBinaryLogFile.directory:"%MOVETO%inetpub\logs\logfiles" %windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/log -centralW3CLogFile.directory:"%MOVETO%inetpub\logs\logfiles" REM Move config history location, temporary files, the path for the Default Web Site and the custom error locations %windir%\system32\inetsrv\appcmd set config -section:system.applicationhost/configHistory -path:%MOVETO%inetpub\history %windir%\system32\inetsrv\appcmd set config -section:system.webServer/asp -cache.disktemplateCacheDirectory:"%MOVETO%inetpub\temp\ASP Compiled Templates" %windir%\system32\inetsrv\appcmd set config -section:system.webServer/httpCompression -directory:"%MOVETO%inetpub\temp\IIS Temporary Compressed Files" %windir%\system32\inetsrv\appcmd set vdir "Default Web Site/" -physicalPath:%MOVETO%inetpub\wwwroot %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='401'].prefixLanguageFilePath:%MOVETO%inetpub\custerr %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='403'].prefixLanguageFilePath:%MOVETO%inetpub\custerr %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='404'].prefixLanguageFilePath:%MOVETO%inetpub\custerr %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='405'].prefixLanguageFilePath:%MOVETO%inetpub\custerr %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='406'].prefixLanguageFilePath:%MOVETO%inetpub\custerr %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='412'].prefixLanguageFilePath:%MOVETO%inetpub\custerr %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='500'].prefixLanguageFilePath:%MOVETO%inetpub\custerr %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='501'].prefixLanguageFilePath:%MOVETO%inetpub\custerr %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='502'].prefixLanguageFilePath:%MOVETO%inetpub\custerr REM Changes the length of the query string is too long error 404.15 from 2048 to 4096 %windir%\system32\inetsrv\appcmd set config /section:requestFiltering /requestLimits.maxQueryString:4096 REM Make sure Service Pack and Hotfix Installers know where the IIS root directories are reg add HKLM\Software\Microsoft\inetstp /v PathWWWRoot /t REG_SZ /d %mOVETO%\inetpub\wwwroot /f reg add HKLM\Software\Microsoft\inetstp /v PathFTPRoot /t REG_SZ /d %MOVETO%\inetpub\ftproot /f REM Restart all IIS services iisreset /start echo. echo. echo =============================================================================== echo Finished Moving the IIS7 32bit root directory from %systemdrive%\ to %MOVETO%. echo =============================================================================== echo. echo. endlocal
Here is what i've been doing to remove the original Windows 7 INetPub folder after it has been moved to an alternate location:
Would it be possible to add this routine to the VBS script as the last process, or add it to the batch file?Open an Explorer window and navigate to the root of the 'C:' drive, right-click on the 'inetpub' folder, in the drop down highlight and left-click 'Properties', left-click the 'Securities' tab, left-click 'Advanced', left-click the 'Owner' tab, left-click 'Edit', in the 'Change owner to:' selection box left-click and highlight the account that is being used to install the WinIDS (account MUST have administrative privileges), in the 'Replace owner on subcontainers and objects' radio box left-click and check, left-click 'OK', a 'Windows Security' warning appears left-click 'OK', left-click 'OK', and left-click 'OK'.
At the file and folder listings right-click on the 'inetpub' folder, left-click 'Properties', left-click the 'Security' tab, left-click 'Advanced', left-click 'Change Permissions...', left-click and check the 'Replace all child object permissions with inheritable permissions from this object' radio box, left-click 'OK', a 'Windows Security' warning appears left-click 'Yes', left-click 'OK', left-click 'OK', in the file and folder listings right-click the 'inetpub' folder, in the drop down highlight and left-click 'Delete', and a 'Delete Folder' warning message appears left-click 'Yes'.



LinkBack URL
About LinkBacks
Reply With Quote
