NightGaunt
Active Members-
Posts
45 -
Joined
-
Last visited
About NightGaunt
- Birthday 09/09/1980
Profile Information
-
Location
New Jersey, USA
NightGaunt's Achievements
Seeker (1/7)
0
Reputation
-
command prompt ControlGetText
NightGaunt replied to struhlo's topic in AutoIt General Help and Support
If you are using a standard run command box StdoutRead should work for you. Check it out in the autoit help file it gives an example that is pretty easy to follow: ; Demonstrates StdoutRead() #include $foo = Run(@ComSpec & " /c dir foo.bar", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) While 1 $line = StdoutRead($foo) If @error Then ExitLoop MsgBox(0, "STDOUT read:", $line) Wend While 1 $line = StderrRead($foo) If @error Then ExitLoop MsgBox(0, "STDERR read:", $line) Wend MsgBox(0, "Debug", "Exiting...") -
Alright is there a more efficient way to search in auto-it? I've been using outside programs and letting them write out in to auto-it. But if there is a more efficient way to do the serach, inside of auto-it I'd be happy to use that. As an example, here is the best I have come up with in terms of searching in Auto-It. Granted the search I was performing was only two directories deep, so it was simple to do. But if I needed to search the system, is there a way to do that quickly and easily in Auto-it, or should I still call outside programs and write the data with StdoutRead? CODE $search = FileFindFirstFile($Directory & $Date & "*") While 1 $file = FileFindNextFile($search) ExitLoop WEnd FileClose($search) $Directory = $Directory & $File $Search = FileFindFirstFile($Directory & "\*.*") While 1 $File = FileFindNextFile($Search) $Search2 = FileFindFirstFile($Directory & "\" & $File & "\engietru.reg") if $Search2 > -1 then ExitLoop WEnd $Path = $Directory & "\" & $File & "\engietru.reg" FileCLose($search) FIleClose($Search2) Msgbox(0,"Here we go", $Path)
-
Have not been here in a while, but I guess when I need help I come crawling on back... Here is the issue $pWORA = ('W{ASC 058}\Ora01.102.en.001\dba\oracle.cmd{Enter}') Runwait(@ComSpec & ' /c Start "foo"',@SystemDir, @SW_HIDE) Winwait("foo","") WinSetState("foo","",@SW_HIDE) Controlsend("foo","","",$pWORA) That is a piece of the code I am using. The issue I have is this. My control send works fine in the US, but in Japan it fails ASCII issue. Now if I try to use a Send I run the risk of user interferance and I am forbidden by the client to stop the users from messing around. But if I control send the : key it comes up as a ; in the dos window. I tried setting the control send to 1, no effect. I tried using the {:} idea, no effect. And I tried the {Shiftdown} ; , no effect. So does anyone know a way I can solve this issue? My first thought was sending the information to a text document, but I run in to a similar character issue because of the Japanese machines.
-
I'm guessing CS = CounterStrike, headshot. This is why I don't play online games.
-
Window Coordinants Different, One Monitor To Another
NightGaunt replied to laphlaw's topic in AutoIt General Help and Support
Can't answer the second question about the AU3Record utility. But the first answer is, 2 is always better if you are using the AutoIt Window Info tool. By setting the Coord mode of the utility to client you can be precise. However this does not answer the specific question about the AU3Record Utility, but I do not use that too frequently. Sorry I can't help more. -
I think you are just missing 1 tiny piece. Opt ("WinTitleMatchMode", 4) Winsetstate("classname=Shell_TrayWnd","",@SW_HIDE) Sleep (5000) Winsetstate("classname=Shell_TrayWnd","",@SW_Show) I do believe setting that option will be all you need for your script to function.
-
The Code below is the complete code for what I am working on. I put it in for general tidying because I am still a novice and tips in general are welcome. First the primary issue. A client uses a remote connection string to 'wrap' oracle programs so that all environmental variable are loaded in to memory and then dumped at the completion of a program. This file is remote (as in on a server elsewhere) and can be changed by the oracle Admins at any time. Most programs that need oracle are then Wrapped in a *.CMD file that loads the variables needed and then executes the program at the end (Start, foo, "Program Name"). My issue is this. I am protecting a single execution of the program with a password (simple protection). If the correct password is given the connection to the Oracle environment is established, else the program will not work. Simply executing the program will cause a failure because the Oracle environment will not be loaded. So I wanted to use an Auto-It script to prompt for the password and if the proper password is given execute the command information needed. I don't want to just execute an existing CMD file because the user could simply execute that file and run the program, bypassing auto-it completely. Technically a user could still manually try to set up an oracle environment, but that is not likely. However, it seemed multiple uses of the Run command against various executions causes Auto-it to only temporarily write those values to memory (this was expected I just hoped it would not be the case) instead of holding the data until the completion of the script. It is for that reason at the end of the script the final function calls a command window, hides it, and sends all the needed commands to that window. This method works; however I would prefer a cleaner way of doing this. If anyone has any ideas or suggestions as to how to load this in to a single memory block that is executed with all variables set please let me know. Keep in mind because of the location and changes of the command wrapper piece I can not simply copy it's functionality. The file is dynamically changing so I can only call the file. -Any Ideas? #include<GUICONSTANTS.AU3> #include<Function_List.AU3> ;Include for Function_List is functions that I parsed to bottom of script. ;Variables $tLog = "C:\Program Files\ISI\ISIPublisher\Logs\PassFail.txt" $setting = "123456a" $pISI = ('{ASC 034}C{ASC 058}\Program Files\ISI\ISIPublisher\ISIPublisherAdmin.exe{ASC 034}{ENTER}') $pWORA = Client Sensitive (path to CMD file to set Oracle settings) $pSet = Client Sensitive (sets oracle home) $pImage = ("C:\Program Files\ISI\ISIPublisher\images\ISIPublisher.JPG") $pISIPath = (@ProgramFilesDir & "\ISI\ISIPublisher") $gWinText = ("Admin Password") $gPrompt = ("Please Enter the Admin Password for ISIPublisher Admin") ;Gui Setup GuiCreate($gWinText,375,100,-1,-1) GuiSetIcon($pISIPath & "\ISIPublisherAdmin.exe",0) ;Menu Setup GuiCtrlCreateMenu("&Info"); Currently awaiting User Specs. ;Label Setup GuiCtrlCreateLabel(">Please enter the Admin password for the Application ISIPublisher Admin<", 5, 5,400) ;Edit Box $iPassInput = GuiCtrlCreateInput("", 50, 20,250,20,$ES_CENTER+$ES_PASSWORD) ;Buttons $bDone = GuiCtrlCreateButton("Done", 50, 50, 50, 25, $BS_DEFPUSHBUTTON) $bCancel = GuiCtrlCreateButton("Cancel", 250, 50, 50, 25) ;Set State GuiSetState(@SW_SHOW) GuiSetState($GUI_FOCUS) While 1 $msg = GUIGetMsg() Select Case $msg = $bDone $sIPass = GUICtrlRead($iPassInput) Select Case $sIpass = "" msgbox(48,"Empty Password","Password can not be left blank," & @CRLF & "please input a password and try again.") case $sIpass = $setting guisetstate(@SW_HIDE) SplashImageOn("ISI Admin Start", $pImage) _ISIExecute() winwait("ISIPublisher - Ad","") Exit case $sIpass <> $setting & $sIpass <> "" _logging($tLog, "Invalid Connection: " & @Mon & "/" & @MDAY & "/" & @YEAR & " ---ID--- " & _ @UserName) msgbox(48,"Invalid Login","Invalid Login!" & @CRLF & "Please see your local representive regarding the ISI Publisher Admin password.") ControlSetText($gWinText,"",$sIpass,"") ControlFocus($gWinText,"",$sIpass) EndSelect Case $msg = $bCancel msgbox(0,"Canceled","Execution canceled") Exit EndSelect If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend ;Primary Issue Below this Line! Func _ISIExecute() Runwait(@ComSpec & ' /c Start "foo"',@SystemDir, @SW_HIDE) Winwait("foo","") WinSetState("foo","",@SW_HIDE) Controlsend("foo","","",$pWORA) Controlsend("foo","","",$pSET) ControlSend("foo","","",$pISI) Controlsend("foo","","",'exit{enter}') EndFunc ;End Primary Issue func _Logging($Log, $Comment) FileOpen($Log, 1) FileWriteLine($Log, $Comment & @CRLF) Fileclose($Log) EndFunc As an aside I notice that there was no normal way to send shift characters to a dos window. I tried {shiftdown};{shiftup} to get a : and I tried +; and even changed to mode 1 and used : itself. The only way I found to get it was to call the ASC character, again if there is a more efficient method I am all eyes.
-
Simply Shut Down Program (kill)
NightGaunt replied to Erik.'s topic in AutoIt General Help and Support
That's odd... What about $PID = ProcessExists("Nstdw32.exe"); Will return the PID or 0 if the process isn't found. If $PID Then ProcessClose($PID) Msgbox (62,"",$PID & ": Pid Number") If you get back a 0 you'll know it isn't finding the process correctly. -
Simply Shut Down Program (kill)
NightGaunt replied to Erik.'s topic in AutoIt General Help and Support
The service is run under the system account, only an Admin to the box would have access to stop it from running. It may well even get it's permissions from the Domain Controller depending upon how they set-up the NetOp install. When NetOp runs in stealth mode it is designed not to be stopped at the console level without the proper access rights. It sounds like you are running the Student version, probably in a classroom or similar setting; hacking of this sort is probably just bad-press for auto-it. -
Throttle Bandwidth With Autoit?
NightGaunt replied to Bert's topic in AutoIt General Help and Support
@vollyman - Actually I'd call that standpoint good sense. Many clients are extremly restrictive, and yes applications do all kinds of crazy things. I concur, Uten's solution is certainly the best, the ones I gave were really 'last resort'. I'm glad there is a proper Auto-It solution. So fear not, no man with experience would call disallowing foreign products in a controlled environment stupid. Especially not without testing/licensing. Edit:Spelling -
You may need to be more specific. Or post some code. Are you trying to ControlFocus? Do you want to get text from a MsgBox that appeared? Most tools in Autoit can "get" a window anywhere. Msgbox or no. Some options may not be able to send data properly without a window having focus, but getting itsn't so much an issue. Show some code and we can probably help... Or describe your problem a little better, or hope someone with psychic powers comes on after me (it's possible).
-
Blocked System Keypress
NightGaunt replied to Autoit Is Cool's topic in AutoIt General Help and Support
Wow, the game Maple Story seems popular 'round these parts. I never played it but I guess it is just popular enough to play, but not good enough to play on it's own. ;-) Anyway do a search on the boards on nProtect. From what I have read about it here and there it doesn't seem like anyone has really solved the problem 100%. There were actually two posts about this yesterday too. -
Throttle Bandwidth With Autoit?
NightGaunt replied to Bert's topic in AutoIt General Help and Support
@Fossil Rock My guess is by Remote Users he is speaking of home users who maybe use Dial-Up or other connectivity. Sales Force Personel, home users, etc. I know the thought of people not using broadband at this point is anathema to IT, but it does exists. (madness isn't it). Edit: SP -
Two Scripts With The Same Hotkeys, A Solution?
NightGaunt replied to litlmike's topic in AutoIt General Help and Support
I know this isn't 100% the solution you are looking for but within a script you could call various functions, or a single function that changes it's actions based upon active window, existing window, pixel color, or any other variance. EX: Global $Window1 = "AutoIt Help" Global $Window2 = "Database Error" Global $Window3 = "InSource CS Login" HotKeySet("{PAUSE}", "_PausePress") While 1 Sleep(100) WEnd Func _PausePress() If WinActive($Window1) then Send("{!}") If WinActive($Window2) then Send("1") If WinActive($WIndow3) then ControlClick($Window3, "", "Edit1") Controlsend($Window3,"", "Edit1", "My Message String") EndIf EndFunc Yeah this really won't do anything functional, but it illustrates the point.