Web banner featuring the bridge from Monet's Water Lilies with the text 'My virtual desk' written on it

Desktop Scripts

A collection of free Windows .bat scripts I've built up for repetitive media tasks — convert iPhone HDR footage to normal video, batch convert images to WebP, remove backgrounds with AI, strip EXIF metadata, compress video to a target size, and more. Download a script, drop files onto it, done. No terminal, no installer, no subscription.

Prerequisites

Quick Start

  1. Install prereqs
  2. Download .bat
  3. Drag & drop files

Audio & Video

iPhone HDR to Normal Video

hdr-to-sdr.bat Needs: FFmpeg

Converts iPhone HDR video to a normal, standard video file that looks correct on every screen and imports cleanly into any video editor. Output is a .mov file.

e.g. Batch-convert a folder of iPhone clips before dropping them into Premiere, DaVinci Resolve, or iMovie.
Logic: iPhones record in HDR by default, which can look washed out or blown out on standard screens and in most editors. This script runs the footage through FFmpeg's tone-mapping to bring brightness and colour into the normal range everyone expects. Output is a .mov file with the _sdr suffix.

Concatenate Audio

concat-audio.bat Needs: FFmpeg

Joins multiple audio files into a single MP3, in the order they were dropped onto the script.

e.g. Merge three interview segments into one final episode.
Logic: All dropped file paths are written to a temporary list, then passed to FFmpeg's concat demuxer. The merged stream is re-encoded to MP3 at 192 kbps.

Convert to MP3

to-mp3.bat Needs: FFmpeg

Converts any audio or video file to high-quality MP3 (VBR ~190 kbps). Skips files already in MP3 format.

e.g. Convert video lectures to MP3 for audio-only playback.
Logic: Checks extension; skips if already .mp3. Runs FFmpeg with -q:a 2 (VBR quality level 2, ~190 kbps).

Convert to MP4

to-mp4.bat Needs: FFmpeg

Re-encodes video to H.264 MP4 at high quality with web-optimised faststart. Skips existing MP4s.

e.g. Convert a ProRes export into a shareable, web-streamable MP4.
Logic: Uses libx264 at CRF 18 (visually lossless quality). Audio is AAC at 192 kbps. Faststart flag moves metadata to the front so the video can start playing before it finishes downloading.

Compress Video

vid-compress.bat Needs: FFmpeg

Iteratively compresses video to a ~60 MB target, scaling resolution if needed. Saves as *_small.mp4.

e.g. Shrink a 400 MB screen recording to under 60 MB for email.
Logic: Calculates initial quality based on the file's duration. Scales down to max 1080p if needed. Re-encodes repeatedly with lower quality until the file lands under 60 MB.

Video to GIF

vid-to-gif.bat Needs: FFmpeg

Converts a short video clip to an optimised animated GIF at 15 fps and max 640 px wide.

e.g. Turn a 10-second UI interaction into a GIF for a README.
Logic: Two-pass encoding: first pass analyses the video and builds an optimal colour palette; second pass uses that palette to produce a clean, low-banding GIF.

Image Conversion

Convert to JPG

to-jpg.bat Needs: ImageMagick

Converts any image to JPG at 100% quality, stripping EXIF metadata. Skips existing JPGs.

e.g. Convert a batch of PNG design exports to JPG for web.
Logic: Calls ImageMagick with -quality 100 and -strip to remove EXIF. Skips existing JPGs.

Convert to PNG

to-png.bat Needs: ImageMagick

Converts any image to lossless PNG with transparency support. Skips existing PNGs.

e.g. Convert JPG screenshots to PNG for documentation.
Logic: Passes source through ImageMagick's PNG encoder with default lossless compression.

Convert to WebP

to-webp.bat Needs: FFmpeg

Converts images to WebP at 90% quality for excellent web compression. Skips existing WebPs.

e.g. Convert product photos to WebP before deployment.
Logic: Uses FFmpeg's image2 demuxer and libwebp encoder with -quality 90.

Convert to Small WebP

to-webp-sm.bat Needs: FFmpeg

Converts images to WebP and scales down to a max of 700 px wide. Adds a -sm suffix.

