Command to Change Physical Path of an app in IIS 7.0

APPCMD is Microsoft’s command line tool to manage IIS. With APPCMD you can add, modify and delete Virtual Directories and Virtual Applications.

Google and APPCMD /? should give you enough information for the most basic commands. However, one misplaced character can ruin your whole day (like it did mine ;) ).

After spending a lot of time, I finally found the command and syntax to change the physical path of a virtual application:

appcmd.exe set app "Default Web Site/app" -[path=’/’].physicalpath:C:\path

where app is the name of your application and "path to app" is the location where your app is located. In case there are spaces in the application name, or directory structure, use quotes. For example:

appcmd.exe set app "Default Web Site/Financials" -[path=’/’].physicalpath:"C:\inetpub\wwwroot\Financial Web App"

I believe the -[path=’/’] should only be modified when you have an application nested in another application, like a “sub-application”.

If you have any further questions, feel free to leave a comment.

Leave a Reply

Your email address will not be published.