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

x
?
Solved

Closing VB after batch file has completed.

Posted on 2003-11-26
4
Medium Priority
?
558 Views
Last Modified: 2010-05-01
I have a VB program which launches a DOS (Shell) batch file in Windows XP. The batch file simply copies the user desktop to a server. The user receives a message box advising when this has process has started. The batch file runs perfectly and closes itself down as intended.

How do I get the VB program to display a message telling the user the backup is complete once the batch file has closed. A code example would be greatly appreciated and I really need this urgently, hence the high points.

Thank you.
0
Comment
Question by:comsult
[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
  • 2
4 Comments
 
LVL 28

Expert Comment

by:AzraSound
ID: 9826935
"Determining the End of a Shelled Application Using WaitForSingleObject"
http://www.mvps.org/vbnet/index.html?http://www.mvps.org/vbnet/faq/main/waitforsingleobject2.htm
0
 
LVL 2

Accepted Solution

by:
robbrownuk earned 2000 total points
ID: 9827319
Why do you need a batch file??


Can you not use the filecopy function in Visual basic?

'show the window here - let user know backup is in progress
FileCopy "C:\Documents and Settings\USERNAME\Desktop", "\\server\share\"
'show the 2nd window here - let user know backup is complete
End


Hope this helps,

robbrownuk
0
 

Author Comment

by:comsult
ID: 9827473
I was using a batch file as we had a different folder location for each day of the week, in effect seven batch files controlled by If statements.

FileCopy is such a simple and excellent idea. I have tried using it to copy my Desktop folder to my server but I get a Run-time error 75, path/file access error. I have checked the help but don't have any of the problems they suggest. Sorry I'm still quite new to VB, what am I missing ?

Thanks also to AzraSound, I have had a look at this solution but would like to go with FileCopy if I can get past the error.
0
 

Author Comment

by:comsult
ID: 9827966
Ignore my previous post, I realise now that FileCopy in its basic state can only handle one file at a time. I have expanded it to include directories and now have exactly what I need.

Thank you very much for the help.
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

610 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