Results 1 to 4 of 4

Thread: interesting question

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2000
    Location
    brooklyn
    Posts
    48

    Post

    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.

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Post

    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

  3. #3
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827

    Post

    Hmm, group deja vu

  4. #4
    Guest

    Post

    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
  •  



Click Here to Expand Forum to Full Width