Skip to content

Instantly share code, notes, and snippets.

@rwv
Created May 22, 2019 06:35
Show Gist options
  • Save rwv/018e9e3ea99e8b50f8c13271d42ada41 to your computer and use it in GitHub Desktop.
Save rwv/018e9e3ea99e8b50f8c13271d42ada41 to your computer and use it in GitHub Desktop.
Get the latest file in directory
set dir_path=.\
for /f "delims=" %%i in ('dir /b/a-d/od/t:c %dir_path%') do set filename=%%i
echo the latest file: %filename%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment