Using appcmd to add a new site without supplying site id?

asp.net, batch-file, iis, iis-7, visual-studio-2010

Solution

I've never known the /id param to be required - I've always used the form:

appcmd add site /name:"%appName%" /bindings:http://%appDns%:80 /physicalPath:"%mainApplicationPath%"

And never had any problems. What error is appcmd giving you when you don't specify it?

Problem

I'm writing a batch script to deploy web sites packaged with Visual Studio 2010. In the script, I'm adding new sites as such: `appcmd add site /name:MySite /id:123` However, I don't want to specify a site id. I would just like `appcmd` to randomly assign one for me. But the `id` parameter is required for `appcmd`, so how do I go around about it?

Original source