$file = Get-ChildItem "C:\some path\having spaces.txt"
Write-Output $file.DirectoryName
Write-Output $file.Name
Write-Output $file.BaseName
Or if that's still to verbose: $file = gci "C:\some path\having spaces.txt"
echo $file.DirectoryName
echo $file.Name
echo $file.BaseName
People should really get over their aversion against powershell.
It really pains me to be that cynical, because I do find their products incredibly fascinating and inventive. But for anything but their lowest-end toy products the design aspirations - and boutique price tag - clash hard with the reality of their quality track record.