Reputation: 59168
I would like to parse the folder name and file name from passed argument. Example:
my.bat c:\windows\test.txt
I want those to be stored as follows:
FILE_NAME=test.txt
FILE_FOLDER=c:\windows\
How can I do this?
I found this but it only gets the filename.
Upvotes: 1
Views: 2498
Reputation: 82247
You could read the help with FOR /?
or How to get folder path from file path with CMD
set "FILE_NAME=%~nx1"
set "FILE_FOLDER=%~dp1"
Upvotes: 6