|
-
Jan 19th, 2000, 10:09 AM
#1
Thread Starter
Member
I want to use the shell command to sort a simple text file. here is the code:
dim strCommandLine as string
dim sngMark as single
strCommandLine=App.path &"\" & batchFile
shell strCommandLine, vbMinimizedFocus
sngMark=timer
do
DoEvents
Loop Until timer-sngMark>5 'or 10 to let it 'do its jod
The batchfile is following:
c:\winnt\system32\sort.exe <somefile> anyfile
here the somefile is just simple text file.
The problem is that after the vb program, there is no "anyfile" being generated. But I can generated 'anyfile' if I do that batchfile in Dos systems.
I really really really want to know why. please Help, Thank you for reading. Thanx a lot for answering.
-
Jan 19th, 2000, 09:16 PM
#2
Frenzied Member
Hmm this looks familiar:0
http://www.vb-world.net/ubb/Forum1/HTML/013787.html
------------------
Mark Sreeves
Analyst Programmer
[email protected]
A BMW Group Company
-
Jan 19th, 2000, 09:24 PM
#3
-
Jan 19th, 2000, 10:40 PM
#4
mhh.. seems to be ok. but change your do .. loop :
(this routine needs lower cpu-time)
[modul]
Public Declare Sub Sleep Lib "kernel32" _(ByVal dwMilliseconds As Long)
[YOUR SUB or FUNCTION]
dim strCommandLine as string
dim sngMark as single
strCommandLine=App.path &"\" & batchFile
shell strCommandLine, vbMinimizedFocus
sngMark=timer
do
DoEvents
sleep 200 'your programm now wait 0,2 sec
Loop Until timer-sngMark>5
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
|