Discussion:
finding the PATH your EXE is in
(too old to reply)
s***@hotmail.com
2006-01-01 19:10:07 UTC
Permalink
Hi,

I have a file.exe and when i load it i can tell it to shell. when Im in
the shell i move the present path c:\testprogram\test.exe to c:\blabla
for example using cd\ - cd\blabla - return.

But when I exit shell back to my text.exe program and then close the
program and then load it again, it loads fine but the path under it is
now at c:\blabla remember, so when Im using DirListBox.Path to exec
stuff within my c:\testprogram\ foler it fails because
'DirListBox.Path' no longer is c:\testprogram but c:\blabla as it
should since i changed the path in the command area, but now I need to
find a way to get vbdos to tell me 'where is the text.exe' after its
run!

'DirListBox.Path' will only give me the path where i last mess'd around
in the shell, I need to know the full path where i exec the test.exe
from.

In VB6.0 you can use App.Path hence it allwasy gives you the App Path!
thats what i need but i need this method in VBDOS

Does anyone follow this and have a method of getting the runing
App.Path? for VBDOS

Thanks,
a***@NOW.AT.arargh.com
2006-01-01 22:58:38 UTC
Permalink
On 1 Jan 2006 11:10:07 -0800, ***@hotmail.com wrote:

<snip>
Post by s***@hotmail.com
Does anyone follow this and have a method of getting the runing
App.Path? for VBDOS
For DOS 3 and later, the procedure is:
Find the PSP.
PSP:02Ch points to the environment block.
Scan thru the environment block for 0x00 0x00 (two nulls in a row)
Skip two bytes, and the next thing should be a null terminated string
which contains the current exe name.

If running in a DOS box under windows, check the environment string
"CMDLINE"
--
ArarghMail601 at [drop the 'http://www.' from ->] http://www.arargh.com
BCET Basic Compiler Page: http://www.arargh.com/basic/index.html

To reply by email, remove the garbage from the reply address.
Ethan Winer
2006-01-02 18:25:26 UTC
Permalink
Post by s***@hotmail.com
In VB6.0 you can use App.Path hence it allwasy gives you the App Path!
thats what i need but i need this method in VBDOS <

Go to my Articles page:

www.ethanwiner.com/articles.html

Then look for ExeName near the bottom of the page.

--Ethan
s***@hotmail.com
2006-01-02 22:46:21 UTC
Permalink
thanks, think i got it anyways, but your loop to spilt the exe form the
path is very useful!

Loading...