Category Archives: knowledgebase

Windows command line tricks

Just a quick one, since I just discovered this. (Apparently I’m slow!)

You all probably know, in a windows batch file, you can do something like this:

@echo off
echo first %1
echo second %2
echo rest %*

which will give you:

c:\>test.cmd john paul ringo george
first john
second paul
rest ringo george

but if you use these modifiers you can save a lot of dodgy text work:

@echo off
echo %~n1
echo %~p1
echo %~x1

which will give you (assuming the file actually exists):

c:\>test.cmd c:\Users\Ringo\BeatlesSongs.txt

BeatlesSongs
\Users\Ringo\
.txt

You can get some more parameters by typing FOR /? or CALL /? at the command line

Mirror video with ffmpeg

I had a video of a group that I wanted to learn the moves of, but the video was taken from the front, and my brain doesn’t cope with mirroring in my head that quick, so I thought I would mirror the video file.

Thankfully I already had everything I needed – the video file and ffmpeg.

Kind of simple when you know how:

>ffmpeg -i orig.avi -vf "hflip" flipped.avi

Then I just needed to put the flipped file back into my Movies folder for Plex to pick up, et voila I was moving with the best of them!