Rich69
October 12th, 2005, 08:36 AM
Hi all,
I have created this sub to open a DOS-Box and enter a command, but the function AppActivate is giving me problems: it cannot find the ProcessID:
Public Sub Command1_Click()
Dim retPointerID As Integer
Dim SendKeys As String
retPointerID = Shell("c:\winnt\system32\cmd.exe")
System.Threading.Thread.Sleep(500)
AppActivate("retPointerID")
SendKeys = "mkdir abcde"
SendKeys = "{ENTER}"
'close dos window:
'SendKeys("Exit", True)
'SendKeys("{ENTER}", True)
End Sub
Now my questions are: (1) Can you use AppActivate to open up an DOS box and execute commands, or (2) can I bypass the ProcessID thing by using another function like Application.Start?
Apologies if I am unclear; I am quite new to VB and programming and have already figured out some things with the help of already posted messages in this forum but I cannot find an answer to tackle this one.
Basically what I am trying to create is an executable that opens a DOS-box, starts gzip to zip a data file, then start Secure FTP to put that file on a remote server...so I thought let's start simple and cover the basics first
Thanks very much in advance for your advice!
I have created this sub to open a DOS-Box and enter a command, but the function AppActivate is giving me problems: it cannot find the ProcessID:
Public Sub Command1_Click()
Dim retPointerID As Integer
Dim SendKeys As String
retPointerID = Shell("c:\winnt\system32\cmd.exe")
System.Threading.Thread.Sleep(500)
AppActivate("retPointerID")
SendKeys = "mkdir abcde"
SendKeys = "{ENTER}"
'close dos window:
'SendKeys("Exit", True)
'SendKeys("{ENTER}", True)
End Sub
Now my questions are: (1) Can you use AppActivate to open up an DOS box and execute commands, or (2) can I bypass the ProcessID thing by using another function like Application.Start?
Apologies if I am unclear; I am quite new to VB and programming and have already figured out some things with the help of already posted messages in this forum but I cannot find an answer to tackle this one.
Basically what I am trying to create is an executable that opens a DOS-box, starts gzip to zip a data file, then start Secure FTP to put that file on a remote server...so I thought let's start simple and cover the basics first
Thanks very much in advance for your advice!