
gr1fter
Active Members-
Posts
63 -
Joined
-
Last visited
Everything posted by gr1fter
-
just wanted to report that I am experiencing the same issue in WinPE x64 environment and only appears when compiled Autoit 3.3.14. If i go back to AutoIt 3.3.12.0 the script works perfect. So something changed in the version that is preventing it to run in this environment. My workaround for now is to use AutoIt 3.3.12.0 to compile these type of scripts (which is minimal for me). MESSAGE: The exception Illegal Instruction An attempt was made to execute an illegal instruction. (0xc000001d) occurred in the application at location 0x00007FF6CE279FD1. Click OK to terminate the program Like this Quote
-
Hello, I have this test script and its driving me crazy. I want to display a full screen GUI, but I can't get the labels to stay in position on different monitors. Here is my test code: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $gui = GUICreate("Test GUI", @DesktopWidth, @DesktopHeight, 0, 0, BitOr($WS_CAPTION, $WS_SYSMENU, $WS_POPUP, $WS_MAXIMIZE)) GUISetState (@SW_LOCK) GUISetBkColor(0xFFFFFF) ;Labels $mainlabel_line1 = GUICtrlCreateLabel("This is a test,", @DesktopWidth/3-450, @DesktopHeight/2-250, 310, 35) $mainlabel_line2 = GUICtrlCreateLabel("I want this label to stay in the same position on multiple resolutions",@DesktopWidth/3-450, @DesktopHeight/2-180, 675, 100) $font = "Arial" GUICtrlSetFont ($mainlabel_line1,22,1000,"",$font) GUICtrlSetFont ($mainlabel_line2,22,1000,"",$font) GUISetState(@SW_ENABLE) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd on the machine I am creating the script, it works great and shows correctly. This is on 1920x1200 resolution. When i go to a machine that is 1280x1024 and run the script, all the labels get messed up. I posted screenshots of what it looks like. Is there anyway that I can have my labels set no matter what resolution I go to? Thanks,
-
_FileListToArrayRec - exclusion issues
gr1fter replied to gr1fter's topic in AutoIt General Help and Support
I'm not sure what is going on with the filter, but this is working, so I'm happy! #include <File.au3> $logfilename="D:\test.log" FileDelete("D:\test.log") EmptyFolder("D:\test") Func EmptyFolder($FolderToDelete) $AllFiles=_FileListToArrayRec($FolderToDelete,"*", 1, 1, 1, 1) If IsArray($AllFiles) Then For $i = 1 To $AllFiles[0] If StringInStr($AllFiles[$i],".txt") <> 0 Or StringInStr($AllFiles[$i],".log") <> 0 Then $delete = "skipped" _FileWriteLog($logfilename,$FolderToDelete & "\" & $AllFiles[$i]& " =>"&$delete & @CRLF) Else $delete = "deleted" _FileWriteLog($logfilename,$FolderToDelete & "\" & $AllFiles[$i]& " =>"&$delete & @CRLF) EndIf Next EndIf EndFunc -
#include <File.au3> $logfilename="D:\test.log" FileDelete("D:\test.log") EmptyFolder("D:\test") Func EmptyFolder($FolderToDelete) $AllFiles=_FileListToArrayRec($FolderToDelete,"*|*.log;*.txt", 0, 1, 1, 1) If IsArray($AllFiles) Then For $i = 1 To $AllFiles[0] $delete = FileDelete($FolderToDelete & "\" & $AllFiles[$i]) _FileWriteLog($logfilename,$FolderToDelete & "\" & $AllFiles[$i]& " =>"&$delete & @CRLF) Next EndIf EndFunc I am trying to delete files in a directory by exclude all log and text files. The code above is working fine for the root files, but its not using the exclusion for recursive folders, it is just deleting everything. Is there something I am missing here? I have the option set to search in all subfolders (unlimited recursion) but that doesnt appear to be working for me. Thanks,
-
Thank you very much. I love that there are multiple ways to reach an end goal. You were correct on the StringRegExp, it is doing it faster and it appears that it is averaging out correct. Thanks again!
-
I'm having difficulties with this script I am creating. Arrays seem to be my hardest learning curve but I'm trying to get better... what i am trying to do is this. I have a job that is creating a log file, the contents example of the log are like this: 2014-10-30_1132 AM,test,H142640E4,Computer ,11.231.42.101,Name,11:31:17:109,11:31:25:389,11:31:37:775,11:31:39:164,22,9 2014-10-30_1140 AM,test,H142640E4,Computer ,11.231.42.101,Name,11:39:56:516,11:40:03:652,11:40:07:583,11:40:08:971,12,800 2014-10-30_1140 AM,test,H142640E4,Computer ,11.231.42.101,Name,11:39:56:516,11:40:03:652,11:40:07:583,11:40:08:971,12,12 2014-10-30_1140 AM,test,H142640E4,Computer ,11.231.42.101,Name,11:39:56:516,11:40:03:652,11:40:07:583,11:40:08:971,12,4552 the only number i need in these values are the last numbers after the last comma. I wrote this script and so far it is getting me exactly what i need, however I don't know where to go from here, because I want to add these numbers together and divide them by the number of entries (get the average) This is my current code: #include <File.au3> #include <Array.au3> Global $log= "C:\times.log" Global $aArray = 0 Global $aTimes = 0 getaverage() Func getaverage() If Not _FileReadToArray($log, $aArray, 1) Then MsgBox(48, "", "There was an error reading the file. @error: " & @error) Else MsgBox(64, "GetTime Info","Number of entries that have been logged: " & $aArray[0]) For $i = 1 To UBound($aArray) - 1 $aTimes = StringSplit($aArray[$i],",",1) MsgBox(64, "GetTime Info","Time in Seconds: " & $aTimes[12]) Next EndIf EndFunc Am I on the right track or doing this completely wrong? Thanks!
-
How to store a count? Summary of executed actions?
gr1fter replied to gr1fter's topic in AutoIt General Help and Support
hello thanks for you help! When i did $iPass=+ 1, it was only giving me a 1 at the end of my script. I modified it to $iPass=$iPass+ 1 in the loop and it worked! I was thinking way above and beyond for how to accomplish this task haha. Thanks again -
Hello, Below is an example script, what I am looking to do is have a text file with a list of data. When i cycle through that list of data, I would like to summarize that actions that take place. So say for every $x there is either an Error 0 or Error 1. At the end of the script how can summarize how many times Error 0 ran and how many times Error 1 ran. Thanks, #Include <File.au3> Global $read $logdir = @ScriptDir & "\test.log" FileOpen($list) If Not _FileReadToArray($list, $read) Then MsgBox(48,"Summary", " Error reading list.") Exit EndIf For $x = 1 to $read[0] $commmand = "example.exe /" & $read[$x] $return = Run ($commmand,@ScriptDir,@SW_HIDE) If $return = 0 Then _FileWriteLog($logdir, "Error 0") ElseIf $return = 1 Then _FileWriteLog($logdir, "Error 1") Else Exit EndIf Next
-
Thanks for all the replies! I do believe I have enough info to get me on my way, I work more on this tomorrow. Thanks again!
-
hello, I have a log file that I am trying to get data from: Bytes : 259.90 m 122.27 m 137.63 m 0 0 0 Bytes : 100.00 m 96 m 137.63 m 0 0 0 Bytes : 3.90 m 2.27 m 137.63 m 0 0 0 Bytes : 59.90 m 122.27 m 137.63 m 0 0 0 Bytes : 200.90 m 32.27 m 137.63 m 0 0 0 Bytes : 350.70 m .27 m 137.63 m 0 0 0 How would i go about reading only the second set of "m" numbers: I want to return from above: 122.27 m 96 m 2.27 m 122.27 m 32.27 m .27 m so far i only been able to read each line using FileReadLine, but i do not know how to read the second set of numbers because the data / spaces is dynamic and never the same so not quite sure how to capture that info. any help would be greatly appreciated. Thanks,
-
help retrieve a value from a text file
gr1fter replied to gr1fter's topic in AutoIt General Help and Support
Thanks for your help -
help retrieve a value from a text file
gr1fter replied to gr1fter's topic in AutoIt General Help and Support
Sweeet! Did not see that one. This is what I did and it worked perfectly #Include <String.au3> $file = FileRead("C:\test.log") $aArray1 = _StringBetween($file, "<ExitCode>","</ExitCode>",-1) MsgBox(48,"",$aArray1[0]) -
Hello. I have a log file: Example of text file THERE ARE LOTS OF VALUES IN THIS TEXT FILE BUT I ONLY WANT TO RETRIEVE WHAT IS IN BETWEEN THE EXIT CODE VALUES <ExitCode>14566</ExitCode> I would like to search that log file and only get what is between the <ExitCode>??????</ExitCode> markers. Can you help me with this please, I have an example and I can find the position in number format, but I dont know where to go from there to get the actual value. Do i want to string left from there?? $file = FileRead("C:\test.log") $result = StringInStr($file, "</ExitCode>") if $result then MsgBox(0, "Found it", "Found it at character position: " & $result) Else MsgBox(0, 'Not Found', "String Not Found") EndIf Thanks,
-
Active Directory UDF - Help & Support
gr1fter replied to water's topic in AutoIt General Help and Support
Thanks, but i think i got it. I had to change this to For $iIndex = 1 To $adOU[0][0] to For $iIndex = 2 To $adOU[0][0] and it skipped the first line and got me where i needed. -
Active Directory UDF - Help & Support
gr1fter replied to water's topic in AutoIt General Help and Support
water or anyone is it possible to exclude the root directory from the _AD_GetAllOUs array? example script: [__CODE_PROTECTED]PGJyIC8+CjxiciAvPgo7IE9wZW4gQ29ubmVjdGlvbiB0byB0aGUgQWN0aXZlIERpcmVjdG9yeTxiciAvPgpfQURfT3BlbigpPGJyIC8+CjxiciAvPgpHbG9iYWw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ED] If i cycle through the message boxes, i dont want the first one to be shown which is the root. Thanks, -
Active Directory UDF - Help & Support
gr1fter replied to water's topic in AutoIt General Help and Support
Hello, What I am looking to do is query all the SubOus of a container. Is _AD_GetObjectsInOU the function im looking for? Most of the examples I see are for user info, I only want to get organizationalUnit list of SubOUs on a given container. Can someone help me out in the right direction? Thanks, EDIT: I apologize, I did not see _AD_GetAllOUs. I was able to get what I needed. Thanks, -
list all lines of code in the editor?
gr1fter replied to gr1fter's topic in AutoIt General Help and Support
WOW, that helped a lot. Thanks for a quick response! -
Hello, i am trying to debug an application I am running, I have about 700 lines of code that I have written, but when i run the script when compiled it says there is an error on line 6295. How can i find that line? I am assuming it is part of the Included files. can this be done easily, with a setting i am missing? Thanks!
-
case selection with wild card or LIKE expression?
gr1fter replied to gr1fter's topic in AutoIt General Help and Support
I got it now. Thank you very much! -
case selection with wild card or LIKE expression?
gr1fter replied to gr1fter's topic in AutoIt General Help and Support
That works great thank you very much, I understand StringInstr part but can you explain to me the <> 0 part and why that there makes it work. -
Hello, I was wondering if I could get help on Case expressions. I understand the logic behind exact matches but I could use some help on Case with Like statements. Here is an example: Select Case $var = "Model 1" MsgBox(0, "", "First Case expression was true") Case $var2 = "Model 2" MsgBox(0, "", "Second Case expression was true") Case $var3 = "Model 345923928039823908233ABCDEFGHIJKLMNOP" MsgBox(0, "", "Third Case expression was true") Case Else MsgBox(0, "", "No preceding case was true!") EndSelect on $var3 i would like to detect that Case by a LIKE statement for the long Variable. Maybe only read the Model 3 or Model 345 and it is a match. Thanks for any help provided
-
Thanks for the help guys. I admit that I am not an expert in AutoIT, but I have wrote applications and code, I just am not familiar with UDFs and reading what other people have coded. I really appreciate you giving me some examples and pushing me in the right directions. Arrays have always been a trouble for me.
-
I did try searching for examples but all the search responses usually point to just the UDF. In its basic form i just did this: Global $sInclude_List,$iReturn,$iRecur,$iSort,$iReturnPath,$sExclude_List $sInitialPath = "C:\Documents and Settings" _RecFileListToArray($sInitialPath, $sInclude_List = "*", $iReturn = 2, $iRecur = 1, $iSort = 0, $iReturnPath = 1, $sExclude_List = "") and that runs and does not display anything. So i have a feeling that I am way off point.
-
Thanks for the UDF! I have been messing with it and I cannot even get the basics to work. Is it possible to provide me an example of how the UDF works correctly, cause whatever I am doing is wrong and the script runs successful but does not return anything. Much appreciated.