|
-
Jan 16th, 2000, 10:12 AM
#1
Thread Starter
Member
I have this trouble to use shell command to sort a simple text file from Visual Basic:
Here is the Visual Basic code:
Private sub CmdSort_click()
dim StrCommandLine as string
StrCommandLine=App.Path & "\Zsortsum.bat"
shell strCommandLine, vbMinimized
end sub
The batch file "Zsortsum.bat" is following:
c:\winnt\system32\sort.exe <c:\smy.tmp> c:\sumdoc.srt
The problem is that I can not get the file
sumdoc.srt generated ( or created) after I executed the Visual basic program( there is not error message in VB) . I can have the sumdoc.srt file generate if I use the batch file in DOS system. Could you tell me why? Thanks a lot!!!
-
Jan 16th, 2000, 10:40 AM
#2
Hyperactive Member
You might be running into the following:
The shell command doesn't wait for the shelled program to finish before moving on to the next VB commands. Here is a tip in this site that shows you how to shell a program, particularly Dos, and then not continue until the Dos program has finished.
http://www.vbsquare.com/tips/tip280.html
Al.
------------------
A computer is a tool, not a toy.
<A HREF="mailto:[email protected]
[email protected]">[email protected]
[email protected]</A>
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
|