Software >> OS >> Windows >> Command Line >> How to extract the filename part or extension part of a variable containing filename

var=foo.bar %~nvar = foo %~xvar = bar