I have a BAT file in a directory
D:\dir1\dir2\getpath.bat
when i run the bat with the below code it prints
D:\dir1\dir2\
i want only the path D:\dir1\
The directory structure is not fixed , need the complete directory path other than the current directory in which BAT file resides.
@echo off
SET SUBDIR=%~dp0
ECHO %SUBDIR%
tried using delims in a for loop but it didnt help.
F:\other\bins\own, what should be your output?F:\other\bins\,F:\other\or something else entirely?