J
Jonathan Scott via AccessMonster.com
I am trying to execute a shell command with the Shell() function. Problem
is, execution continues before the command is complete.
I am trying to grab the output of the command by executing it and
redirecting to a file c:\temp.txt. I then open the file and look for the
contents I want.
However, when the next line after Shell() tries to open the file, it is not
there, and tells me so. I look in explorer, see it there, and have Access
continue, at which point it finds the file and continues as expected.
What's the deal? When Shell() returns, I expect that the temp file is where
it is expected, but it is not. How can I resolve this? Should I just loop
until the open finally succeeds?? Or is there some option I need to give
Shell() or cmd? Better yet, is there a way I can get the output without
resorting to unpredictable temp files?
Jonathan Scott
is, execution continues before the command is complete.
I am trying to grab the output of the command by executing it and
redirecting to a file c:\temp.txt. I then open the file and look for the
contents I want.
However, when the next line after Shell() tries to open the file, it is not
there, and tells me so. I look in explorer, see it there, and have Access
continue, at which point it finds the file and continues as expected.
What's the deal? When Shell() returns, I expect that the temp file is where
it is expected, but it is not. How can I resolve this? Should I just loop
until the open finally succeeds?? Or is there some option I need to give
Shell() or cmd? Better yet, is there a way I can get the output without
resorting to unpredictable temp files?
Jonathan Scott