RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Quick Powershell Script to update Roms from PC to RP

    Scheduled Pinned Locked Moved General Discussion and Gaming
    powershellupdate filescopy files
    2 Posts 1 Posters 304 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Q
      qbie
      last edited by qbie

      Hi All,

      This is just something I threw together quickly that I thought some others might find useful.

      My use case: I have a full set of FBA roms on my PC, however I only use a limited subset of these on my pi. I've just updated to the latest version of FBA and updated the romset on the PC, however I don't need to copy them all onto my pi.

      The script gets a list of all the zip files from the \\retropie\roms\fba folder, and then for each one copies the latest version from the source directory on the PC. Obviously there may be the odd occasion where the .zip file I've copied across from my PC no longer works, for example if I also need to copy across a new parent, but I can deal with those on a case by case basis. This will get the majority of them working ok :)

      You can change the file paths below to whatever you like, if you want to update a limited set of MAME roms for example.

      #Set the Source Directory
      $sourcedir = "D:\Emulators\roms\Final Burn Alpha"
      
      # Fetch a list of all items in the destination folder, and for each one copy a new version from the source
      Get-ChildItem "\\retropie\roms\fba" -Filter *.zip | 
      Foreach-Object {
          $filename = $_.Name
          Write-Host "Copying $filename from $sourcedir to Retropie"
          Copy-Item $sourcedir\$filename -Destination \\retropie\roms\fba
          }
      
      1 Reply Last reply Reply Quote 0
      • Q
        qbie
        last edited by

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

        Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.