Results 1 to 3 of 3

Thread: problem with shell command

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    9
    I am trying to run this shell command
    Shell("C:\FORTRAN\TEST.EXE file1 file2 file3", 1)
    file1 and 2 are input files to run the test.exe and the output is printed in file3.

    file1,2 are selected from my commondialogbox1.filename
    file1=commondialog1.filename
    file2=commondialog1.filename
    file3=text1.text (out put file)

    at the shell command it is not able to read the file1 and file2 to run the exe file.

    anyhelp is greatly appreciated
    thanks
    p1


  2. #2
    Hyperactive Member Matt-D's Avatar
    Join Date
    Nov 1999
    Location
    Mettmann, Germany
    Posts
    305
    Hi p1,

    I don't know why it doesn't work, but you can try this:


    Command1_Click ()
    Dim X
    ...
    X = SHELL(".....)
    ...
    end Sub


    Perhaps the 'Dim X' and the 'X = ..' is missing.

    Good luck, Matt



  3. #3
    Lively Member
    Join Date
    Jan 2000
    Location
    Omaha, Ne
    Posts
    65
    if file1 and file2 and file3 have values for file names then you probably want to use them rather than hard coding file1,file2 and file3. Like this:
    Shell("C:\FORTRAN\TEST.EXE " & file1& " " & file2 & " " &file3, 1)

    Better yet concat your command string first and then call SHELL:
    dim cmd as string
    cmd = "c:\fortran\test.exe " & file1& " " & file2 & " " &file3
    shell(cmd,1)

    That help?

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