- 1 year ago
") was unexpected at this time." What am I doing wrong?
The error message "was unexpected at this time." typically occurs in a Windows batch script (.bat
or .cmd
) when there's a problem with the syntax of your script. This error can have multiple causes, but one common reason is related to unmatched parentheses.
For example, if you have code like this:
batchif condition (
echo Condition is true
) else (
echo Condition is false
)
The error message "was unexpected at this time." might occur if there's an issue with the placement of parentheses or if there's a missing closing parenthesis.
To diagnose and fix this issue, you should carefully review your batch script and make sure that all opening and closing parentheses are correctly matched. If you're still having trouble identifying the problem, you can share the relevant part of your batch script, and I can help you pinpoint the issue.