Powershell - ROM scanner

Hi all,

The ROM scanner in Lakka currently only looks for .ISO files for PSX ROMs. This is a bit rough for me because only about 5% of my files are .ISO!

So I built this Powershell script to generate a playlist file for me. You’ll need to be using Windows to execute the script.

How to use it: [ol] [li]Open Notepad.[/li][li]Copy and paste the code in.[/li][li]Edit the rom path between the quotes on the first line if needed. /storage/roms/ is the default directory, but I put all my ROMs into separate folders.[/li][li]Save the file as PSX.ps1[/li][li]Place PSX.ps1 into your PSX ROM directory on Lakka via the network share.[/li][li]Right-click the PSX.ps1 file and select ​Run with Powershell.[/li][li]The Sony - PlayStation.lpl​ file will be created. Move it to the Playlists directory.[/li][li]Restart Retroarch.[/li][/ol]

Here’s the code:


$romPath = "/storage/roms/PSX/" #Path to ROM dir. I have mine in subdirectories.


$files = Get-ChildItem ./* -include *.iso,*.bin,*.img,*.mdf
ForEach ($file in $files) {
 $theFile = $file.name #just the filename
 $theName = $file.name -replace ".{4}$" #the filename minus the file extension
    write-output "$romPath$theFile" | out-file "Sony - PlayStation.lpl" -Append -encoding utf8
 write-output $theName | out-file "Sony - PlayStation.lpl" -Append -encoding utf8
 write-output "DETECT" | out-file "Sony - PlayStation.lpl" -Append -encoding utf8
 write-output "DETECT" | out-file "Sony - PlayStation.lpl" -Append -encoding utf8
 write-output "00000000|crc" | out-file "Sony - PlayStation.lpl" -Append -encoding utf8
 write-output "Sony - PlayStation.lpl" | out-file "Sony - PlayStation.lpl" -Append -encoding utf8
}

Looks like there’s a small encoding issue.

Added a workaround :slight_smile:

Thanks. However, the scanner in Retroarch supports bin+cue. You had no bin+cue matching the DAT?

At the time, it wasn’t detecting those formats.

I didn’t even know ISO was supported. O_O I re-obtained all my games in BIN+CUE rips because the ISOs didn’t seem to work.