• About
  • Reel
    • Respawn
    • Relic Entertainment
    • Sony Santa Monica
    • EA Tiburon
    • FIEA
  • Side Projects
  • Contact
  • Stickless
Menu

Aaron Cendan

Technical Audio Designer
  • About
  • Reel
  • Experience
    • Respawn
    • Relic Entertainment
    • Sony Santa Monica
    • EA Tiburon
    • FIEA
  • Side Projects
  • Contact
  • Stickless
×
Batch.png

Batch Files Are Underrated

Guest User December 22, 2020

It’s The Little Things

Sometimes the smallest workflow snags are the ones that will make you pull your hair out when encountered dozens of times a day. For instance, in Windows, if you want to copy paste the filenames of the items you have selected in the file explorer, you have two options:

  1. Shift + Right Click -> Copy As Path. This will copy a list of the selected items with quotes on either side and the entire file path of each individual file. To trim the fat off each item would require additional processing, whether done in something like Excel or find & replace in a text editor.

  2. Open a separate file management application like Bulk Rename Utility and copy multiple filenames in the right click context menu there.

There is no way around it: both of these solutions are gross and require just enough extra work to be mind numbing when done all the time.

Copy Multiple.gif

The Case for Batch

Batch files (.bat) contain text that gets executed on the Windows command line. While the command line may seem pretty rigid and inflexible at first, batch scripting actually allows for rather extensive programming: from basic if statements and for loops to multi-dimensional arrays and switch cases.

Let’s take a look at the batch script here! This script allows you to copy the selected files’ names in the Windows File Explorer via the right click context as seen in the gif above. It works by doing the following:

  • Instantiating a new, empty variable called “var”

  • Looping through the selected files in the file explorer

  • Appending the filenames for each selected file, with a new empty line between items, to “var”

  • Copying “var” to the clipboard

Wrap Up

Copy Filenames Batch Files

While this isn’t a particularly complicated case, it opens the doors for much more comprehensive scripting through the command prompt. In the future, I may make posts on integrating batch files with Reaper, using ReaScript to call batch files for tasks like pushing and pulling with a Git repository. You can directly download my two batch files for filename copying via the button here. Simply extract the zip and place both files in the SendTo menu as detailed in the comments at the top of the files. Enjoy!

In Programming Tags Batch, Workflow, Tools
← Making Another Reaper Controller!Learning Through Refactoring →

Featured Posts

Featured
The Last Renamer
Programming
Reaper, ReaScript, Tools
The Last Renamer
Programming
Reaper, ReaScript, Tools
Programming
Reaper, ReaScript, Tools
Synchronizing REAPER Installs Across Computers
Programming, Sound Design
Reaper, Syncthing, Backups
Synchronizing REAPER Installs Across Computers
Programming, Sound Design
Reaper, Syncthing, Backups
Programming, Sound Design
Reaper, Syncthing, Backups
First Time Recording Firearms
Field Recording
Field Recording, Guns, Firearms
First Time Recording Firearms
Field Recording
Field Recording, Guns, Firearms
Field Recording
Field Recording, Guns, Firearms
UCS Renaming Tool
Programming
ReaScript, Javascript, Lua, HTML, Reaper
UCS Renaming Tool
Programming
ReaScript, Javascript, Lua, HTML, Reaper
Programming
ReaScript, Javascript, Lua, HTML, Reaper

View All Posts