MidiToMacro/GetSteamGamesList.sh

21 lines
621 B
Bash

#!/bin/bash
# Define the Steam library path (use double backslashes for Windows paths)
STEAM_LIBRARY_PATH="D:\\SteamLibrary\\steamapps\\common"
# Define the output file
OUTPUT_FILE="game_exe_list.txt"
# Clear the output file if it exists
> "$OUTPUT_FILE"
# Loop through each game directory
for game_dir in "$STEAM_LIBRARY_PATH"/*; do
if [ -d "$game_dir" ]; then
# Find all .exe files (case-insensitive) and print only the filenames exactly as they appear
find "$game_dir" -type f -iname "*.exe" -exec basename {} \; >> "$OUTPUT_FILE"
fi
done
echo "Game executable list saved to $OUTPUT_FILE"