Useful things

Batch –

%~1 – expands %1 removing any surrounding quotes (“)
%~f1 – expands %1 to a fully qualified path name
%~d1 – expands %1 to a drive letter only
%~p1 – expands %1 to a path only
%~n1 – expands %1 to a file name only
%~x1 – expands %1 to a file extension only
%~s1 – expanded path contains short names only
%~a1 – expands %1 to file attributes
%~t1 – expands %1 to date/time of file
%~z1 – expands %1 to size of file

Powershell

Get file version and full file name

$files = Get-ChildItem DIR | ForEach-Object {$_.VersionInfo}

$files | Select-Object filename,fileversion