I'm trying to create a portable bat file that can open a ROM inside of an emulator regardless of drive letter.
I could create a shortcut using '"M:\Emulator\melonDS\melonDS.exe" M:\ROMs\Black\black.nds'
, but the letter drive would be randomized depending on what computer I put it into, and I'm not sure how to do this in a batch file.
To remove the emulator from the question, suppose I want to write a batch file that opens a specific text file on a SD card with a random drive letter in Notepad. I could hard-code the path into the batch file:
start "c:\windows\system32" notepad.exe M:\example_file.txt
But this assumes a specific drive letter. How could I make the bat file portable?