I would like to add new bindings to a site using appcmd but I need to see if it exists first. How can I do so using AppCMD?
Much appreciated!
You can create a batch file with the following code :
@ECHO OFF
SET appcmd=CALL %WINDIR%\system32\inetsrv\appcmd
%appcmd% list site /name:"Default Web Site"
IF "%ERRORLEVEL%" EQU "0" (
ECHO EXISTS
REM Add your bindings here
) ELSE (
ECHO NOT EXISTS
)