当用户点击名为“Print”的命令按钮时,我需要从VB6代码中备份访问数据库。我在想一个单独的批处理文件是理想的。如何导致批处理文件从VB运行?一旦批处理文件可以激活,我应该能够使用简单的xcopy命令将数据库复制到可移动的驱动器。所有帮助非常感谢。
答案 0 :(得分:5)
Shell("path-to-batch-file", vbHide)
当然,如果你不想隐藏它,这里有一个选择列表。
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.