Jump to content

autoITnewbie

Active Members
  • Posts

    20
  • Joined

  • Last visited

autoITnewbie's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Hi, I know this is a stupid question =) but do you know when Autoit will works for mac or will Jon create one? =) or is there another free tool similar to Autoit that works for Mac? thanks
  2. I don't know what happened but I tried your script and here is what I got result
  3. Thanks everyone, I was able to collect the unicode passed from commandline using our inhouse tool into an ini file saved as Encoding of UTF-8 but now I have a problem another problem when I try to read it back or try to get certain value from that ini file. it does not show the characters. I tried to convert the ini file from unicode to ansi file using dos command "type" but when reading it, it does not show the correct characters =( I'm not sure if iniread does not support unicode or is it msgbox does not display unicode? Any thoughts?
  4. Hi, I need help. I tried to read some chinese character being passed thru command line but it doesn't seem to work. script example: If $CmdLine[0] = 0 Then Exit(1) $CmdVars = $cmdline for $x = 1 to $cmdline[0] msgbox (0,'','command line: '&$x&' - '&$cmdline[$x]) Next Exit running script: c:\temp\runUnicodeCmd.exe Trong tnh yu c?a h?n d?i
  5. Thank you Siao, you're the best !
  6. Hi, Does anyone know if AutoIT script can read file resource info by column? ie..company info or product name? thanks AD
  7. That's in the message they sent to us since we open a case with them.
  8. oh, thanks I'll try that. But we got the answer from symantec and they'll fix it =================================== Security Response is aware of a False Positive in some AutoIT scripts that are detected as MSN.Flooder http://www.symantec.com/security_response/...-050916-1048-99 Detection has been corrected in RR Seq 69177 and higher and should be available within an hour. Security Response has also made plans to publish a second set of certified definitions today with the corrected detections. ETA for the second LiveUpdate is 9PM.
  9. really? what version of autoit are you using to compile your scripts?
  10. Thank you Zedna, I tried to put the "#Compiler_UseUpx=n" in the script it it still detect as a virus =(
  11. Hi, does anyone have this problem. Most of my script are writen in AutoIT is now being detected as virus by Symantec antivirus with virus def date of 5/30/2007. what should I do now? Thanks A
  12. Yes, I tried it but it windows Vista (ui0detect.exe) block it from displaying it on logon user's desktop. I did some research on it and it has to do with the new security changes with session 0. Ui0detect.exe monitors the session 0 on desktop and any application sendding to session 0 will prompt to bring the user to the session 0 space to respond to the prompt.
  13. Hi, Does anyone know how to work around windows Vista to have message box show up on user desktop while script running as system context? Thanks
  14. Thanks all, but that's not what i'm trying to do but I found a way..(but haven't test it yet ) 1. read txt file line by line 2. write to temp file line by line if "not found" is not in that line 3. if found "Not found" that line - do a qualifier then update the linevar read earlier has "not found' with either "found" or "not Require" then write it to the temp file (keep the exact line only replace "Not Found" with something else) 4. Move on to read for the next line. sample of text file: ************************************************************** Machine Name Product Bulletin Q Number Reason Status PERSONAL-W36OO3 (172.20.5.91) WINDOWS XP PROFESSIONAL SP2 MS04-038 834707 File version is less than expected. [C:\WINDOWS\system32\browseui.dll, 6.0.2900.2180 < 6.0.2900.2518] NOT Found PERSONAL-W36OO3 (172.20.5.91) WINDOWS XP PROFESSIONAL SP2 MS04-041 885836 A required registry key does not exist. It is necessary in order for this patch to be considered installed. [sOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\KB885836\Installed] NOT Found PERSONAL-W36OO3 (172.20.5.91) WINDOWS XP PROFESSIONAL SP2 MS04-043 873339 File version is less than expected. [C:\WINDOWS\system32\hypertrm.dll, 5.1.2600.2180 < 5.1.2600.2563] NOT Found PERSONAL-W36OO3 (172.20.5.91) WINDOWS XP PROFESSIONAL SP2 MS04-044 885835 File version is less than expected. [C:\WINDOWS\system32\lsasrv.dll, 5.1.2600.2180 < 5.1.2600.2525] NOT Found PERSONAL-W36OO3 (172.20.5.91) WINDOWS XP PROFESSIONAL SP2 MS05-001 890175 File version is less than expected. [C:\WINDOWS\system32\hhctrl.ocx, 5.2.3790.1194 < 5.2.3790.1280] NOT Found Here is my script: ******************************************************** AutoItSetOption ( "TrayIconHide",1) Global $EVPscanIni = 'EVPscan.ini' Global $MBSAResults = 'Results.txt' Global $EVResults = 'EVResults.txt' Global $FileReadLnVar = '' ;//=====================================================================// ;//=====================================================================// ;//=====================================================================// ; Read results.txt line by line for "NOT FOUND" $TotalLine = FileCountLines($MBSAResults) $LineCt = 1 $FH = FileOpen($MBSAResults, 0) If $FH = -1 Then ; Check if file opened for reading OK Exit EndIf do ; read file until end of file (totallines) $FileReadLnVar = FileReadLine($MBSAResults, $LineCt) If @error = -1 Then ExitLoop ; end of file If StringInstr ($FileReadLnVar, 'NOT Found') then Global $ARTNumber = StringMid($FileReadLnVar,StringInStr($FileReadLnVar, 'MS'),8) Global $ARTtype = Iniread ($EVPscanIni, $ARTNumber, 'TYPE','NOTFOUND') if $ARTtype = 'NotFound' Then FileWriteLine($EVResults, $FileReadLnVar) else select case $ARTType = 'IE' or $ARTType = 'OFFICE' App_Patch($ARTNumber, $ARTType) case $ARTType = 'OS' OS_PATCH($ARTNumber, $ARTType) endselect EndIf else FileWriteLine($EVResults, $FileReadLnVar) endif $LineCt = $LineCt + 1 Until $cline = $totalLine FileClose($MBSAResults) Exit (0) ;//=====================================================================// ;//=====================================================================// ;//=====================================================================// Func FileCountLines($FileName) ; Count total lines in results.txt Local $N = FileGetSize($FileName) - 1 If @error Or $N = -1 Then Return 0 Return StringLen(StringAddCR(FileRead($FileName, $N))) - $N + 1 EndFunc ;//=====================================================================// Func App_Patch($ARTNumber, $ARTType) $ReqTypeVer = IniRead($EVPscanIni,$ARTNumber, 'TypeVersion','Notfound') $xReqTypeVer = Stringsplit($ReqTypeVer, ';') $x = 1 ;//----- Type Version(s) loop starts ----------------------------------// for $x = 1 to $xReqTypeVer[0] step 1 ; Check Type SP level if applicable $ReqTypeSP = IniRead($EVPscanIni, $ARTNumber&'-'&$xReqTypeVer[$x], 'TypeSP','Notfound') $xReqTypeSP = Stringsplit($ReqTypeSP, ';') $SysFileVer = GetFileVer($xReqTypeSP[1]) if CmbFileVer($SysFileVer) >= CmbFileVer($xRegTypeSP[2]) then if CmbFileVer($SysFileVer) < CmbFileVer($xReqTypeSP[3]) then ; Check UpdatedFiles $fTotal = IniRead($EVPscanIni, $ARTNumber&'-'&$xReqTypeVer[$x], 'Count','Notfound') ;//------ File(s) Check loop starts -----------------------------------// for $fileCt = 1 to $fTotal step 1 $FileVar = StringSplit(iniRead($EVPscanIni, $ARTNumber&'-'&$xReqTypeVer[$y], $count,'NF'),';') $Filecheck = CmpFileVer($count,$fileVar[1], $Filevar[2]) If $Filecheck = 1 then FileWriteLine($EVResults, $FileReadLnVar) Return() endif Next UpdateResults('Found') ;//----- File(s) Check loop ends --------------------------------------// else ; call update value UpdateResults('Patch Not Require') Return() EndIf else ; call update value UpdateResults('Patch Not Require') Return() Endif next ;//----- Type Version(s) loop ends ----------------------------------// EndFunc ;//=====================================================================// FUNC OS_PATCH($ARTNumber, $ARTType) $SysSPVer = StringRight (@OSservicepack, 1) if $sysSPver = '' then $sysSPver = 0 endif $ReqTypeSP = IniRead($EVPscan.ini, $ARTNumber&'-'@OSbuild, 'TypeSP', 'NotFound') $xReqTypeSP = Stringsplit($RegTypeSP, ';') if $SysSPVer >= $xReqTypeSP[1] Then if $SysSPVer < $xReqTypeSP[2] then $fTotal = IniRead ($EVPatchIni, $ARTNumber&'-'@OSbuild, 'count', 'NOTFOUND') ;//------ File(s) Check loop starts -----------------------------------// for $fileCt = 1 to $fTotal step 1 $FileVar = StringSplit(iniRead($EVPscanIni, $ARTNumber&'-'&$xReqTypeVer[$y], $count,'NF'),';') $Filecheck = CmpFileVer($count,$fileVar[1], $Filevar[2]) If $Filecheck = 1 then FileWriteLine($EVResults, $FileReadLnVar) Return() endif Next UpdateResults('Found') ;//----- File(s) Check loop ends --------------------------------------// else UpdateResults('Patch Not Require') Return() endif else UpdateResults('Patch Not Require') Return() endif endfunc ;//=====================================================================// Func CmpFileVer($count, $fileName, $FileVersion) $SysFileVersion = Get_File_ver($fileName) if CmbFileVer($SysFileVersion) >= CmbFileVer($Fileversion) then IniWrite('EVPatchDebug.ini', 'INFO', 'SystemFile'&$count, $fileName&';'&$SysFileVersion) msgbox(0,'','match') return (0) endif if CmbFileVer($SysFileVersion) < CmbFileVer($Fileversion) then IniWrite('EVPatchDebug.ini', 'INFO', 'SystemFile'&$count, $fileName&';'&$SysFileVersion) msgbox (0,'','less') return (1) Endif endfunc ;//=====================================================================// Func GetFileVer($x) $i = Stringsplit($x,'%') ; splitting PathVar '%' - [2] is envvar - [3] path and file $p = EnvGet($i[2]) ; get environment path $FileName = ($p&$i[3]) ; combine path and file name $FileVer = FileGetVersion($FileName) ; get version for file return($FileVer) ; return version # endfunc ;//=====================================================================// Func CmbFileVer($ver) $v = StringReplace ($ver,'.','','3') ; combine version(0.0.0.0) to (0000) return($v) endfunc ;//=====================================================================// Func UpdateResults($value) $N = StringInStr($FileReadLnVar, 'File') $L1 = Stringleft ($FileReadLnVar, $N) $NewReadVar = ($FileReadLnVar&@tab&$value) FileWriteLine($EVResults, $NewReadVar) return() EndFunc
  15. i'm new at this and I'm writing a script that reads from a txt file and find the line that has string "Not Found" in it then verify some info then write back to that line but replacing "Not Found" with "Found" or delete that entire line depends on the verification returns value. The problem I have is I can't write back using FileWriteLine even when I know the line number or delete that line any idea? thank you!
×
×
  • Create New...