2010-11-22 7 views
0

사용자가 "인쇄"라는 명령 단추를 클릭하면 VB6 코드 내에서 액세스 데이터베이스를 백업해야합니다. 나는 별도의 배치 파일이 이상적이라고 생각하고있다. VB에서 배치 파일을 실행하려면 어떻게해야합니까? 일단 배치 파일을 활성화 할 수 있으면 간단한 xcopy 명령을 사용하여 데이터베이스를 제거 가능한 드라이브에 복사 할 수 있어야합니다. 모든 도움이 크게 감사드립니다.VB6 코드 내에서 배치 파일 실행

+0

Offtopic하지만 사용자가 "백업"버튼을 클릭 할 때 응용 프로그램이 수행해야하는 작업은 무엇입니까? – Arvo

답변

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.