Because the bat file needs to execute a certain file in the same directory, but the location of the bat file is uncertain. Originally written like this:
SET CurPath=%0
IF NOT "%CurPath%"=="" set CurPath=%CurPath:~0,-9%
echo %CurPath%
But sometimes it is correct when executed, and sometimes the result is wrong. Either there is one more character before and after, or one less character.
Who can help, thank you very much
SET CurPath=%0
IF NOT "%CurPath%"=="" set CurPath=%CurPath:~0,-9%
echo %CurPath%
But sometimes it is correct when executed, and sometimes the result is wrong. Either there is one more character before and after, or one less character.
Who can help, thank you very much
