Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Executing files from WITHIN the project folder

Author
Message
Satchmo
21
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 3rd Jun 2007 14:55 Edited at: 3rd Jun 2007 14:56
Hello everybody!
Whenever I see the execute file command being used it goes from the start of a directory like c:/ program files. What I want is to have it execute a file included within the game folder so it executes that but the folder can be anywhere and not an exact place.Is there any way to do it?

yes I did search

I like my sig.
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 3rd Jun 2007 17:26
At the start of your program use:

StartDir$ = Get Dir$()+"\"

When you want to execute your external program use:

Execute File StartDir$+"Filename.exe"

You can also use StartDir$+"InsertFolderNameHere" to directly access any folders you have in your main project directory - rather than using CD to go into them to read data files.

TDK_Man

Satchmo
21
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 3rd Jun 2007 17:59
Ok I will try that, thanks tdk.

I like my sig.
Satchmo
21
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 3rd Jun 2007 18:12
I cant get it to work, I put my directory after the "\"
and also put my file name, nothing worked.

I like my sig.
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 4th Jun 2007 00:19
Please copy the line here exactly as you put it in your program.

TDK_Man

Login to post a reply

Server time is: 2026-07-06 06:44:25
Your offset time is: 2026-07-06 06:44:25