Hello Community,
I have a question : why , if I try to use AppActivate applied to cmd.exe it doesn't work?
My purpose is to run a VB script from Excel which opens a Telnet or an ftp session, then it gives commands using SendKeys method. I am using the following code:
'---------------------------------------------------------------
Dim p_ID
Dim FullPath As String
FullPath = "C:\WINDOWS\system32\cmd.exe"
p_ID = Shell(FullPath, 1)
AppActivate p_ID
Application.SendKeys "ABCDE", True
'---------------------------------------------------------------
Note that :
1.If I call a different program (e.g.: FullPath = "C:\WINDOWS\notepad.exe")
everything works.
2.If I use an object "WScript.Shell" I can apply object.Run "ftp....." , but login
fails.
3. If at first I open cmd.exe using : object.Run "cmd" and then I use:
Application.SendKeys "ABCDE", True it doesn't work very much.
Who has an idea? Thanks
diSangro