I am using the following code to check for files before renaming, and if not, check for another file to display a message.
SET offline=1
IF EXIST %webroot%\%sitename%\app_offline.htm.scheduled (
call :displayMsg "Taking %sitename% website offline"
:: =================================
REN %webroot%\%sitename%\app_offline.htm.scheduled app_offline.htm
) ELSE (
IF EXIST %webroot%\%sitename%\app_offline.htm (
call :displayMsg "%sitename% website is already offline"
:: =====================================
)
)
But the following is being returned
D:\Company\DeploymentFolder>SET offline=1
) was unexpected at this time.
D:\Company\DeploymentFolder> )
I cannot see a problem with my parenthesis? Can anyone see where I am going wrong?
Replace your
::comments with aREMand it should work.You could use
::but then you need to know the two lines rule of Labels in parenthesis