Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

How To Find Path Of Certain Program /vb6/WinXP

How do I programatically find the pathname of a certain program such as Winword.exe or NotePad.exe?

Thank you,


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How Can I Find The Path And Program From A Link On The Desktop?
Is it possible to work out where a program is from the link on the desktop or links held in the program directory?

Find Program's Hwnd By Its File Path *unresolved!* Help?
As the subject title says, is there a way I can find a running program's hwnd by just knowing its file path?

Edited by - Marce22 on 4/16/2004 9:00:06 PM

Find File Path Of Program Associated With A File
Ok, you know how you can use the following to open a file with its associated program:
Call ShellExecute(0&, vbNullString, "c:asdf.bmp", vbNullString, vbNullString, vbNormalFocus)

How can I return the file path of the program associated with a file? I don't mean open the file with its associated program, I mean only return that program's file path..
"c:asdf.bmp" would be "c:Program FilesAccessoriesmspaint.exe"

Edited by - Marce22 on 6/30/2004 5:43:59 AM

Find The Path, Enter Path Into String
What I want to do is search for a file on a drive and have
the path name entered into a string... for example pth$

Print #2, "C:"
Print #2, "CD"
Print #2, "CD Program*" < Prob 1
Print #2, "CD America's*" < Prob 1
Print #2, "CD System"
Print #2, "CD Save" < Prob 2
Print #2, "CD save" < Prob 2
Print #2, "DIR /A /O:D > C:" & ID$ & "save.LOG"

Also I have the following problems with the code above.
1. There are two directory's that are named "CD America's"
The problem im having is I canot use spaces and have to use a astrix.
2. Case sensitive for going down directories.


Does The Vb6's Program Can Be Used In Winxp?
I want to ask two question

1) Does the vb 6.0 can run on the winxp?
2) Does the vb6's program can be used in winxp?


Program GUI Differences - WinXP - Win2K
I have discovered that when I write programs on Win2k, some of the form items do not appear correctly on WinXP. The same works in reverse. Is there some work around to this? It is frustrating spending so much time to make an app look good, just to install it on a "compatible" operating system and have it look terrible. I have had to adjust things off center in Win2k to make them astectically pleasing on WinXP. I have both machines configured to the same resolution. Anybody have any ideas?

Thank you in advance...

Why My VB6 Program Can't Run In Win2000 Platform, But Run Well In WinXP?
XXX.exe Application Error
The application failed to initialize properly (0xc0000022). Clink on OK to terminate the application.

Any Idea?

Program Does Not Works Correctly On WinXP
hi all
i get this code from internet but it works on win95/98 but on winXP itdoes not bring the dial up connections in the computer so can any onetell me what is the changes that must be done to make this program towork correctly on winXP

note i did not have winXP but my freind have and tried it and told methat no connections appears in the listbox so if any one hax windoes XPplease check it to me and tell me what is the changes reqired

note the program does not cause any erroe message in winXP but theresults are wrong

thanks in advance

Visual Basic Example - Dial

'This program let you dial to your dial-up connections usingwhether
'the stored user name and password or the ones you specifies
'(It use RasDial for dialing)

'You need a form with a list,2 textbox and a command button

Option Explicit
Private Declare Sub CopyMemory Lib "kernel32" Alias"RtlMoveMemory" (pDst As Any, ByVal pSrc As String, ByVal ByteLen AsLong)
Private Declare Sub ZeroMemory Lib "kernel32.dll" Alias"RtlZeroMemory" (Destination As Any, ByVal Length As Long)

Const RAS95_MaxEntryName = 256
Const RAS_MaxPhoneNumber = 128
Const RAS_MaxCallbackNumber = RAS_MaxPhoneNumber

Const UNLEN = 256
Const PWLEN = 256
Const DNLEN = 12
dwSize As Long ' 1052
szEntryName(RAS95_MaxEntryName) As Byte
szPhoneNumber(RAS_MaxPhoneNumber) As Byte
szCallbackNumber(RAS_MaxCallbackNumber) As Byte
szUserName(UNLEN) As Byte
szPassword(PWLEN) As Byte
szDomain(DNLEN) As Byte
End Type

'set dwsize to 264
dwSize As Long
szEntryName(RAS95_MaxEntryName) As Byte
End Type

