Results 1 to 6 of 6

Thread: Opening batch file inside my app?

  1. #1

    Thread Starter
    Addicted Member Stephen Bazemore's Avatar
    Join Date
    Aug 2000
    Location
    North Carolina
    Posts
    158
    Is there anyway that I can load a *.bat file into my project? Ok, here's what I've got. My program creates a batch file, and executes it. Instead of having the .bat file open outside of my program, I would like it to acctually open inside my program. If possible I would like to just have my program do what the batch file does. So I guess this is question #2. Is there anyway that I can have my program execute DOS commands but not open a dos window?



    If I confused anyone I'm sorry.. Just cant think of any other way to explain it. Any and all help is appreciated.
    Stephen Bazemore
    Email:[email protected]

  2. #2
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    You could just hide the dos window:

    Code:
    x = Shell("MyBat.Bat", VbHide)
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  3. #3

    Thread Starter
    Addicted Member Stephen Bazemore's Avatar
    Join Date
    Aug 2000
    Location
    North Carolina
    Posts
    158
    Yes, I know. That is what I'm currently doing. The main reason I want to be able to do this inside my app is so I can add a progress bar, ect.. so the user will know how long is left ect..
    Stephen Bazemore
    Email:[email protected]

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    It depends what the batch file does. Tell us what the batch file does and maybe you can code that into your program without DOS.

  5. #5

    Thread Starter
    Addicted Member Stephen Bazemore's Avatar
    Join Date
    Aug 2000
    Location
    North Carolina
    Posts
    158
    My program is similar to like Winrar. It takes files that have been split up like that and puts them back together.

    this is the code that I currently have. And it works. I just want to be able to do the same thing inside my program, without having to use the batch files.

    Code:
    Open App.Path & "\MergeFiles.bat" For Output As #1
            Print #1, "@echo off"
                For x = 0 To lstFiles.ListCount - 1
                If x = 0 Then Print #1, "Copy /b " & Chr(34) & lstFiles.List(0) & Chr(34) & " " & Chr(34) & MergeOutput.FileName & Chr(34): x = 1
                If lstFiles.ListCount = 1 Then GoTo endit
                    Print #1, "Copy /b " & Chr(34) & MergeOutput.FileName & Chr(34) & "+" & Chr(34) & lstFiles.List(x) & Chr(34) & " " & Chr(34) & MergeOutput.FileName & Chr(34)
                Next x
                Print #1, "Merged Successfully!"
                Print #1, "Cls"
                Print #1, "Exit"
                
        Close #1
        Shell App.Path & "\MergeFiles.bat", vbMinimizedNoFocus
    Any ideas? any help is appreciated.
    Stephen Bazemore
    Email:[email protected]

  6. #6

    Thread Starter
    Addicted Member Stephen Bazemore's Avatar
    Join Date
    Aug 2000
    Location
    North Carolina
    Posts
    158
    Any of the guru's happen to know if this is possible? Megatron, Matthew... anyone?
    Stephen Bazemore
    Email:[email protected]

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