Terry Kreft's ShellWait - Problem

G

Guest

In one of my apps I write a cmd file which is written to disk and then I use
ShellWait to call it. On my machine, it works fine, But on another machine,
when the line from ShellWait:

ret& = CreateProcessA(0&, Pathname, 0&, 0&, 1&, _
NORMAL_PRIORITY_CLASS, 0&, 0&, start, proc)

runs, it insists that the exe file which is called by my cmd file (actually,
JetComp.exe) doesn't exist, even though it's in the same directory as the cmd
file.

I've put an error handler into the routine which contains the line above,
but the error is not trapped.

Any ideas here?

Kevin
 
D

Douglas J. Steele

Are you fully qualifying the path fo the executable you're calling? That's
always recommended: depending on the current directory is seldom reliable.
 
G

Guest

Thanks, Doug. No, I'm not fully qualifying the path, because I don't
necessarily know where it (JetComp.exe) is, or even if it exists. I was
hoping to trap an error if it wasn't found, and then use Access to compact
and repair if the error occurred, but since I can't trap the error, I'm
having trouble doing that.

All this is in aid of getting an Access utility I'm trying to get into beta
test which will:

- Give you easy access to up to 30 Access databases, and open, copy, backup,
compact/repair them,

- Compare the table structures of a development back end to a production
back end, and automatically install the changes to the production back end.

If anyone is interested in trying a beta test of this, please let me know.
I could have gone with just the regular Access compact/repair, but I thought
I'd try for the JetComp , and I don't know why it works on my machine, but
not one other, when the .cmd file I'm creating is in the same directory as
JetComp, and in the same directory as the .mdb file.

Thanks,

Kevin
 
D

Douglas J. Steele

I'm confused by your statements. In this post, you say "I don't necessarily
know where it (JetComp.exe) is", whereas in your previous post you said "it
insists that the exe file which is called by my cmd file (actually,
JetComp.exe) doesn't exist, even though it's in the same directory as the
cmd file".

Which is it?
 
G

Guest

Sorry for the confusion, Doug. What I meant was that when I create the .cmd
file which will run JetComp, I don't necessarily know where JetComp is
because this is meant to run on any number of different machines. On my own
machine, I know it's in the current directory. But on a different machine I
ran it on, even though JetComp was in current directory, I got the error,
which is apparently not trappable.

I've gotten around this by prompting the user to tell me where it is the
first time it runs, so I can fully qualify it thereafter. I haven't been
able to test this yet on the machine I got the error on, though, so I'm not
sure whether the fully-qualified path will work there or not.

Thanks for the followup.

Kevin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top