Program Name & PATH 
Author Message
 Program Name & PATH

I know there must be a way to establish the directory from which a
program was launched, but I can't for the life of me figure it out.

Any suggestions ?

Eoin Bairad
Dublin
Ireland



Mon, 06 Oct 1997 03:00:00 GMT  
 Program Name & PATH

Quote:

>   I know there must be a way to establish the directory from which a
>   program was launched, but I can't for the life of me figure it out.

LaunchDir = App.Path

--
Adina Adler            

My opinions, and        
nothing but            



Mon, 06 Oct 1997 03:00:00 GMT  
 Program Name & PATH

Quote:


>Subject: Program Name & PATH
>Date: 20 Apr 1995 17:56:27 GMT
>I know there must be a way to establish the directory from which a
>program was launched, but I can't for the life of me figure it out.
>Any suggestions ?

Hi Eoin
Search on-line help for the app object.

------------------------------------------------------------------------
Chuck Stuart - Mesquite TX USA  
VBTrace 2.00 is a runtime Procedure Trace, XRef,
Debug, Profiler and much more. Shareware $49.
http://www.apexsc.com/vb/ftp/coop/cstuart
ftp.apexsc.com/pub/cgvb/coop/cstuart
------------------------------------------------------------------------



Mon, 06 Oct 1997 03:00:00 GMT  
 Program Name & PATH

Quote:

>I know there must be a way to establish the directory from which a
>program was launched, but I can't for the life of me figure it out.
>Any suggestions ?
>Eoin Bairad
>Dublin
>Ireland

BaseDir$ = App.Path

This will only work in the IDE after you have saved the .MAK file.  In the IDE
it returns the path to the .MAK file.  In the .EXE it returns the path the
.EXE was started from.

Amazing how simple it is, but it dosn't seem to be mentioned very often.

Regards,

Jon



Tue, 07 Oct 1997 03:00:00 GMT  
 Program Name & PATH

Quote:
> I know there must be a way to establish the directory from which a
> program was launched, but I can't for the life of me figure it out.
> Eoin Bair=E9ad

App.Path

-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=
=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-
Kevin McCracken

-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=
=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-



Tue, 07 Oct 1997 03:00:00 GMT  
 Program Name & PATH

Quote:

>I know there must be a way to establish the directory from which a
>program was launched, but I can't for the life of me figure it out.

>Any suggestions ?

>Eoin Bairad
>Dublin
>Ireland

Right, but you owe me a beer.

To find the directory from which it was launched:

TheDirectory$ = app.path

To find its name:

TheName$ = app.exename

Hey, check out some of my programs from my Web Page. It is at
http://infomatch.com/~townsend/drc.html

There are some nifty programs you can get off the page. Have fun!

TTFN Jimi



Wed, 08 Oct 1997 03:00:00 GMT  
 Program Name & PATH
Try App.Path

RYFM



Wed, 08 Oct 1997 03:00:00 GMT  
 Program Name & PATH

Quote:

>Path:
>news.hol.gr!news-ath.forthnet.gr!news.forth.gr!news.ecrc.de!news.sprintlink.net!
>howland.reston.ans.net!Germany.EU.net!ieunet!login.Ieunet.ie!ebairead

>Newsgroups: comp.lang.basic.visual.misc
>Subject: Program Name & PATH
>Date: 20 Apr 1995 17:56:27 GMT
>Organization: Ieunet Limited
>Lines: 8

>NNTP-Posting-Host: login.ieunet.ie
>X-Newsreader: TIN [version 1.2 PL2]
>I know there must be a way to establish the directory from which a
>program was launched, but I can't for the life of me figure it out.
>Any suggestions ?
>Eoin Bairad
>Dublin
>Ireland

If you mean YOUR program (where it was launched from) then in your main form
add the following code (in form_load):
Static already as integer
Dim loadpath As String
If already = 0 Then
already = 1
loadpath = CurDir$
If Right$(loadpath, 1) <> "\" Then loadpath = loadpath + "\"
End If


Tue, 14 Oct 1997 03:00:00 GMT  
 Program Name & PATH

|> >I know there must be a way to establish the directory from which a
|> >program was launched, but I can't for the life of me figure it out.

|> If you mean YOUR program (where it was launched from) then in your main form
|> add the following code (in form_load):

Ajaj... What happened with app.Path and app.EXEName ?

Take care,
Sabina



Tue, 14 Oct 1997 03:00:00 GMT  
 Program Name & PATH

Quote:

>> >I know there must be a way to establish the directory from which a
>> >program was launched, but I can't for the life of me figure it out.

>> >Any suggestions ?

>> If you mean YOUR program (where it was launched from) then in your main

form >> add the following code (in form_load):

Quote:
>> Static already as integer
>> Dim loadpath As String
>> If already = 0 Then
>> already = 1
>> loadpath = CurDir$
>> If Right$(loadpath, 1) <> "\" Then loadpath = loadpath + "\"
>> End If

>I thought it was app.path

It is.  CurDir$ returns the current directory, which is usually C:\WINDOWS.
App.Path returns the directory the program was run from.

Regards,
Jon



Wed, 15 Oct 1997 03:00:00 GMT  
 Program Name & PATH

writes:

Quote:

> >I know there must be a way to establish the directory from which a
> >program was launched, but I can't for the life of me figure it out.

> >Any suggestions ?

> >Eoin Bair?ad
> >Dublin
> >Ireland
> If you mean YOUR program (where it was launched from) then in your main form
> add the following code (in form_load):
> Static already as integer
> Dim loadpath As String
> If already = 0 Then
> already = 1
> loadpath = CurDir$
> If Right$(loadpath, 1) <> "\" Then loadpath = loadpath + "\"
> End If

I thought it was app.path

88         db         888b      88  
88        d88b        8888b     88  Ian Lynagh

88      d8'  `8b      88  `8b   88  
88     d8YaaaaY8b     88   `8b  88  Author of EdWin, a text editor.
88    d8""""""""8b    88    `8b 88  Get EW005.WRI on ftp.demon.co.uk
88   d8'        `8b   88     `8888  in /pub/ibmpc/windows/edwin
88  d8'          `8b  88      `888  



Wed, 15 Oct 1997 03:00:00 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. Reading Path & File name as variable

2. Display Dialog to find file name & path

3. Setting FileListBox.Path and Naming New Program Items

4. File name & path from Save As dialog

5. How do I find program name and path ?

6. App.Path only returning short path name - Why?

7. app.path only returns short path name

8. Long Path Names give Runtime error 76 - Path not found

9. ? How do you change a path to a dos path name

10. App.Path returns "short" path name

11. Best method of determining path, relative path and/or flie name

12. Computer Name, Exe Name, and Exe Path

 

 
Powered by phpBB® Forum Software