Console Macro Automation

How to Write .txt Batch Scripts (bat) to Automate PC Developer Console Commands

Re-typing twelve separate ship-builder GameSettings, screenshot camera commands, or sequential perk ranks every session invites typos. Creation Engine games support native plain-text macro files executed via a single 2-word console command: bat <filename>.

Tested build / patch
Skyrim SE/AE, Fallout 4 (1.10.984) & Starfield (1.14+)
Platforms verified
Windows PC & Steam Deck (Proton)
Trophy / achievement flag
Inherits Underlying Command Rules of Target Game
Save-file safety
100% Safe When Commented & Saved as UTF-8 Without BOM

Where .txt Batch Files Must Live on Disk

The number-one mistake players make is placing console batch scripts inside Documents\My Games\... or inside the Data\ subfolder. Creation Engine’s bat command resolves paths strictly relative to the **root game installation folder where the main .exe (SkyrimSE.exe, Fallout4.exe, Starfield.exe) sits**!

TWO HIDDEN WINDOWS TRAPS THAT BREAK "bat" CONSOLE SCRIPTS TRAP 1: Hidden Double Extension photo.txt.txt ← File not found! Enable "File name extensions" in Explorer! TRAP 2: UTF-8 BOM Byte Prefix 0xEFBBBF + tfc 1 ← Line 1 fails! Save as ANSI or UTF-8 (Without BOM)!
Figure 1: If Line 1 of your batch script always throws "Script command not found" while Lines 2–10 succeed, your text editor inserted an invisible UTF-8 Byte Order Mark!

Three Practical, Ready-to-Use .txt Macro Templates

Use semicolons (;) at the start of a line to write human-readable comments—the console parser ignores any line prefixed with ; (and keeping Line 1 as a ; comment also shields your first real command from any accidental UTF-8 BOM header!):

Template 1: photo.txt — Clean Virtual Photography Setup (Skyrim / Fallout 4)

Line in photo.txt What Each Line Executes
; Virtual Photography Macro — Run 'bat photo' in consoleSafe comment header absorbing any encoding prefix
sucsm 3Slows free-camera fly speed down to smooth cinematic 3 (default 10 is toojerky)
fov 65Narrows lens focal length to flattering 65-degree portrait framing
tfc 1Detaches free camera AND freezes world animations mid-action

Template 2: craftbench.txt — Fallout 4 Settlement Resource Kit

Line in craftbench.txt What Each Line Executes
; Settlement Prototyping Kit — Run 'bat craftbench'Header comment
player.additem 0006907C 500Adds 500 Adhesive
player.additem 0006907A 500Adds 500 Aluminum
player.additem 0006907E 500Adds 500 Copper
player.additem 00069085 500Adds 500 Glass
player.additem 000731A3 1000Adds 1,000 Wood
player.additem 000731A4 1000Adds 1,000 Steel

Template 3: Auto-Executing a Batch Script on Game Launch (Custom.ini)

In Starfield and Fallout 4, volatile SetGS settings (such as oversized ship-builder bounds) reset every time you quit to Windows. You can tell the engine to run bat shipbounds automatically at startup by adding one line under [General] inside Documents\My Games\Starfield\StarfieldCustom.ini:

[General]
sStartingConsoleCommand=bat shipbounds

Warning Before Setting sStartingConsoleCommand Only place global engine settings (SetGS, camera speeds sucsm) inside a startup batch file—never put player.additem inside sStartingConsoleCommand, because sStartingConsoleCommand executes at the Main Menu before a player character RefID is loaded in memory, which can crash or misfire!

Pair batch macros with our Skyrim Hex FormID Builder, troubleshoot unopened overlays in Why the Tilde (~) Key Fails, or explore the Mechanics & Save Safety Hub.

Frequently Asked Questions

Why does the console say "Batch file could not be found" when photo.txt is right in my game folder?

Open Windows File Explorer, click View -> Show -> check "File name extensions." Windows Notepad automatically appends .txt, naming your file photo.txt.txt! Rename it to single-extension photo.txt and run bat photo (without typing .txt in the console).

Can I chain multiple commands on a single sStartingConsoleCommand line without a .txt file?

Yes! Separate lightweight startup commands with semicolons directly on one line: sStartingConsoleCommand=sucsm 4;fov 85.

Do .txt batch files work on Steam Deck?

Yes—place the lowercase .txt file inside ~/.local/share/Steam/steamapps/common// alongside the game .exe (keep filenames strictly lowercase on Linux ext4 case-sensitive filesystems!).