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: How to set working-directory in VB?  (Read 2318 times)

0 Members and 1 Guest are viewing this topic.

Carsten Carlos

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 579
  • Last login:June 28, 2014, 05:06:25 am
  • Projects: Centipede extended, Asteroids
    • Carlos' Centipede-extended
How to set working-directory in VB?
« on: March 05, 2003, 05:34:25 pm »
Sorry, might be a bit offtopic, but I just can't find it anywhere how to do it!

My little vb-program can execute MAME when it is located in the same folder, but I just can't find how to set the working-directory so I can keep my program anywhere else!

Somehow I can't find anything in the help-file nor at the web.  :(



Lilwolf

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4945
  • Last login:July 31, 2022, 10:26:34 pm
Re:How to set working-directory in VB?
« Reply #1 on: March 05, 2003, 06:20:55 pm »
I dont know (java programmer)

but have you tried launching
"C:\mame\mame.ext c:\mame\roms\zookeeper.zip"

in java, I can specify the directory to start it in.


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19428
  • Last login:Yesterday at 05:43:19 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:How to set working-directory in VB?
« Reply #2 on: March 05, 2003, 07:13:54 pm »
that won't help.....
Do it like this:

chDrive path
chdir path


btw... fe.donkeyfly.com is the best place for these types of questions.  


SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8188
  • Last login:July 20, 2025, 03:37:24 pm
  • The Bears Still Suck!
Re:How to set working-directory in VB?
« Reply #3 on: March 05, 2003, 07:20:22 pm »
Made sure you you store the current path in a variable before changing path.

myAppPath = CurDir
chDir mamedir
ShellAndWaitA "mame.exe"
chDir = myAppPath


As HC said, goto fe.donkeyfly.com.  I just made you a programmer, you can access the programming sections.
« Last Edit: March 05, 2003, 07:21:48 pm by SirPoonga »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19428
  • Last login:Yesterday at 05:43:19 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:How to set working-directory in VB?
« Reply #4 on: March 05, 2003, 07:37:08 pm »
Umm sirp you haven't had to store the current path since about vb 3.0

The real path to your application is always stored in app.path

It's fixed and thus is unchangable by the user.    

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re:How to set working-directory in VB?
« Reply #5 on: March 05, 2003, 07:47:57 pm »
Is there any point doing the ChDrive / ChDir stuff?  I do it before launching an emu but I can't remember why (I send the whole emulator + rom path too).

Carsten Carlos

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 579
  • Last login:June 28, 2014, 05:06:25 am
  • Projects: Centipede extended, Asteroids
    • Carlos' Centipede-extended
Re:How to set working-directory in VB?
« Reply #6 on: March 06, 2003, 02:05:30 am »
Quote
s HC said, goto fe.donkeyfly.com.  I just made you a programmer, you can access the programming sections.

Thanx, Howie & SirPoonga, great service, I'll see you there! :)



Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19428
  • Last login:Yesterday at 05:43:19 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:How to set working-directory in VB?
« Reply #7 on: March 06, 2003, 02:32:36 pm »
Is there any point doing the ChDrive / ChDir stuff?  I do it before launching an emu but I can't remember why (I send the whole emulator + rom path too).

Yes it sets the working directory for the file you have launched.  Lets say you launch mame.  Now the entire mame exe is loaded into memory as yo run it, so of course it's going to play fine, but when it tries to parse the mame.ini it has no clue where the hell it came from and thus can't find the mame.ini.  

Now if you use the createprocess call to launch a game then it's no biggie as the path to the app is an option you MUST send along with the activation string. In other words it sets the chdir and chdrive for you.