Private Declare Function RasDial Lib "rasapi32.dll" Alias"RasDialA" (ByVal lprasdialextensions As Long, ByVal lpcstr As String,ByRef lprasdialparamsa As RASDIALPARAMS, ByVal dword As Long, lpvoid AsAny, ByRef lphrasconn As Long) As Long
Private Declare Function RasEnumEntries Lib "rasapi32.dll" Alias"RasEnumEntriesA" (ByVal reserved As String, ByVal lpszPhonebook AsString, lprasentryname As Any, lpcb As Long, lpcEntries As Long) As Long
Private Declare Function RasGetEntryDialParams Lib "rasapi32.dll"Alias "RasGetEntryDialParamsA" (ByVal lpcstr As String, ByReflprasdialparamsa As RASDIALPARAMS, ByRef lpbool As Long) As Long

Private Function Dial(ByVal Connection As String, ByVal UserNameAs String, ByVal Password As String) As Boolean
Dim rp As RASDIALPARAMS, h As Long, resp As Long
rp.dwSize = Len(rp) + 6
ChangeBytes Connection, rp.szEntryName
ChangeBytes "", rp.szPhoneNumber 'Phone number stored for theconnection
ChangeBytes "*", rp.szCallbackNumber 'Callback number storedfor the connection
ChangeBytes UserName, rp.szUserName
ChangeBytes Password, rp.szPassword
ChangeBytes "*", rp.szDomain 'Domain stored for the connection
resp = RasDial(ByVal 0, ByVal 0, rp, 0, ByVal 0, h)'AddressOf RasDialFunc
Dial = (resp = 0)
End Function

Private Function ChangeToStringUni(Bytes() As Byte) As String
'Changes an byte array to a Visual Basic unicode string
Dim temp As String
temp = StrConv(Bytes, vbUnicode)
ChangeToStringUni = Left(temp, InStr(temp, Chr(0)) - 1)
End Function

Private Function ChangeBytes(ByVal str As String, Bytes() As Byte)As Boolean
'Changes a Visual Basic unicode string to an byte array
'Returns True if it truncates str
Dim lenBs As Long 'length of the byte array
Dim lenStr As Long 'length of the string
lenBs = UBound(Bytes) - LBound(Bytes)
lenStr = LenB(StrConv(str, vbFromUnicode))
If lenBs

How Can I Monitor Memory Usage By My Program In WInXP???
Hello every1,
I'm on WinXP with VB 6. I'm making some programs with lots of variables in it. I wanna know how much memory my program variables r taking. Is there a utility in WINXP which may help me to get the required data. I wanna know a quick reply..

Help With Path Of File / Shell Program Path
Currently I am using the shell command to open an application called Kodakprv.Exe. Their are going to be multiple users for my application and of course the Kodakprv.Exe is in a different directory on each PC. Is their a way to find the directory that the kodakprv.Exe is in and then use that as Path in the shell command to open Kodakprv.Exe. Any help would be greatly appreciated.

Here is the code I have now


sAppName = Trim(strImageName) & " - Imaging Preview"
intRet = Shell("C:Program FilesWindows NTAccessoriesImageVuekodakprv.exe \lightfootd-drivewebsecurescanimages" & strImageName, vbNormalNoFocus)

Get WeekDateName In Enlgish WinXP = Same As French WinXP?

Just wondering if anyone with another language of Windows could test this.

MsgBox WeekdayName(Weekday(Date, vbUseSystemDayOfWeek))

If you bring up todays date, in an English running Windows it would return "Saturday". However what would a French Windows return?

"Saturday" or "Saturday" in French...?

Get WeekDateName In Enlgish WinXP = Same As French WinXP?

Just wondering if anyone with another language of Windows could test this.

VB Code:
MsgBox WeekdayName(Weekday(Date, vbUseSystemDayOfWeek))

If you bring up todays date, in an English running Windows it would return "Saturday". However what would a French Windows return?

"Saturday" or "Saturday" in French...?

Get Path Of Program When Program Is On Another System (Linux Server)
This is a little hard to explain but I will try my best to make sense.

I am a network/computer technician.  I am very knowledgeable in VB 6.  I have a program that I have written in VB 6.  The purpose of this program is to make my life easier when I have to reformat a hard drive and reinstall windows.  Instead of navigating in and out of folders on my external hard drive, I can just click the radio button for each program I want to install and click a command button.  It really does make things easier and faster.

When I have my external USB hard drive connected directly to the computer this program works fine.  I am using the following command to get the local drive letter of the USB drive:  Split(App.Path, "")(0).

However the above command does not work for a network path.  I have a Linux Server that will contain all the same programs that the external hard drive does, and in all the same folder paths and program names.  I just sync them both about once a week or so.

