Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Launching a batch file from vb. Scheduling Batch files. 2

Status
Not open for further replies.

jlgdeveloper

Programmer
Joined
Jun 15, 2002
Messages
105
Location
US
Could anyone mention how to call a batch file from within vb?

In addition, do you have any idea how to automatically schedule batch files (not at logon etc), but say once per day for backup etc (without me writing a vb app to call it)?

How would I have setup (package and deployment wizard) call a batch file during deployment?

Appreciate it. Jonathan Galpin
 
To call a batch file from a VB program, I would use the Shell function. The first parameter to the Shell function would be the pathname of the bat (plus any parameters you wish to pass) file you wish to execute.

To have the PDW install program execute a batch file during installation, you probably will have to modify the Setup1 project (its a normal VB project), which normally would be in the following directory: C:\Program Files\Microsoft Visual Studio\VB98\Wizards\PDWizard\Setup1

I belive that most of the Windows OS family contain a task scheduler which you can configure to handle your backup issue. I'm on my 98SE machine at the moment, and it can be found (on this machine) at Start->Programs->Accessories->System Tools->Task Scheduler.


Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein


 
For scheduling a batch file to run it is rather simple. From the DOS prompt type 'at ?' it will list how to use the scheduler in most NT family windows as well as 98 Craig, mailto:sander@cogeco.ca

Remember not to name the Lambs...
It only makes the chops harder to swallow
 
Thank you for your reply's.

I use nt4.0 server os.

I have extensively modified the PDW Setup.Lst files to do what I need, but have not yet figured out the script needed to have it launch a batch file ie to install a service etc.

Would you have a code example?

Any code examples on the shell function (I am lazy, and you are good)?

Task Scheduler is not currently present on my machine, but the dos prompt method works. Thanks

Jonathan Galpin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top