Hi everyone,
I see this issue repeated in a lot of forums, but so far no answers have worked for me.
I am trying to get Access to run a .bat file (also works as a .cmd file), using a simple Shell statement, but it isn't working - it seems to rush through it too fast. Starting the file manually outside of Access works perfectly.
The basic code:
(In case it matters, the bat file logs in to our ftp server and downloads a specific file...)
I've tried adding various waits after the code, but it doesn't seem to make a difference, like:
...and other "wait" type of solutions, but that doesn't seem to be the issue - the cmd window closes well before it starts the counter.
It seems like the code is moving on or ending before the batch file has time to run (it takes about 1 full second). Or is it another issue?
I see this issue repeated in a lot of forums, but so far no answers have worked for me.
I am trying to get Access to run a .bat file (also works as a .cmd file), using a simple Shell statement, but it isn't working - it seems to rush through it too fast. Starting the file manually outside of Access works perfectly.
The basic code:
Code:
Shell "C:\Documents and Settings\myname\My Documents\CLIENTS - ACTIVE\ftptransfer.cmd", vbNormalFocus
I've tried adding various waits after the code, but it doesn't seem to make a difference, like:
Code:
Shell "C:\Documents and Settings\myname\My Documents\CLIENTS - ACTIVE\ftptransfer.cmd", vbNormalFocus Dim Counter Counter = 0 While Counter < 300000000 Counter = Counter + 1 Wend Debug.Print Counter
It seems like the code is moving on or ending before the batch file has time to run (it takes about 1 full second). Or is it another issue?
Comment