Running a batch file from within VB6 code
I need to backup an access database from within VB6 code when the user clicks on a commandbutton named "Print". I am thinking that a seperate batch file would be ideal. How would one cause the batch file to run from VB? Once the batch file can be activated, I sho开发者_Python百科uld be able to use a simple xcopy command to copy the database to a removeable drive. All help greatly appreciated.
Shell("path-to-batch-file", vbHide)
Of course if you do not wish to hide it, here's a list of choices.
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.
精彩评论