Quickly script out file extension at command line

sFile = wscript.arguments(0)

set oFile = CreateObject("Scripting.FileSystemObject")'.GetFile(sFile)

REM wscript.echo oFile.GetParentFolderName(sfile) &   " -> " &   oFile.getextensionname(sFile)

wscript.echo oFile.getextensionname(sFile)

set oFile = nothing


Find Newest file using MSDOS

REM ---------------------------------------------------------------

@echo off
setlocal
for
/f "tokens=*" %%a in ('dir /b /od /a-d %sLocalFolder%') do set latest=%%a >> %sLogFile%
echo Latest File: %latest% >> %sLogFile%
ECHO   Renaming %sLocalFolder%\%latest% %sLocalFolder%\%sLocalFile%   >> %sLogFile%
MOVE /Y %sLocalFolder%\%latest% %sLocalFolder%\%sLocalFile%  >> %sLogFile%
REM ---------------------------------------------------------------

https://stackoverflow.com/questions/16299456/batch-file-that-finds-name-of-latest-file-imports-it

.