My questions are following:

1). How can I determine if the program is running locally or from a network?
1). How can I determine the network path.

I will not be nor do I want to map a drive to the network path as once the computer has all the required software install and all the required setting changes made, the network path will not be needed again.

Sorry this is so long and I hope I have made sense, and this is easy to understand what I want.

Using A Program To Find Files. Without Using Apis To Call Up Windows Find
i would like to locate a file using straite code in viaula basic

can you help me out??


Find The Path
does anyone know some code to find the path

so say i copy a .exe to C:/windows/program files/copy.exe

i open the .exe can i found out its path and use it inn the code i.e

kill ("MY PATH/other.exe")

Find A Path

I need to find a Path throught network .
How can I do this?


Find .dll Path
I want to be able to show the user where the .dll is being read from. Is there an API or someone have some code to do this. The .dll path is not hard coded. I am using environment variables and I need to be able to see where the .dll is getting read from.

How To Find Path
i enter some values in excel worksheet and i save that with one particular filename.if i give that filename ,is it possible to find the path.using vbcode i have to do that.give me the code.the same thing for the folder.if i give the folder the path of that folder has to be displayed.

Find The Path
I need to find the path for Userfile.xls. Userfile.xls could be anywhere on C:. What i have tried has failed misserably. Please help!

Find The Path
How to find the complete path given the name of the file

Help Find Path
If anybody knows how I can find the path to open the the print queue dialog, I'd be very grateful.

Manually, it's opened through Start/Settings/Printers and then by double clicking on a printer icon.

I'm trying to use Shell to open it, but I can't find the name or even the extension it uses in WINDOWS.

Any ideas would be appreciated.



[This message has been edited by WillP (edited 01-28-2000).]

[This message has been edited by WillP (edited 01-28-2000).]

Find Particular Path Using VB 6
Hi all,

Plz help me find particular path on network (\punchsmartdata)using VB6, i want copy some files if that path exist, if not i want to ignore.
plz give me a example with code.


How Can We Find Path Of Exe

         can we find the path of our "vb6.exe" on our sytem through our program.

    Thanks in advance...


Find Fullname/Path Of MDB
I want to be able to find where the Access database is running from. Whether the user or I moved it to another location, I want to be able to reference that information.

It's very similar to the thread above but that deals with Excel I have not been able to find anything else on it yet.

Can anyone help?

I run "Bob.mdb" from 'C:Temp'

I would like to be able to retrieve "C:TempBob.mdb" from inside the application as a string.

Thanks so much!

How Can I Find The Path Where The File Is On?
I want to find the path which the vb program is in (while I'm running the program)
How can I do that?

Find The Path Or A Running App?
Is there a way to find the path of a running application?

How To Find The Path Of A Picture That Is In A Pic Box
I need to be able to find the path of the picture while the application is running and the picture has been loaded?? the only reason this is a bit harder is the picture that is loaded is a random one

thanks for any help you can offer

Find Installation Path
I'm sure this question has probably been answered on this forum before, but I must be searching for the wrong words because I'm not finding an answer....anyway...I've got a Winsock app that accesses a text file that stores information like ip addresses in it. currently my path to my text file is hard-coded and consequently the program has to be installed on a specific directory. How I can find out where my program is installed and just look for the text files there?

Cannot Find File Path
I have a report that is in the same directory as my application therefore want to use the syntax below instead of writing the whole path name.
But when I use it, the application cannot find it. Does anyone know why? Can anyone please let me know what's wrong?

App.Path &amp; "ReportName.rpt"


Find Project Path.
Hi all

Could someone please tell me how i can use the path of my project in code, because im embedding a flash movie but it won't let me use a document relative path. So i need to find the project path.

Thanks in advace


Find The Path To The Desktop?
I have a program on a shared drive and inside of it I have a richtextbox and I want to save that as a file on the users desktop.
If I specify the location its fine ex.
RichTextBox1.SaveFile ("C:Documents and SettingsmycpuDesktop estvbdox.doc")

but I dont want to specify everybodys location thats going to be using this. There has to be something out there like app.path that will give you the location of the desktop on a users pc but I dont know what it is can anyone help?!?!

Globals, Find, And APP.Path Oh My!

I have this application and just resently switch from adodc controls to just using ado code. Well, I had originally created this find form that works fine the old way but I can't seem to get the app.path to work for the new way.

The find form has three parts and the first is what I am having trouble with. In the first part is a module setting it as a global for any form that wants to use the find form.

Here is the code to the first part:

Option Explicit
Public Declare Function sendMessageByString& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String)
Public Const LB_SELECTSTRING = &H18C
Public gFindString As String
Public Const gDataBaseName = "C:Documents and Settingss1027637DesktopNew FolderUltimateX.mdb"

