Suppose I have a batch script that expects a folder path in argument %1. I want to append a file name to the path and use that in a command. Is there a simple w
Since ~f eliminates multiple backslashes, I think this works just as well as the original proposal, and also appears to handle share roots and long paths correctly:
for /F "delims=" %%i in (%~f1\file.ext) do set filename=%%~fi