469,271 Members | 1,533 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

How to make Shell() function synchronous ?

Hi everyone,
I am making using Shell() function to run a command line tool from my VB Application.

I am using it to archive a folder. So I am using the code :
Expand|Select|Wrap|Line Numbers
  1. Shell("command line argument as string")
  2.  
where "command line argument as string" is the DOS command for the particular command line zip tool.

The command is properly working but when the number of files are more in the folder, then the time taken to archive is more than some milliseconds or even more than some seconds.

Now the problem is that : I FTP this file to a FTP Server. But if the time taken to archive the folder is more then my execution of code reaches the FTP part and at that time it does not fine any .ZIP file in the specified location. Thus it fails to FTP the file.

One solution to this problem is to provide some delay after calling the Shell() function. But this does not provide a guaranteed time for all cases.

So I am searching for a way that I make this Shell() function synchronous (As it is Asynchronous by default, as they say in MSDN). In MSDN they say to include an Optional argument "True" to make it synchronous, but it is not working.

I am using VB6.

Please provide me with a way for this issue.

Thanks in advance
Pawan
Oct 14 '07 #1
3 5036
Killer42
8,435 Expert 8TB
Try seaching here for ShellExecute.
Oct 14 '07 #2
Thanks
But I found the ShellandWait code when I searched google for Shell + Wait. It solved my issue, the way I wanted.
Pawan
Oct 16 '07 #3
Killer42
8,435 Expert 8TB
But I found the ShellandWait code when I searched google for Shell + Wait. It solved my issue, the way I wanted.
ShellandWait? Never heard of it.
Oct 16 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

8 posts views Thread by Siemel Naran | last post: by
1 post views Thread by gjuro kladaric | last post: by
21 posts views Thread by Tom Gur | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.