itchyII
MIS
- Apr 10, 2001
- 167
Hi Everyone,
I am in the process of automating an existing Access (2000) application. There is a series of about 50 queries that must be run in sequence, then an export of some data, a few FoxPro exe's that are run on the exported data, then a re-import of the data and a few more queries to run. My role is to simply automate the process, not really change anything. In any case, all is going well so far, but I ran into a problem when I try to execute the FoxPro exe's thru a shell. I did a whole lot of research on how to run the exe's in sequence (there are 2), so that the first one completes before the second one starts. Here is what I have so far:
The problem seems to be that the exe is on another server and if I map the drive on my pc and run it as above, it works no problem. But if I try to pass the absolute path (\\servername\foldername\filename.exe) I get an error (the system cannot find the specified file). I assume this is because the process that I am using to run the file uses the command line and the absolute path is not being accepted. Also, the server is a windows server and there are spaces in the folder name. Does anyone have any ideas on how I can make this work? This app may be distributed to multple users, and that would mean that I would have to worry about everyone's different mapped drives!
Thanks
ItchyII
I am in the process of automating an existing Access (2000) application. There is a series of about 50 queries that must be run in sequence, then an export of some data, a few FoxPro exe's that are run on the exported data, then a re-import of the data and a few more queries to run. My role is to simply automate the process, not really change anything. In any case, all is going well so far, but I ran into a problem when I try to execute the FoxPro exe's thru a shell. I did a whole lot of research on how to run the exe's in sequence (there are 2), so that the first one completes before the second one starts. Here is what I have so far:
Code:
Dim flag As Boolean
Dim path As String
Dim file As String
Dim test As Long
Dim WSH As IWshShell
Dim WaitForTerm As Boolean
Dim CommandLine As String
Set WSH = New IWshShell_Class
WaitForTerm = True
flag = False
path = "Z:/"
file = "etc_apwithpo.exe"
CommandLine = path & file
On Error GoTo cleanup
test = WSH.Run(CommandLine, vbHide, WaitForTerm)
flag = True
cleanup:
Set WSH = Nothing
runEtc_apwithpo = flag
The problem seems to be that the exe is on another server and if I map the drive on my pc and run it as above, it works no problem. But if I try to pass the absolute path (\\servername\foldername\filename.exe) I get an error (the system cannot find the specified file). I assume this is because the process that I am using to run the file uses the command line and the absolute path is not being accepted. Also, the server is a windows server and there are spaces in the folder name. Does anyone have any ideas on how I can make this work? This app may be distributed to multple users, and that would mean that I would have to worry about everyone's different mapped drives!
Thanks
ItchyII