Results 1 to 12 of 12

Thread: Redirecting Dos IO

  1. #1

    Thread Starter
    Addicted Member KrishnaSantosh's Avatar
    Join Date
    Feb 2001
    Location
    Coimbatore
    Posts
    210
    Hello

    Can Any Please Say Me How To Redirect Dos Input and Output To My Form. I Know That This can Be Done, Byt I Dont Know The Exact Procedure.

    Can Anyone Please Help Me.

    My Email Is : [email protected]

  2. #2
    Member
    Join Date
    Nov 2000
    Location
    Manila, Philippines
    Posts
    51
    Hmmm.... In all my VB programming years (1.75 years), I`ve always wondered about this... until I finally gave up.

    I have found an alternative tho`....
    Look up, FileSystemObjects or FileSystemObject (damn! I cant spell right!)

    Take a reference to it in your project: Microsoft Scripting Runtime

    then you can:

    Dim objFolder as Scripting.Folder
    Dim objFileSysObj as Scripting.FileSystemObject
    Dim objFile as Scripting.File

    ...these objects are capable of file operations. You will only need to emulate the terminal window of the DOS Command prompt.

    as of the present, I have not discovered another way of solving this.... but if ever you do, would you please inform me? I`d really like to know.


    email: [email protected]
    (You dont have to mail me if this is taking your time.. I dun wanna bother ya`, but if you like, you can mail me)

    Hope that helps
    Programmers dont byte, they just nibble a bit.

  3. #3
    Lively Member Bios's Avatar
    Join Date
    Nov 1999
    Location
    Richton Park, IL, USA
    Posts
    71
    I've only found one way, and it is a really really unstable, and ammature way of doing this...you can get the text in the dos council window by shelling to whatever your running in a Normal window (it can't be fullscreen), and then using sendkeys to press CTRL+C,and get the data out of the clipboard, and vice versa for sending data to it (set the clipboard and then sendkeys CTRL+V)

    This can work error free as long as you use API to find the window of the command prompt, and get it's caption, and appactivate that title.

    I know this is "BOOTLEG", but oh well

    Hope this helps atleast alittle,
    Bios

  4. #4
    New Member
    Join Date
    Feb 2001
    Location
    india
    Posts
    3
    thanks all

    but i thought and still think that there is some trick with the CreateProcess API would do some good.What do you ppl think.
    oops! prak is back!!!

  5. #5

    Thread Starter
    Addicted Member KrishnaSantosh's Avatar
    Join Date
    Feb 2001
    Location
    Coimbatore
    Posts
    210
    Thanks all .
    I posted my reply by mistake from prakashkrishna's thread who is my friend.
    I think createProcess would work.what do u think

  6. #6
    Member
    Join Date
    Nov 2000
    Location
    Manila, Philippines
    Posts
    51
    The CreateProcess function creates a new process and its primary thread. The new process executes the specified executable file.


    Does this sound like it can work? I dont think so.
    It could be another Win32 API ...but definitely not CreateProcess.
    Programmers dont byte, they just nibble a bit.

  7. #7
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628
    i leave the details to you, since i have no clue if it will work.
    Get the standard input and output handles (using the getstdhandle api call) and use writeconsole and readconsole api to read and write data to the dos window open. It SHOULD read and write to and from an open dos window since it is a console text window. I have never tried it however.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  8. #8

    Thread Starter
    Addicted Member KrishnaSantosh's Avatar
    Join Date
    Feb 2001
    Location
    Coimbatore
    Posts
    210
    Thanks,

    But I Dont want DoS Window To Open. It Should Be Invisible. But The Input Should Be Provided And The Output should Be Obtained Using Custom Form. I've Seen these In FreeJava(RealJ), Kawa, etc..., though haven't got it myself yet.

  9. #9
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628
    Well you could always open the window minimized, then use api to hide it: showwindow(hwnd, sw_hide)
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  10. #10

    Thread Starter
    Addicted Member KrishnaSantosh's Avatar
    Join Date
    Feb 2001
    Location
    Coimbatore
    Posts
    210
    Yeah Thanks.

    And If It Is Hidden How To Send The Input And Get The Output.

  11. #11
    Hyperactive Member noble's Avatar
    Join Date
    Nov 2000
    Location
    Philly
    Posts
    471
    if you go to planet source code, there is a module
    somebody wrote in vb that redirects all the output to
    your program. StdShellLib or something it's called
    but it works great!
    Bababooey
    Tatatoothy
    Mamamonkey

  12. #12
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628
    just cuz you can't see it doesnt mean it isnt there. all api calls will still work on it.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

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