That code is impressive and also seems obsessive for such a simple task;
but I don't have access to NTs this month so maybe that's what is needed for that OE.
Two items that need to be addressed:
1)How to get a directory listing, and
2) Where to store the exact case spelling of the compiled program so that it is not easily changed.
1) = DIR()
2) = Application's Product Name Field
This may be a little late but it will return the correct info you are looking for on Win98 (without special controls/references/or API calls).
SETUP:
> new project
> one text box (long enough to see Filenames)
> four command buttons
> shut off ALL REFERENCES and ALL CUST. CTRLS (this is optional)
> ADD to App's 'ProductName' the EXACT Case-Sensitive filename spelling you want to use [red](see NOTE1 below)[/red]
THEN:
Paste following code, compile the project AND don't forget to compile it as the name you typed in exactly as is displayed in App.ProductName.
Private Sub Command1_Click()
Text1.Text = App.EXEName
End Sub
Private Sub Command2_Click()
Text1.Text = App.ProductName
End Sub
Private Sub Command3_Click()
Text1.Text = [red]Dir("*.*"
[/red]
Do While Text1.Text <> Empty
If Text1.Text <> Empty Then
If StrComp([red]App.ProductName[/red], Text1.Text, 0) = 0 Then
MsgBox "**** match made ****", , "GREAT WORK!!!!"
Exit Do
End If
MsgBox "no match made", , "Just Keep On Trying OK?"
End If
Text1.Text = Dir
Loop
End Sub
Private Sub Command4_Click()
End
End Sub
Private Sub Form_Load()
Command1.Caption = "App.EXE Name"
Command2.Caption = "app.product name"
Command3.Caption = "directory check"
command4.Caption = "exit"
End Sub
Hopefully the above code and Setup instructions help.
--MiggyD
[red]
NOTE1:[/red] When I compiled the project (lets say "All for One"

the extention was capitalized upon the first compilation...
All for One.[red]E[/red]xe
While ProductName was
All for One.[red]e[/red]xe
I exited the running prog., renamed it to a lower case '.exe' then a match was found.
Upon subsequent compilations it was compiled as lower case '.exe'