e.g. Batch-resize and convert photos to WebP thumbnails.
Logic: Uses scale=700:-1 filter to cap width while preserving aspect ratio.

Resize to 64×64

to-64x64.bat Needs: FFmpeg

Resizes any image to exactly 64×64 pixels as an RGBA PNG. Adds a _64x64 suffix.

e.g. Batch-convert illustrations to 64×64 PNG sprites.
Logic: Uses scale=64:64 with nearest-neighbour algorithm for pixel-perfect results.

Convert to Black & White

to-bw.bat Needs: ImageMagick

Desaturates images to greyscale while keeping the original file format.

e.g. Convert a set of portrait photos to B&W for a layout.
Logic: Applies ImageMagick's -colorspace Gray conversion. Keeps original extension.

Image Enhancement

Optimise for Web

img-optim.bat Needs: ImageMagick

Iteratively reduces quality until the file is under 200 KB. Max 1920 px tall.

e.g. Prepare high-res photos for Webflow or WordPress.
Logic: Drops quality iteratively down to 10 until under 200 KB. Caps height at 1920 px.

Strip EXIF

img-strip.bat Needs: ExifTool + ImageMagick

Strips all EXIF metadata and renames the file to a random 12-character string.

e.g. Anonymise photos before posting to a public forum.
Logic: ExifTool removes all tags. ImageMagick re-saves at quality 82 (max 2048px).

4K Blurred Background

img-4k-bg.bat Needs: ImageMagick

Creates a 3840×3840 square image with original centred on a blurred version.

e.g. Turn a portrait photo into a square post with a blurred backdrop.
Logic: Resizes to fill 3840, applies Gaussian blur, and overlays original centred on top.

Trim PNG Whitespace

trim-png.bat Needs: ImageMagick

Removes uniform border whitespace or transparency from PNG files using -trim.

e.g. Remove transparent padding around exported Figma icons.
Logic: Runs -trim to detect and remove borders, then +repage to reset canvas.

Generate Favicon

to-favicon.bat Needs: ImageMagick

Generates a 64×64 pixel .ico favicon from any image.

e.g. Turn a high-resolution logo PNG into a browser favicon.
Logic: Resizes to fit within 64×64 on transparent canvas. Saves as ICO.

AI Tools

Remove Background

remove-bg.bat Needs: InSPyReNet

Removes image backgrounds using an AI segmentation model. Outputs transparent PNG.

e.g. Cut product photos from their backgrounds for a white backdrop.
Note: Edit line 5 of the script to point to your Python venv before use.
Logic: Calls transparent-background with --type rgba via a Python virtual environment.

Documents

Convert to Markdown

to-md.bat Needs: Pandoc

Converts Word docs, HTML, EPUB, and more to clean Markdown.

e.g. Convert a Word doc brief into Markdown for a static site.
Logic: Runs Pandoc with --wrap=none to prevent unwanted line breaks.

Compression

Folder to ZIP

dir-to-zip.bat Needs: PowerShell

Compresses each dropped folder to a ZIP archive using built-in PowerShell.

e.g. Zip a project folder before uploading to cloud storage.
Logic: Uses PowerShell's Compress-Archive with -CompressionLevel Optimal.

Folder to 7Z

dir-to-7z.bat Needs: 7-Zip

Compresses folders to 7Z format with medium compression.

e.g. Archive large asset folders for long-term storage.
Logic: Runs 7-Zip with -mx=5. Detects 7z.exe in common locations.

File Utilities

Find Duplicate Files

file-dedup.bat Needs: Windows

Computes SHA-256 hashes and reports any exact duplicates.

e.g. Find which photos are duplicates saved under different names.
Logic: Uses certutil to compute SHA-256 and groups by identical value.

Network & System

Flush DNS Cache

flush-dns.bat Needs: Windows

Clears the Windows DNS resolver cache. Requires admin.

e.g. Force Windows to pick up new DNS records immediately.
Logic: Executes ipconfig /flushdns after checking for admin rights.

Restart WinNAT

restart-winnat.bat Needs: Windows

Stops and restarts the Windows NAT service. Requires admin.

e.g. Fix WSL2 networking after a 'port already in use' error.
Logic: Runs 'net stop winnat' and 'net start winnat'.