Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


How to call a bat file

Posted on 1999-07-10
Medium Priority
Last Modified: 2010-05-02
I am designing a program to do a discopy from one drive to another of same size.  I feel the file manipulation within VB would be time comsuming.  I am thinking on the line of a bat file for discopy command from dos to achieve this task. I am  not sure how to call a bat file through VB.  Your help would be appreciated.  If you know of a book that would be helpful please give the title and I will reference it.  

Thank you for your time.
Question by:Wrathorne
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

Accepted Solution

Torus earned 1600 total points
ID: 1523386
you can call shell to copy the file.

call shell("copy <source> <destination>", vbNormalFocus) to achieve same

you can use xcopy or diskcopy also by calling shell.


Expert Comment

ID: 1523387
you can also use shell to run your bat file also

call shell("YourbatFile.bat", vbNormalFocus)

Expert Comment

ID: 1523388
Better than Shell we have the all time usefull API shellexecute

Author Comment

ID: 1523389
Adjusted points to 400

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

722 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