runApp adding directory path

  • Thread starter Thread starter Ken Ivins
  • Start date Start date
K

Ken Ivins

I previously posted the below problem and no one responded (which I assume
means that they could not come up with an answer). So I did some more
experimentation on my own and came up some additional data. Maybe with this
information, someone can come up with an idea.

RunApp opens a number of other programs fine (both Microsoft and non
Microsoft). RunApp would not open a program from a shortcut though. So I
created a batch file (EMISbat.bat) that opened the C++ program (EMIS.exe)
that I placed in the same directory with EMIS.exe (the c:\aaa directory) It
opened it fine from Windows Explorer. The batch was quite simple:

c:\aaa\EMIS.exe

I then tried running the batch from RunApp. For the command line I entered
c:\aaa\EMISbat.bat and it would not work. I added a pause to the batch file
to see what was happening and noticed that something was added to my
command. The following command showed in the DOS window: C:\Documents and
Settings\Ken Ivins\My Documents\Customers>C:\AAA\EMIS.exe

I then changed the batch to:

cd C:\

cd C:\aaa

C:\AAA\EMIS.exe

Then it all worked fine. Any idea why Access/Windows is adding the other
directory information? Is there a way to stop this?

Thanks,
Ken Ivins



I am trying to run a simple C++ program that merges 3 ".asc" files into one
".asc" file from a RunApp Action in a Macro. I tried running it as a Windows
program and a dos program and still it did not work. I am using Access 2002
in a Win XP Pro environment.

The program runs fine by just double-clicking it. The Macro seems to start
the program. In the Dos mode a Dos window opens and then closes, but no new
file is created.

Any ideas why this is not working correctly?

Thanks,
Ken Ivins
 
You have to be explicit in respect to where the executable is located. I am
sure if you provided the COMPLETE path to emis.exe in your macro, it would
run. If you do not provide the complete path, an attempt is made to run the
command in the current directory...which is apparently C:\Documents and
Settings\Ken Ivins\My Documents\Customers. The app is not found in that
directory, and therefore does not run.
 
Dear Paul,

In RunApp I thought I was specific. I typed in command line c:\aaa\EMIS.exe.
I did the same for the batch file (c:\aaa\EMISbat.bat) and had the same
problem. When I changed the batch file (see below) to change directories and
left the same info in the RunApp command line (c:\aaa\EMISbat.bat) then it
all worked.

Am I missing something.
If I typed the full path of another program such as Word it worked just
fine.

Hopefully I can just make a small change to make this work because now when
I run this, a DOS window with the batch file appears for a short period then
disappears. Maybe just reside the EMIS.exe in the Settings\Ken Ivins\My
Documents\Customers directory? Any other ideas would be helpful.


Thanks,
Ken
 
Back
Top