473,396 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 5339
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

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

Similar topics

0
by: Bengt Richter | last post by:
Still looking for a unifying concept ;-) It struck me that @deco1 @deco2 def foo():pass uses '@' to register at-next-name-binding processing in a way similar to atexit's registering of...
8
by: Siemel Naran | last post by:
Hi. I'm writing a command shell that reads commands from standard input. At this point I have the command in a std::string. Now I want to execute this command in the shell. From the Borland...
9
by: David | last post by:
Hello I'm testing the XMLHttpRequest object in Firefox and IE. The code below works well in IE and Firefox. It shows "1" when the string is a number and "0" when not. The page aspxTest.aspx only...
18
by: MLH | last post by:
I have an A97 app that automatically sends eMail using OutLook Express. Each installation requires the user to reconfigure Outlook Express to avoid prompts waiting for them to authorize or deny...
1
by: gjuro kladaric | last post by:
it was not possible to make a shell extension from within VB2003, I believe has anything changed since then, can I (easily) write a VB code that would function as a shell extension thank you ...
21
by: Tom Gur | last post by:
Hi, It's seems that csh and tcsh acts a bit different when handling special characters in quotes. i.e: if i'll supply my program with the following arguments: -winpath "c:\\temp\\" tcsh will...
25
by: dennijr | last post by:
ok, shell always used to be easy for me, now its starting to get annoying cause i dont know wats wrong heres the simplist code possible: Private Sub IExplorer_Click() a = Shell("C:\Program...
4
by: kp7796 | last post by:
What is synchronous function? What is asynchronous function? Unsigned char a=0; Void function (void ){ Unsigned char Flag; Flag=0 If (a==1){ Flag=1; }
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.