mrrlg Posted November 24, 2004 Posted November 24, 2004 Is there a way to issue multiple commands, in sequence, within a single dos session. Here is what I am attempting to script. Open a dos window, change to a directory, issue a command, type in a password (it will not show on the screen) and then issue a series of @ statements, one after another. Here is what it looks like on paper: cd %Oracle_Home%\rdbms\admin sqlplus "sys as sysdata" enter password: SQL> @utlgdk.sql SQL>@prvtgdk.plb SQL>@prvtbfla.plb SQL>@catexp.sql SQL>@catproc.sql EXIT
mrrlg Posted November 24, 2004 Author Posted November 24, 2004 Thanks Larry, I will look this up, I used to be in the flower business myself, company got bought up by a larger one and there was someone else doing my job. Good luck in your endeavors.
mrrlg Posted December 2, 2004 Author Posted December 2, 2004 No matter what I try I can't get past the first four lines of this script. Opt("WinTitleMatchMode",4) Run("cmd") WinWait("ClassName=C:\Windows\system32\cmd.exe") $hWnd = WinGet Handle("ClassName=C:\Windows\system32\cmd.exe") ControlSend($hWnd,"","C:\oracle\ora81\rdbms\admin","cls{enter}") The above line doesn't appear to execute. I'm left with an open dos window with the promt in the drive and directory in which the autoit script is contained.
SlimShady Posted December 2, 2004 Posted December 2, 2004 (edited) This works very well. Definitely useful. Opt("WinTitleMatchMode",4) Run("cmd", @SystemDir, @SW_MINIMIZE) WinWait("classname=ConsoleWindowClass") $hWnd = WinGetHandle("classname=ConsoleWindowClass") ControlSend($hWnd,"","","cls{ENTER}") ControlSend($hWnd,"","","dir{ENTER}") ControlSend($hWnd,"","","pause{ENTER}") @mrrlg: Try this. Opt("WinTitleMatchMode",4) Run("cmd", @SystemDir) WinWait("classname=ConsoleWindowClass") $hWnd = WinGetHandle("classname=ConsoleWindowClass") ControlSend($hWnd,"","","C:\oracle\ora81\rdbms\admin{ENTER}") ControlSend($hWnd,"","","cls{ENTER}") Edited December 2, 2004 by SlimShady
mrrlg Posted December 2, 2004 Author Posted December 2, 2004 I have tried this script in a couple of different ways and it still hangs at the ControlSend line. I have tried it using ConsoleWindowClass and by inserting the name of the window shown in parentheses on the right and it makes no difference. What am I missing? Opt("WinTitleMatchMode",4) Run("cmd", @SystemDir) WinWait("classname=ConsoleWindowClass"); (C:\Windows\system32") $hWnd = WinGetHandle("Classname=ConsoleWindowClass"); (C:\windows\system32") ControlSend($hWnd," "," ","C:\oracle\ora81\rdbms\admin{enter}") ControlSend($hWnd," "," ","cls{enter}")
scriptkitty Posted December 2, 2004 Posted December 2, 2004 remove the spaces:Opt("WinTitleMatchMode",4)Run("cmd", @SystemDir)WinWait("classname=ConsoleWindowClass"); (C:\Windows\system32")$hWnd = WinGetHandle("Classname=ConsoleWindowClass"); (C:\windows\system32")ControlSend($hWnd," "," ","C:\oracle\ora81\rdbms\admin{enter}")ControlSend($hWnd," "," ","cls{enter}")this work?Opt("WinTitleMatchMode",4) Run("cmd", @SystemDir) WinWait("classname=ConsoleWindowClass"); (C:\Windows\system32") $hWnd = WinGetHandle("Classname=ConsoleWindowClass"); (C:\windows\system32") ControlSend($hWnd,"","","C:\oracle\ora81\rdbms\admin{enter}") ControlSend($hWnd,"","","cls{enter}") AutoIt3, the MACGYVER Pocket Knife for computers.
mrrlg Posted December 2, 2004 Author Posted December 2, 2004 Opt("WinTitleMatchMode",4) Run("cmd", @SystemDir) WinWait("classname=ConsoleWindowClass") $hWnd = WinGetHandle("Classname=ConsoleWindowClass") ControlSend($hWnd,"","","C:\oracle\ora81\rdbms\admin{enter}") ControlSend($hWnd,"","","cls{enter}") I took your code and inserted it into a clean file, saved it as an AU3 file. Used Run Script to launch it and it delivers a dos window with a blinking cursor at C:\Windows\system32> I don't see the where the ControlSend command is working at all.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now