Windows 11 Batch Script Adding a Period (.) to File Name

  • Thread starter Thread starter vRah
  • Start date Start date
V

vRah

Hi, I am testing a script to find the last file within a folder.It can locate the correct file, but the resulting variable includes a period (.) within the file name.Here's the script:REM Copy the recent Friday evening's Diff Backup onto the drive G: My Passport device.@echo onset srcDir=F:\Backup\Differential Backupset destdir=G:\My Passport\Differential Backupcd /d F:\Backup\Differential BackupFOR /f %f IN ('DIR /b /od *.zip') DO @SET last=%fecho The most recently created file is %last%:::echo "%last" ::::eofpauseThis is the Windows Command results:Microsoft Windows [Version 10.0.19045.3448

Continue reading...
 
Back
Top