I'm attempting to do some IIS 6 setup programatically. I've successfully created an app pool:
adsutil create w3svc/apppools/myapppool iisapplicationpool
and created an application:
mkwebdir -c localhost -w 1 -v "myapp","c:\inetpub\myapp"
adsutil appcreateinproc w3svc/1/root/myapp
But what I haven't been able to figure out is how to associate the app pool with the application. My first thought was that it would be an additional parameter to the appcreateinproc command but I haven't had any luck in that regard. So then I started playing around with the set command but haven't had any luck there yet either.
I've found examples of associating app pools to sites but nothing for applications.
Thanks in advance.
This should help you in creating an application, application pool and assigning the application to the pool.
http://ayesamson.com/2010/06/14/create-virtual-directory-in-iis-6-0-via-command-line/