The NEW Build Your Own Arcade Controls

Main => Software Forum => Topic started by: WhereEaglesDare on June 02, 2010, 02:45:35 pm

Title: Need help with a Batch File
Post by: WhereEaglesDare on June 02, 2010, 02:45:35 pm
I need a batch file that when ran will set the drive it is running from to a different drive designator.  I know this is easily done with Share Drives and NETUSE but how about on a USB HDD or a Thumbdrive.

I want to run a small set of roms and a front end from a Thumbdrive or USB HDD for portablity.  My problem is if the drive is set to drive F:\ on my PC that doesn't mean it will be F:\ on my buddy's PC it may be E:\ or G:\.  If that is the case then all the rom paths will be broken.  I need a batch file that will set the drive it is running from to Z:\ or X:\ or something like that.  Any ideas?  Thanks for the help.
Title: Re: Need help with a Batch File
Post by: Thenasty on June 03, 2010, 10:07:53 pm
how about just setting the ROM PATH


ROM PATH= D:\???;E:\???;F:\???;G:\???    etc etc....all the way to Z:\???

So when MAME executes, it will looks thru all those set in ROM path.


I doubt there is such a thing you can do, since once you plug in your TD in another 'puter, it's goin to have diff drive letter.
Title: Re: Need help with a Batch File
Post by: WhereEaglesDare on June 04, 2010, 12:23:33 am
how about just setting the ROM PATH


ROM PATH= D:\???;E:\???;F:\???;G:\???    etc etc....all the way to Z:\???

So when MAME executes, it will looks thru all those set in ROM path.


I doubt there is such a thing you can do, since once you plug in your TD in another 'puter, it's goin to have diff drive letter.

 :o  not a bad idea, i should give it a try.   :applaud:
Title: Re: Need help with a Batch File
Post by: mr_doles on June 05, 2010, 10:25:22 am
I want to run a small set of roms and a front end from a Thumbdrive or USB HDD for portablity. 

Not sure if this may help or not but I have a thumb drive running mame.  What I do now is drag the rom onto the batch file so %1 is the rom that I want to run.  The batch file is in the same folder as the roms to make it easier but with some tweaking of the variables it should be easy.
set mame_drive=%~d0
set mame_path=%mame_drive%\mame
set mame_rom_path=%mame_path%\roms
%mame_drive%
cd %mame_path%
mame.exe %1

%0 gives the full path of the batch file the added ~d just pulls the drive letter.  From there I set some other variables based on that drive.  Finally mame runs with the rom that I dropped on the batch file since %1 is the first argument passed in, ie the rom.

So when I run this at home and drop dkong.zip on the batch file this is what it translates to:
set mame_drive=L:
set mame_path=L:\mame
set mame_rom_path=L:\mame\roms
L:
cd L:\mame
mame.exe L:\mame\roms\dkong.zip