Created
March 27, 2024 02:22
-
-
Save bigjosh/398d8dfe9e2cc91c13aa9e76da1799d8 to your computer and use it in GitHub Desktop.
Windows batch file to copy files form a voice recorder. See https://wp.josh.com/2023/11/21/how-to-remember-everything-you-have-ever-said-or-heard-forever-starting-tomorrow-for-60/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM Move all of the files from a recently inserted USB drive to a directory on a local hard drive. | |
REM Edit these to set the correct paths for your USB drive and the location where you want the files to end up. | |
set "SRC=J:\RECORD" | |
set "DST=D:\Users\josh\Documents\OrsonEar" | |
REM This should be set up inside Task Schedualer to run on the follwoing event: | |
REM Log : Microsoft-Windows-DeviceSetupManager/Admin | |
REM Source : DeviceSetupManager | |
REM Event ID : 112 | |
REM See https://std.rocks/windows_event_on_usb.htm | |
:: Get the current date in YYYY-MM-DD format | |
for /f "tokens=2 delims==" %%i in ('wmic os get localdatetime /value') do set datetime=%%i | |
set "YEAR=%datetime:~0,4%" | |
set "MONTH=%datetime:~4,2%" | |
set "DAY=%datetime:~6,2%" | |
set "CURRENT_DATE=%YEAR%-%MONTH%-%DAY%" | |
:: Define the destination directory with the current date | |
set "DEST_DIR=%DST%\%CURRENT_DATE%" | |
:: Check if the destination directory exists, if not create it | |
if not exist "%DEST_DIR%\" mkdir "%DEST_DIR%" | |
:: Move all files from the source directory to the destination directory | |
move "%SRC%\*" "%DEST_DIR%\" | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment