Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Need help with a Batch File  (Read 1419 times)

0 Members and 1 Guest are viewing this topic.

WhereEaglesDare

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1536
  • Last login:March 24, 2014, 08:47:08 pm
  • Shut Off All The Compactors on the Detention Level
    • My HomePage
Need help with a Batch File
« 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.

Thenasty

  • Trade Count: (+17)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4419
  • Last login:Yesterday at 12:38:33 pm
    • Thenasty's Arcademania Horizontal/Vertical monitor setup.
Re: Need help with a Batch File
« Reply #1 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.
Thenasty's Arcademania Horizontal/Vertical setup.
http://forum.arcadecontrols.com/index.php?topic=26696.0

Free VGA Breakout Cable
http://forum.arcadecontrols.com/index.php?topic=38228.0

Ultimate All in One Coin Mech write up (Make your own)
http://forum.arcadecontrols.com/index.php?topic=19200.0

WhereEaglesDare

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1536
  • Last login:March 24, 2014, 08:47:08 pm
  • Shut Off All The Compactors on the Detention Level
    • My HomePage
Re: Need help with a Batch File
« Reply #2 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:

mr_doles

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 236
  • Last login:November 13, 2014, 06:53:45 pm
  • nuff said
Re: Need help with a Batch File
« Reply #3 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