|
-
Oct 17th, 2001, 06:59 AM
#1
Thread Starter
Junior Member
Waiting for a Shelled Program to Finish
I went to this thread and used the code found at the link below but there was a compile error.
Pausing until shell unzip has completed
--------------------------------------------------------------------------------
http://www.vb-world.net/tips/tip5.html
The variable ret& is not defined. Can I just go ahead and define it?
Is this supposed to be a long variable? Why is there an amperstamp after it?
Public Sub ExecCmd(cmdline$)
Dim proc As PROCESS_INFORMATION
Dim start As STARTUPINFO
'Initialize the STARTUPINFO structure:
start.cb = Len(start)
'Start the shelled application:
ret& = CreateProcessA(0&, cmdline$, 0&, 0&, 1&, _
NORMAL_PRIORITY_CLASS, 0&, 0&, start, proc)
'Wait for the shelled application to finish:
ret& = WaitForSingleObject(proc.hProcess, INFINITE)
ret& = CloseHandle(proc.hProcess)
End Sub
Please Help!!!
-
Oct 17th, 2001, 07:13 AM
#2
Member
Open "flag.txt" For Output As #2
Print #2, "1"
Close #2
Open "test.bat" For Output As #1
command="Your command"
Print #1, Command
Print #1, "del flag.txt"
Close #1
Exists = Dir("flag.txt")
Shell ("text.bat")
Do While Exists <> ""
DoEvents
Exists = Dir("flag.txt")
Loop
-
Oct 17th, 2001, 07:17 AM
#3
Yes, just define it. (inside the sub)
Dont bother with the type, it isn't particularly important (although in this case it should be long).
-
Oct 17th, 2001, 07:21 AM
#4
Thread Starter
Junior Member
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
|