Skip to content

Instantly share code, notes, and snippets.

@dmertl
Last active May 18, 2024 18:03
Show Gist options
  • Save dmertl/c52cf1810fa4dde76c39b9e1a620c419 to your computer and use it in GitHub Desktop.
Save dmertl/c52cf1810fa4dde76c39b9e1a620c419 to your computer and use it in GitHub Desktop.
Windows Cheatsheet

Batch File Droppable

Batch file that you can drag and drop multiple files onto and execute commands. Loops through all files, calls ffmpeg with file as input, and file with "_clip" inserted before the extension.

:again
  if "%~1" == "" GOTO done
    D:\Applications\ffmpeg\bin\ffmpeg.exe -i "%~1" -t 00:00:30 "%~n1_clip%~x1"
  SHIFT
GOTO again
:done

Use @pause to keep cmd open after the script executes.

%

https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-xp/bb490909(v=technet.10)

%~I Removes any surrounding quotation marks ("").

%~fI Fully qualified path name.

%~dI Drive letter only.

%~pI Path only.

%~nI File name only.

%~xI File extension only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment