Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bizarre problem - VB6 won't see one .EXE file but sees all others

0 views
Skip to first unread message

Andrew Stephan

unread,
May 29, 2002, 8:37:38 AM5/29/02
to
Hello.

I am having a really weird problem with VB6. There is one particular
.EXE file I am trying to call from my VB program using a command like

Shell "C:/Program Files/SRIM 2000/TRIM_WIN"

and I get error messages like "Run-time error '76': Path not found."
The weird thing about it is that I have other files in the same folder
like MaestroToExcel.EXE that I can call by substituting MaestroToExcel
in place of TRIM_WIN in the command given above and they will run.
For some reason, VB just refuses to find that one particular file. I
have tried everything I can think of, including but not limited to
changing the name of TRIM_WIN, changing its location, changing its
name and location, making a copy of it elsewhere, making a copy with a
different name, referring to it as both plain TRIM_WIN and
TRIM_WIN.EXE, etc, etc. I also tried looking at the properties of
TRIM_WIN in Windows Explorer and it isn't a hidden file or anything
like that. I have tried running different .EXE files both in the same
folder and in other folders using the same command format and I never
have a problem except with this one file, the one file that I *have*
to run.
What I do know about TRIM_WIN is that it was originally written in VB5
and then compiled as an executable, although I wouldn't expect this to
affect things in any way.

I am at a total loss to understand what is going on here. Can anyone
give me some advice as to what to do?
Thanks.

Andrew

Doug Ross

unread,
May 29, 2002, 9:15:47 AM5/29/02
to
Did you try this?

Shell "C:\Program Files\SRIM 2000\TRIM_WIN"


"Andrew Stephan" <aste...@utk.edu> wrote in message
news:5953f8fc.02052...@posting.google.com...

Cees Harlaar

unread,
May 29, 2002, 9:15:19 AM5/29/02
to
Andrew,

I think, because I'm guessing here, TRIM_WIN.exe can't find some file it
uses or is dependant of. Does win_trim run if you doubleclick it in
explorer?

Cees Harlaar

"Andrew Stephan" <aste...@utk.edu> wrote in message
news:5953f8fc.02052...@posting.google.com...

Eq Tetrachloride

unread,
May 29, 2002, 9:40:14 AM5/29/02
to
"Andrew Stephan" <aste...@utk.edu> wrote:

> Shell "C:/Program Files/SRIM 2000/TRIM_WIN"
> and I get error messages like "Run-time error '76': Path not found."

You don't seem to have determined whether it is the program failing to run
or the path failing to be recognised. (For example, you usually need to put
long filenames with spaces inside "quote marks".)

So: does the file run if you put it in the root directory and use
Shell("c:\trim_win.exe") ?

Eq.

--

Equinox Tetrachloride
www.cl4.org - www.insecurities.org


Andrew Stephan

unread,
May 29, 2002, 3:41:39 PM5/29/02
to
Cees,

You are right! Trim_win can't find a file it needs when called from
VB6 (thus the path error) but it can find the file when double-clicked
on in Windows Explorer or executed from a DOS shell. How do I know
this? If I put in the name of a non-existent file when running my
program while in VB6, I get one kind of error and am told which line
the error occurred on. If I run my program with trim_win as the file
it will call, guess what? I get a different type of error message
(one with an exclamation mark on it) and it calls it a run-time error.
It makes more sense if you see it in person, but I'm very confident
that trim_win is just failing to find needed files before it gets
started. What I don't understand is why it would have this problem
when called from VB but not at other times. I am going to contact the
author about this.

Thanks Cees and thanks to the others who replied! Your help is much
appreciated.

Andrew

"Cees Harlaar" <cees.h...@hccnet.hl> wrote in message news:<ad2k9i$adk$1...@news.hccnet.nl>...

Cees Harlaar

unread,
May 29, 2002, 4:34:48 PM5/29/02
to
Andrew,

It seems the author of wintrim left you with a problem, you might get out of
it by changing the current directory to the folder where wintrim is located,
like this

mydir = C:/Program Files/SRIM 2000/"
ChDir MYDIR
Shell mydir & "/TRIM_WIN"

Cees Harlaar

"Andrew Stephan" <aste...@utk.edu> wrote in message
news:5953f8fc.02052...@posting.google.com...

0 new messages