Expand|Select|Wrap|Line Numbers
- from win32com.client import *
- a = Dispatch("Wscript.Shell")
- a.Run("C:/cygwin/cygwin.bat");
- a.SendKeys ("cd D:/temp/code" + "{Enter}")
- a.SendKeys ("ls -lrt?" + "{Enter}")
Expected result: The entire script (commands) should be executed in the cygwin window regardless of any external application.
Result obtained: The current command executed is copied into the invoked window rather than at the cygwin prompt (i.e "ls -lrt" command is issued in the Notepad window.)
Thus what i intended to happen at cygwin prompt didnt happen completely.
How do i ensure that the command that i am issuing is executed in the window where in i need it. Why does this happen and How do i handle this situation?
Kindly guide me accordingly.
Thanks
BK