I am so out of touch that I can't even think where to start plus I was never great at this. I will have a fully qualified file name (drive, path & filename) passed to my batch file as %1. The batch file and its parms will be started from a shortcut.
I need to split the string into the path and filename components. The string could include blanks as in C:\Program Files\IZArc\IZArc.exe and it will be enclosed in quotes. Using that as example I need to get C:\Program Files\IZArc in one variable and IZArc.exe in the other. The split is at the last backslash which can be discarded.
The execution environment is win 7 and win 8.
thanks...Bob
get path and filename from a variable
Moderator: DosItHelp
Re: get path and filename from a variable
path = %~dp1
file name = %~nx1
type HELP CALL from the command line for a complete description of all the available modifiers (listed at bottom of help)
file name = %~nx1
type HELP CALL from the command line for a complete description of all the available modifiers (listed at bottom of help)
Re: get path and filename from a variable
That worked well. Thanks for that.
Re: get path and filename from a variable
I felt embarrassed asking the original question in this thread but I haven't hit a keyboard in a long time and just could not see the easy way (which I knew would exist) to the answer. I'm just getting back into it all now. Thanks again.