When I am using the appcmd.exe for creating a website, I need a physical Path address in the command. How can I create directory when I am running this address:
%systemroot%\system32\inetsrv\AppCmd.exe add site /name:websitename /id:4 /physicalPath:C:\inetpub\wwwroot\example12 /bindings:http/*:80:example.com
On above command, "example12" directory doesn`t exist. And I want when running a command, that directory creating that address Automatically.
I never really used
Appcmd.exe
but it is for manipulating IIS objects not file system objects. So I don't think there is a way to automatically create a directory when using AppCmd.exeIn your batch file just use:
or better use PowerShell cmdlets rather than
AppCmd.exe