- Mar 22, 2020
- 4,880
- 11,574
- 698
Is this helpful?I don't quite understand what you mean. If the question is about the possibility of processing parentheses with a script without crashes, then I will disappoint, I spent a lot of time on this question, but I could not solve it. Only if someone else finds the right solution that can be applied to the current implementation.
Code:
@echo off
set "dir=%cd%"
rem Check if parenthesis is present in the directory name
for /f "tokens=2 delims=()" %%a in ("%dir%") do (
echo Error: Parenthesis not allowed in directory name
exit /b 1
)
echo Success: No parenthesis found in directory name
exit /b 0