The portion in red is what I am having trouble with. I can not have the database location typed in since this code has to be portable. I have been using app.path for the other forms but the code I use for those forms do not work for the module of course. Does anyone have a trick I can use to figure this out.

Desktop Path - A Way To Find It
How can I find the desktop path (for all windows versions)? Is there an API call for it or something?

Find Path To A Folder By Its Name

I am trying to find the path of a folder on the machine by using its name only.
I have been searching all the threads from past few days but couldn't find any information about what i wanted. I know that path to a file can be found by using the file name but couldn't find any information for a folder.

This is what i exactly want to do:

If there is a folder called "Output" in say C:<Something>Output, i want to find the path i.e., C:<Something> by just giving the folder name.

Any help on this is appreciated.


Find The Application Path
I found this program dock application and it is really useful. Now lets say i have a icon in the folder called WindowsMediaPlayer.PNG is there a way where when i click on the icon it can read from the same filename but with a different extension for example WindowsMediaPlayer.ini and the will have the file location so when i click on the icon it can open that file and get the path for the exe? Also can there be another file for Example WindowsMediaPlayer.txt and this will have the caption of the application so when i point to the icon it can show the caption from the correct place.

*****For the file attaced add some .PNG's to the icons folder for it to work.*****

Find DESKTOP Path . . .
As you know with XP machines the Desktop path changes as it relies on the account name of the machine.

Im wondering how to find the desktop path of the particular machine the EXE file is opened on.

Assume i have a TEXTBOX and i want it to show the path of the desktop.

Find File Path
I want to find the filepath of some application path like word,winzip by registry keyvalues.

Find Folder Path
Here with I have attached a picture. I want wheather this is installed in machine or not by vby. And I also I want to find the folder path.

Find A Path To A File
Is there any way to capture a path. ex. I want to find excel.exe on someone's maching can I somehow do a search for it and then get the path?

Find Path To WordPad

My program shells to Wordpad, but WordPad is in a different location in Win98 and XP. How do I let the system find the path?

BEST Way To Find A Folder Within A Certain Path?
Can anyone tell me what would be the best (i.e., fastest) way to determine whether a certain folder exists anywhere in a select path?

For example, say I use CurDir to get the current directory path of C:MYSTUFFDATAMYWORKMYBIZ. I then want to check to see if the DATA folder exists. What would be your advice as to the best way to handle this (other than search in string functions, if possible). Thanks for any tips for improving performance!

Find Image's Path
Is there a method, where I can find the current path of an image?

Find Path Of Excel.exe
I want to find the path of excel.exe of any version

Oracle Path Find
i want to find the path where oracle is installed in my pc plz tell me.

Find Path OfExcel.exe
How can i find the path of excel.exe....???

How Find The Physical Path ?
i have written an activex , and in my activex source i need to detect that where is the activex has been saved, i mean the where is the real activex physical path, the curdir or getabsolutepathname or ... doesn't work properly , they only give the path of my desktop.
have anyone any idea ?

How Can I Find Out If There Is A Directory In A Path?
hi guys, I wonder if there is a way OR an API function that will tell me whether there are any directories in a given path or not. For example I want to check to see if any directory exists in "c:windows" or not. I have written this function and I'm not sure if it always works correct. The problem is that I have to use this in a forloop and it is extreemly slow. So I need a better way of doing it

VB Code:
Private Function DoesPathContainDir(ByVal strPath As String) As Boolean    Dim mEntry As String        ' Ensure that the path ends with the '' character    If Right(strPath, 1) <> "" Then        strPath = strPath & ""    End If        mEntry = Dir(strPath, vbDirectory)    Do While mEntry <> ""        If mEntry <> "." And mEntry <> ".." Then            If (GetAttr(strPath & mEntry) And vbDirectory) = vbDirectory Then                DoesPathContainDir = True                Exit Function            End If        End If        mEntry = Dir()    Loop        DoesPathContainDir = FalseEnd Function

there MIGHT be a problem with my function too, but it works fine when I test it in the immidiate window

thanks for the help!

also! does this sound right in the code?: Do While mEntry <> ""

Is There A Way To Find The Path That The Vb App Is Running In?
Is there a way to find the path that the vb app is running in?



Copyright 2005-08, All rights reserved