473,770 Members | 4,553 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Run EXE File via Shell command + Arguments

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\Datab ase
The FTP utility sits in C:\Documents and Settings\Dennis \My
Documents\Datab ase\oexport
The files to be uploaded in C:\Documents and Settings\Dennis \My
Documents\Datab ase\oexport\fil es

Pretty organized structure.

Now my command looks like this:
Shell CurrentProject. Path & "\oexport\ncftp .exe -u myuser -p mypasswor
my.ftp.server.c om /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:\Documen ts 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.c om /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.
Nov 13 '05 #1
1 16018
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You don't need the 8.3 naming convention, you need to put double-quotes
around the paths. E.g.:

const Q = """" ' double-quote
dim strCmd as string ' the command line to Shell()

strCmd = Q & CurrentProject. Path & "\oexport\ncftp .exe" & Q
strCmd = strCmd & " -u myuser -p mypassword my.ftp.server.c om /test "
strCmd = strCmd & Q & CurrentProject. Path & "\oexport\files \*" & Q

Shell strCmd, vbNormalFocus

Notice I changed the destination "oexport/files/*" to use the DOS
file/directory separator "\", since CurrentProject. Path will use that
symbol. Also, I added a "\" before the destination's "oexport"
directory name.

--
MGFoster:::mgf0 0 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQQqOroechKq OuFEgEQLdfgCgh4 ekFppu/oRrlMmBK4ksUyUt wvgAoPAa
IuT7vZ1sSi9s4gC MRkeJzUWG
=xPrH
-----END PGP SIGNATURE-----
Dennis Gaida wrote:
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\Datab ase
The FTP utility sits in C:\Documents and Settings\Dennis \My
Documents\Datab ase\oexport
The files to be uploaded in C:\Documents and Settings\Dennis \My
Documents\Datab ase\oexport\fil es

Pretty organized structure.

Now my command looks like this:
Shell CurrentProject. Path & "\oexport\ncftp .exe -u myuser -p mypasswor
my.ftp.server.c om /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:\Documen ts 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.c om /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.


Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
10082
by: Lauren Wilson | last post by:
Hi folks, In an A2K app, I have attempted to use the following command in some VBA code with IDENTICAL results with every single version of the following: Shell "outlook.exe", vbHide Shell "outlook.exe", vbNormalFocus Shell "outlook.exe", vbMinimizedFocus Shell "outlook.exe", vbMaximizedFocus
1
3843
by: VRWC | last post by:
Hello dear people, In an A2K app, I have attempted to use the following command in some VBA code with IDENTICAL results with every single version of the following: Shell "outlook.exe", vbHide Shell "outlook.exe", vbNormalFocus Shell "outlook.exe", vbMinimizedFocus Shell "outlook.exe", vbMaximizedFocus
4
15077
by: Kevin Mansel via .NET 247 | last post by:
Ok, basically this is my problem. I'm building a console app tocall a dos program. So i'm using the Shell command to call theprogram, now depending on what happens, I want to read theoutput that this program returns. I'm just missing the stepshere. I know that I can set the Shell command to an integer,but this only returns a 0 to me telling me that it executed, notwhat is being returned to the console by that application. Isthere a way to...
3
2644
by: Daz | last post by:
Hi everyone! This is my first time posting in this group, although I have been watching it for the past few months and have to say this is possibly the best group I have seen on Google so far! (That wasn't a butt-kissing comment, I just believe in giving praise when it's due). I would like to copy files using globbing, and I am not sure of the best way to do it. I have tried using system("COPY "), but It's still not quite what I am...
6
3687
by: mardif | last post by:
Hi guys. I've a very big big big problem: I've in my windows computer a file named cicciobello.html, located in c:\documents and settings\username\desktop\cicciobello.html. Now, I MUST open this file with os.spawn(os.P_WAIT ...., because I must wait the user cancel the explorer window, ok? And so, I write:
4
2382
by: Anastasios Hatzis | last post by:
I'm looking for a pattern where different client implementations can use the same commands of some fictive tool ("foo") by accessing some kind of API. Actually I have the need for such pattern for my own tool (http://openswarm.sourceforge.net). I already started restructuring my code to separate the actual command implementations from the command-line scripts (which is optparser-based now) and have some ideas how to proceed. But probably...
1
8261
by: ohaqqi | last post by:
Hi guys, I'm still working on my shell. I'm trying to implement a function typefile that will take a command line input as follows: > type <file1> This command will implement a catenation of file1, equal to the command cat <file1> I need to use execvp() and fork() system calls to create a new process that will type/cat any text file. In my code below, the execvp() call in the function at the bottom gets me the following: ...
5
5083
by: inetquestion | last post by:
I am looking for a web interface for shell commands or shell scripts. Does anyone know of any exexisting php scripts which would solve this requirement? PHP form accepts input from a user, then passes these as arguments to a configurable shell script or OS command. I would like for the output generated from the shell script/command shall be displayed in a new javascript window once the form is submitted. Optimally a user should not...
7
6237
by: Samuel A. Falvo II | last post by:
I have a shell script script.sh that launches a Java process in the background using the &-operator, like so: #!/bin/bash java ... arguments here ... & In my Python code, I want to invoke this shell script using the Subprocess module. Here is my code: def resultFromRunning_(command):
0
10071
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9882
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7431
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5326
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5467
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3987
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3589
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2832
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.