iiscmdinno-setupvirtual-directoryappcmd

Create Virtual directory in IIS with Inno Setup


Hi I need a help to create a Virtual directory.

I tried use these commands, but none works:

[Run]
Filename: "{cmd}"; parameters: "/C""net %systemroot%\system32\inetsrv\AppCmd add vdir /app.name: """"Default Web Site/"" /path:/SERVER1 /physicalPath:D:\server1 /username:USER /password:PWD"

Filename: "net.exe"; parameters: "%systemroot%\system32\inetsrv\AppCmd add vdir /app.name: """"Default Web Site/"" /path:/SERVER1 /physicalPath:D:\server1 /username:USER /password:PWD"

Filename: "{cmd}"; parameters: "/C""%systemroot%\system32\inetsrv\AppCmd add vdir /app.name: """"Default Web Site/"" /path:/SERVER1 /physicalPath:D:\server1 /username:USER /password:PWD"

Filename: "{cmd}"; parameters: "%systemroot%\system32\inetsrv\AppCmd add vdir /app.name: """"Default Web Site/"" /path:/SERVER1 /physicalPath:D:\server1 /username:USER /password:PWD"

Filename: "cmd.exe"; parameters: "/C "%systemroot%\system32\inetsrv\AppCmd add vdir /app.name: """"Default Web Site/"" /path:/DSERVER /physicalPath:D:\server1 /username:USER /password:PWD""

Filename: "cmd.exe"; parameters: "%systemroot%\system32\inetsrv\AppCmd add vdir /app.name: """"Default Web Site/"" /path:/SERVER1 /physicalPath:D:\server1 /username:USER /password:PWD"

Solution

  • This is the correct syntax:

    [Run]
    FileName: {sys}\inetsrv\appcmd.exe; \
        Parameters: "add vdir /app.name:""Default Web Site/"" /path:/server1/ /physicalPath:D:\server1 /username:USER /password:PWD"
    

    Your attempts didn't work because: