MSDos


Posted by BJ on April 24, 2001 11:36 AM

Anyone know how to call a MSDOS, then fire a *.BAT file?
I can get it to work in Dos but would like to do it at a
certain time of the day via VB, but not sure how to fire
the BAT file within VB.

Tx..Bj

Posted by Jerid on April 24, 2001 12:31 PM

Hi Bj

Try this:

Dim ReturnVal
ReturnVal = Shell("C:\Temp\MyBatchFile.bat", 1)

Select the second parm value from below.

vbHide 0 Window is hidden and focus is passed to the hidden window.
vbNormalFocus 1 Window has focus and is restored to its original size and position.
vbMinimizedFocus 2 Window is displayed as an icon with focus.
vbMaximizedFocus 3 Window is maximized with focus.
vbNormalNoFocus 4 Window is restored to its most recent size and position. The currently active window remains active.
vbMinimizedNoFocus 6 Window is displayed as an icon. The currently active window remains active.

You can type Shell into your VB editor and press F1 to get the rest of the syntax.

Jerid



Posted by Bj on April 24, 2001 12:45 PM

You are the man! Thanks...Bj