How to get the path of a file in text -


i have variable

set = %1 

%1 d:\work\temp_h.txt

i want path "d:\work". if use below code can name of path

%%~nxi  

%%~nxi= temp_h.txt. how can path of ? ( d:\work )

%~i expands %i removing surrounding quotes (") %~fi    expands %i qualified path name %~di    expands %i drive letter %~pi    expands %i path %~ni    expands %i file name %~xi    expands %i file extension %~si    expanded path contains short names %~ai    expands %i file attributes of file %~ti    expands %i date/time of file 

these of modifiers can used. in case can use %~dp1


Comments

Popular posts from this blog

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

Android Gson.fromJson error -