Run EXE File via Shell command + Arguments

D

Dennis Gaida

Hi there,

I want to upload some exported reports to a FTP Server, for this I
use a command line FTP utility.
My Database sits in C:\Documents and Settings\Dennis\My
Documents\Database
The FTP utility sits in C:\Documents and Settings\Dennis\My
Documents\Database\oexport
The files to be uploaded in C:\Documents and Settings\Dennis\My
Documents\Database\oexport\files

Pretty organized structure.

Now my command looks like this:
Shell CurrentProject.Path & "\oexport\ncftp.exe -u myuser -p mypasswor
my.ftp.server.com /test files/*", vbNormalFocus

The command would be correct like that (when running it of the command
prompt), BUT!!!!

Access somehow sets the wrong WORKING DIR for the Exe File (does the
same for Batch files). Access runs the File in "C:\Documents and
Settings\Dennis\My Documents" instead of all the nested folders.
That happens to every EXE file I run and to every batch file too.

What I tried now is to use this command
Shell CurrentProject.Path & "\oexport\ncftp.exe -u myuser -p
mypassword my.ftp.server.com /test " & CurrentProject.Path &
"oexport/files/*", vbNormalFocus

This could work IF my program would understand those Windows long path
(it only understands Paths with 8:3 DOS naming standards).


SO what I need from you is either
- how to set the actual WORKING DIR in Access
or
- how to tell Access to use 8:3 naming for CurrentProject.Path


Dennis

PS: and yeah I need to use relative paths since the database sits in
different places, depending on the computer on which it is used.
 
D

Douglas J. Steele

Try putting quotes around the paths.

Shell Chr$(34) & CurrentProject.Path & "\oexport\ncftp.exe"" -u myuser -p
mypassword my.ftp.server.com ""/test " & CurrentProject.Path &
"oexport/files/*""", vbNormalFocus

You could also use a batch file, and put a CD (Change Directory) statement
in it to set the working path.
 

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