I'm developing a command line Batch file on Windows 7. I'm trying to add \
to a dir if it hasn't.
This is only a test:
@echo off
set solutionDir=%CD%\
echo %solutionDir%
if [%solutionDir:~-1%] EQU [\] echo ends with \
This line if [%solutionDir:~-1%] EQU [\] echo ends with \
works fine to check if it ends with \
but I want to check if it doesn't end with a \
.
I have tried all of these but in all of them I get a syntax error:
if [%solutionDir:~-1%] NEQ [\] echo ends with \
if NOT [%solutionDir:~-1%]==[\] echo ends with \
if [%solutionDir:~-1%]!=[\] echo ends with \
I'm getting current dir and I want to add it \
if it hasn't it.
How can I do it?
if NOT [%solutionDir:~-1%] EQU [\] echo does not end with \