How to get only file name in 'for' batch command and not file extension
问题 When using this code to upload video's to YouTube, the title that gets named has the file extension at the end (in this case .mp4) for %%f in (*.mp4) do python --file="%%f" --title="%%f" 回答1: use for %%f in (*.csv) do echo "%%~nf" for more info do a for /? .. this is the part that you would liek to see In addition, substitution of FOR variable references has been enhanced. You can now use the following optional syntax: %~I - expands %I removing any surrounding quotes (") %~fI - expands %I to