April 2016 Entries

  • Some DOS batch tips

    Create a date string for a filename (thanks go to StackOverflow) The below is one long line: for /F “usebackq tokens=1,2 delims=” %%i in (`wmic os get LocalDateTime /VALUE 2^>NULL`) do if ‘.%%i.’==’.LocalDateTime.’ set ldt=%%j You can shorten to yyyymmdd like so: set ldt=%ldt:~0,8% To zip an entire folder structure into a file (with the date in the name) The following is one line long.  It should not wrap c:\tools\7za\7za a \\target\folder\file-%ldt%.zip c:\toBackup\folder\* Invoking VSS (disk shadow) and then working with files from the shadow Disk shadowing involves setting up the...