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

x
?
Solved

How to call a bat file

Posted on 1999-07-10
4
Medium Priority
?
352 Views
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.
0
Comment
Question by:Wrathorne
[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 2

Accepted Solution

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


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

you can use xcopy or diskcopy also by calling shell.



0
 
LVL 2

Expert Comment

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

call shell("YourbatFile.bat", vbNormalFocus)
0
 

Expert Comment

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

Author Comment

by:Wrathorne
ID: 1523389
Adjusted points to 400
0

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