I'm working on a small application that i wanted to havce automate DOS t a certain degree. what I want is really very simple. I want a small VB form that will open DOS and then automatically load one of four commands (depending on which button is clicked) and wait for the output. The DOS window wouldn't even need to close itself.
I was able to bring up the DOS window but then I've been stuck with the whole passing keystrokes to it. Lateluy I've been trying to use AppActive but every time I try to use it, I get an error. Usually: 'Invalid Outside Procedure' / Run Time error 5. My MSDN Help is gimped so I've been trying to find out what i can online, and from what I've seen, I still can't figure out what I'm doing wrong.
here's the code I'm trying to make work - all I want it to do, is open the DOS window (which it does) and then load in and execute to change directory command:
Private Sub Form_Load()
Dim the_command As String
the_command = "command.com"
Shell the_command, vbNormalFocus
SendKeys ("cd c:\")
could someone *please* let me know where I'm going wrong on tis? It seems like this should be a sort of easy thing and I can't understand why I'm having such a hard time with it!
Please let me know if you need any other details / clarificatin - email@example.com