|
-
Jun 30th, 2000, 03:41 AM
#1
Thread Starter
Addicted Member
I'm Running a DOS Appl which I have in vbHide and i am redirecting the output to a file.
ExecHandle = Shell(BatFile, vbHide) ' run the bat
1) How colud i know if my bat file is finished executing ?? ( i want to read the output).
2) How do i close Dos appl??
Best Regards
-
Jun 30th, 2000, 06:43 AM
#2
Lively Member
1. At the end of your bat, create a file (like Finish.txt)
In your app, test the existence of this file. When it existe, you know that the app has finish. (don't forget to delete this file before the next call to the Dos app)
2. I working on..
-
Jun 30th, 2000, 06:49 AM
#3
Lively Member
1. see up
2. maybe in using the senkey but i don't know if it work because the app is hiden
Code:
ExecHandle = Shell(BatFile, vbHide)
'
' Wait the finishing of the Dos App
'
AppActivate ExecHandle
SendKeys "%{F4}", True
-
Jun 30th, 2000, 08:59 AM
#4
Lively Member
Another way
Code:
Global Const SW_SHOWNORMAL = 1
Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Sub MyProc()
'
'
ExecHandle = Shell(BatFile, vbHide) ' run the bat
'
' Waiting the end of the Dos App
'
' Show the Dos window
ShowWindow ExecHandle, SW_SHOWNORMAL
' Active the Dos window
AppActivate ExecHandle
' Close the Dos window (send Alt-F4)
SendKeys "%{F4}", True
'
'
'
End Sub
-
Jul 2nd, 2000, 01:04 AM
#5
Thread Starter
Addicted Member
KWell - Thanks, I will try it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|