msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

finding the PATH your EXE is in

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB DOS
Author Message
signrite



Joined: 04 Oct 2007
Posts: 9

PostPosted: Sun Jan 01, 2006 4:10 pm    Post subject: finding the PATH your EXE is in Reply with quote

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,

Archived from group: microsoft>public>vb>dos
Back to top
View user's profile Send private message
ararghmail601NOSPAM



Joined: 04 Oct 2007
Posts: 2

PostPosted: Sun Jan 01, 2006 9:58 pm    Post subject: Re: finding the PATH your EXE is in Reply with quote

On 1 Jan 2006 11:10:07 -0800, signrite@hotmail.com wrote:


>
>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.
Back to top
View user's profile Send private message
Ethan Winer



Joined: 04 Oct 2007
Posts: 30

PostPosted: Mon Jan 02, 2006 6:25 pm    Post subject: Re: finding the PATH your EXE is in Reply with quote

> 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
Back to top
View user's profile Send private message
signrite



Joined: 04 Oct 2007
Posts: 9

PostPosted: Mon Jan 02, 2006 7:46 pm    Post subject: Re: finding the PATH your EXE is in Reply with quote

thanks, think i got it anyways, but your loop to spilt the exe form the
path is very useful!

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    msvisual.com Forum Index -> VB DOS All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group