Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Quick quesion re: Shell command in vbHide mode

Posted on 2001-08-06
14
Medium Priority
?
511 Views
Last Modified: 2006-11-17
I am using the shell command to zip up a db file in a DOS window.  When running it in vbNormalFocus mode the DOS window does not close after the file has been zipped.

If I change it to vbHide so that the DOS window does not pop up will a process still be running in the background that I will have to worry about closing after the zip is complete or no?

Thanks
0
Comment
Question by:bsmiley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +5
14 Comments
 
LVL 6

Expert Comment

by:JonFish85
ID: 6358428
vbHide will just hide its execution I believe... You will probably have to close it manually... Listening for other experts' advice...
0
 
LVL 5

Expert Comment

by:KDivad
ID: 6358431
Yes, it will still be in the background.

If this app is for personal use:
Right-Click your zip exe (pkzip?) and select properties. On the "Program" tab, select "Close On Exit". Click OK.
0
 

Expert Comment

by:Ktoshni
ID: 6358604
I have a small VB program which does something similar. However I use the Winzip command line utilities to zip/unzip files. When the operation completes there will be no processes left in memory. The only problem I have encountered is that if there is a problem with the zip file you wouldn't realise that something happened - your program would just lock up. Maybe you could find a work around for this. As such I haven't had the chance to check it out. Go to www.winzip.com and you'll find the command line utilities available for download. Please note though you'll need Winzip installed too.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 5

Expert Comment

by:KDivad
ID: 6358812
The work-around is easy enough. You launch a tiny app that just starts the command-line utility. Use the Shell-And-Wait method to launch it. WaitForSingleObject includes a timeout amount. Put in an appropriate timeout. For example, if the zip process will take 5 seconds then put 10. WaitForSingleObject will return when A. The process has ended or B. the timeout occurs. Check the return value and see if it timed out. If it did, then assume a lock-up and use TerminateProcess(?) to kill the "tiny app" you launched and the command-line.

I don't have the Shell-And-Wait method anymore...
0
 

Expert Comment

by:netraLINK
ID: 6358861
HI bsmiley

Why not use a freeware 3rd party component to zip or unzip your files. E-Mail me if you want me to mail you one. Ive used the one I have extensively in the past and it works like a bomb. This way you do not have to rely on and external app running but rather just on creating an object and then closing it again to release all resources.

Lemme know

netraLINK
0
 
LVL 10

Expert Comment

by:Nitin Sontakke
ID: 6358946
Can you please post the single line of code in which you are using the shell command. I just want to have a look. I think there is a way to do it. But i would love to have a look first. If you don't mind.
0
 
LVL 9

Accepted Solution

by:
Valliappan AN earned 200 total points
ID: 6358962
Try this:

Shell "C:\Command.com /C pkzip.exe zipfile zipspec"

Hope this helps.
0
 
LVL 10

Expert Comment

by:Nitin Sontakke
ID: 6359070
Exactly, I was going to suggest the same as "valli_an" has already suggested, after having a look at how "bsmiley" is using the Shell command.

I know for sure that the command given by "valli_an" will execute in background and will terminate automatically, as intended.

0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6359504
valli_an deserves the points, i think.
0
 
LVL 10

Expert Comment

by:Nitin Sontakke
ID: 6359538
Yes, of course. That's pretty natural, i suppose.
0
 

Expert Comment

by:netraLINK
ID: 6359553
didnt know that decision lies with us. Lay off it guys... Although I agree with you, maybe its best to let bsmiley decide. I hate to get notices of question updates and its crap like this. It takes 5 minutes of my time to let go of my work and look at the comments....

thanks

netraLINK
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6359841
netraLINK, i only said that, to me, that was THE answer, or puting in other words, that is the comment that i would post if i didn't get later to this thread.
No more no less.
Cheers
0
 

Author Comment

by:bsmiley
ID: 6360819
Thanks people!  That did the trick!
0
 
LVL 9

Expert Comment

by:Valliappan AN
ID: 6362438
Thanks all.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question