Jump to content

EdyYusof

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by EdyYusof

  1. #include Local $aArray = DriveGetDrive("ALL");("FIXED") _ArrayColInsert($aArray,0) _ArrayColInsert($aArray,2) _ArrayColInsert($aArray,3) For $i=1 To $aArray[0][1] $drv=$aArray[$i][1] $aArray[$i][2]=hex(DriveGetSerial($drv)) $aArray[$i][3]=DriveGetLabel($drv) $aArray[$i][0]="Volume ?" Next _ArrayDisplay($aArray,"Test Array") Microsoft DiskPart version 6.1.7601 Copyright (C) 1999-2008 Microsoft Corporation. On computer: EDY-PC Disk ### Status Size Free Dyn Gpt -------- ------------- ------- ------- --- --- Disk 0 Online 465 GB 0 B Disk 1 No Media 0 B 0 B Disk 2 Online 111 GB 0 B Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- Volume 0 DVD-ROM 0 B No Media Volume 1 I 20111219212 CDFS CD-ROM 97 MB Healthy Volume 2 D USB OS7: 1 NTFS Partition 7506 MB Healthy System Volume 3 C OS7 Lite X6 NTFS Partition 28 GB Healthy Boot Volume 4 E Program: 3 NTFS Partition 106 GB Healthy Pagefile Volume 5 F Document: 4 NTFS Partition 323 GB Healthy Volume 6 K Removable 0 B No Media Volume 7 S USB OS-Win7 NTFS Partition 7248 MB Healthy Volume 8 Q Black Ext 1 NTFS Partition 13 GB Healthy Volume 9 R Black Ext 9 NTFS Partition 91 GB Healthy Leaving DiskPart... Need help, how to get partition volume, i want fill in array e.g vol 2 to drive D:, vol 3 to drive C:, vol 4 to drive E, like data from Diskpart I find in forum, can't find correct script command to get Partitions volume, and try using Autoit Script-o-matic, but no one options can get partitions volume ? Edit 05/03/2017 [Solved] topic/95010-get-output-from-cmdexe I using this script to get text from cmd, but take some times to get diskpart ouput Thanks
  2. Thanks for info, i not fimiliar yet with scite4autoit, in learning, temporary i using editplus
  3. Hi, I newbie here, my english not so good my first post and first script, I learn make sofware with autoit, and to want share with other forumer just simple autoit script in my first try (and not full follow autoit format(yet, in learning and understand)) Screenshot http://www.xyplorer.com/xyfc/download/file.php?id=9726 #include <Array.au3> #include <IE.au3> #NoTrayIcon Global $g_sUrlList, $g_sHelpPath, $g_sNavPath, $g_sKeyword, $hWnd, $g_RegexP Global $sChmUrl_L, $g_sClipbord, $sFileN $sFileN = StringRegExpReplace(@ScriptFullPath, "(.+\\)([^\\]+)\.(au3|a3x|exe)", "$2", 1) $sSDir = StringRegExpReplace(@ScriptFullPath, "(.+\\)[^\\]+\.(au3|a3x|exe)", "$1", 1) Global Const $g_sIniPath = $sSDir & '_IncludePart\' & $sFileN & '.ini' _sClipGet() $sTitl = WinGetTitle("[ACTIVE]") $sExt = StringRegExpReplace($sTitl, "(.+\.)(\w{1,6}).*", "$2", 1) Local $sCount, $sDefault $sCext = "~" $i = 0 $pi = 1 If FileExists($g_sIniPath) = 0 Then _IniWriteSection() Sleep(1000) EndIf If FileExists($g_sIniPath) = 1 Then $j = 0 $sCount = IniRead($g_sIniPath, "MainHChmData", "TotalItems", "") Do $j += 1 $sKeyt = " " & IniRead($g_sIniPath, "HChmData" & $j, "FileExt", "") Until $j = 20 Or $sKeyt = " " $j -= 1 If $sCount <> $j Then IniWrite($g_sIniPath, "MainHChmData", "TotalItems", $j) $sCount = $j EndIf $sDefault = IniRead($g_sIniPath, "MainHChmData", "DefaultItems", "") For $i = 1 To $sCount Local $sCext = " " & IniRead($g_sIniPath, "HChmData" & $i, "FileExt", "") $Cext = StringInStr($sCext, $sExt & ";") If $Cext > 1 Then ExitLoop EndIf Next EndIf If $sCext = "~" Or $sDefault = "" Then $sDefault = 1 If $i > $sCount Then $i = $sDefault $g_sHelpPath = IniRead($g_sIniPath, "HChmData" & $i, "HChmPath", "") $hWndT = '[' & IniRead($g_sIniPath, "HChmData" & $i, "hWnd", "") & ']' $g_sNavPath = IniRead($g_sIniPath, "HChmData" & $i, "ChmUrlList", "") $sDef = IniRead($g_sIniPath, "HChmData" & $i, "DefaultPage", "") $g_RegexP = IniRead($g_sIniPath, "HChmData" & $i, "RegexMatches", "") If FileExists($g_sHelpPath) = 0 Or FileExists($g_sNavPath) = 0 Or $hWndT = "[]" Then MsgBox(0, "Missing Or Invalid Path :", "Note: Make Sure Correct Ini Data In : " & @CRLF & $g_sIniPath & @CRLF & @CRLF & "Bellow Information Data :" & @CRLF & @CRLF & "HelpFile.chm : " & @CRLF & $g_sHelpPath & @CRLF & @CRLF & "ChmUrlList : " & @CRLF & $g_sNavPath & @CRLF & @CRLF & "HelpWindowsHwnd : " & @CRLF & $hWndT & @CRLF) EndIf $sChf = "::" & $sDef If $sDef = "" Then $sChf = "" If WinExists($hWndT) = 0 Then Run('"hh.exe" "' & $g_sHelpPath & $sChf & '"') WinWaitActive($hWndT) Sleep(500) EndIf $hWnd = WinGetHandle($hWndT) If IsHWnd($hWnd) = 0 Then MsgBox(0, "Not Valid Help Windows Hwnd", 'Make Sure Correct Help Windows Hwnd' & @CRLF & @CRLF & "HelpWindowsHwnd : " & @CRLF & $hWndT & @CRLF & @CRLF & "Sample Correct Hwnd (Windows Help Title & Class)" & @CRLF & "REGEXPTITLE:AutoIt Help.+; REGEXPCLASS:HH Parent" & @CRLF & "OR" & @CRLF & "TITLE:AutoIt Help (v3.3.14.2); CLASS:HH Parent") EndIf _sGetUrl() Exit Func _IniWriteSection() If FileExists($g_sIniPath) = 0 Then DirCreate(@ScriptDir & "\_IncludePart") EndIf Local $sAutoItInstallDir = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE" & ((@OSArch = 'X64') ? "\Wow6432Node" : "") & "\AutoIt v3\AutoIt", "InstallDir") If $sAutoItInstallDir = "" Then $sAutoItInstallDir = "Replace This Note In _IncludePart\" & $sFileN & ".Ini File With Valid Path " Local $aGeneral[3][2] = [[2, ""], ["TotalItems", "1"], ["DefaultItems", "1"]] Local $aSection[7][2] = [[5, ""], ["HChmPath", $sAutoItInstallDir & "\AutoIt.chm"], ["hWnd", "REGEXPTITLE:AutoIt Help.+; REGEXPCLASS:HH Parent"], _ ["ChmUrlList", @ScriptDir & "\_IncludePart\HHChmAutoIt3.au3t"], ["FileExt", "au3;a3x;"], ["DefaultPage", "html/functions/Window Management.htm"], _ ["RegexMatches", ""]] IniWriteSection($g_sIniPath, "MainHChmData", $aGeneral) IniWriteSection($g_sIniPath, "HChmData1", $aSection) EndFunc ;==>_IniWriteSection Func _sClipGet() $ClipBord = ClipGet() ClipPut("") Sleep(10) Send("^c") $g_sClipbord = ClipGet() ClipPut($ClipBord) Local $iLength = StringLen($g_sClipbord) EndFunc ;==>_sClipGet Func _sGetUrl() Local $iLength = StringLen($g_sClipbord) $aData = StringRegExp($g_sClipbord, '[^"()$\s\n]+', $STR_REGEXPARRAYFULLMATCH) If $aData = 1 Then MsgBox(0, "Abort :", "Clipbord : " & $g_sClipbord & @CRLF & @CRLF & "Noting Selected Or Macth With Regex" & @CRLF & @CRLF) Exit EndIf $g_sKeyword = StringLower(StringFormat("%s", $aData[0])) $iLength2 = StringLen($g_sKeyword) If $iLength2 < 3 Then MsgBox(0, "Note :", "Abort : Word Letter Below 4" & @CRLF & "Seleted = " & $g_sKeyword & @CRLF & "Length = " & $iLength2) Exit Else _aFileRead($g_sNavPath) _sChmUrl() EndIf EndFunc ;==>_sGetUrl Func _sChmUrl() $Reg = '(?i)([^\n]+' & $g_sKeyword & '[^\n]*)' _StringRegex($g_sUrlList, $Reg) $aRegx = "[^\n]+/()\.htm;;[^\n]+/()\w\w?\.htm;;[^\n]+#();;[^\n]+#()\w\w?;;[^\n]+/()[^\n/]+\.htm;;[^\n]+#[^\n#/]*()[^\n]*;;[^\n]+/[^\n/]+()[^\n/]*\.htm;;[^\n]+()[^\n/]*\r" If $g_RegexP <> "" Then $aRegx = $g_RegexP & ";;" & $aRegx EndIf $aRegx = StringSplit("(" & StringReplace(StringReplace($aRegx, "()", $g_sKeyword), ";;", "\r)¦(") & "\r)", "¦", 1) _StringRegexUrl($sChmUrl_L, $aRegx) Exit EndFunc ;==>_sChmUrl Func _NavigateCHM($sFilePath, $sSection) If IsHWnd($hWnd) Then Local $oIE = _IEAttach($hWnd, 'Embedded') _IENavigate($oIE, 'mk:@MSITStore:' & $sFilePath & '::/' & $sSection) WinActivate($hWnd) ; ControlFocus($hWnd,"","[ID:201]") ; ControlClick($hWnd,"","[ID:201]","",1,625, 155) ; ControlClick($hWnd,"","[CLASS:Button; TEXT:Hide;]","") EndIf Exit EndFunc ;==>_NavigateCHM Func _StringRegexUrl($sList, $aRegx) Local $sChmUrl For $i = 1 To $aRegx[0] - 1 $sChmUrl = StringRegExp($sList, '(?i)' & $aRegx[$i], 1) If IsArray($sChmUrl) Then $sChmUrl = StringTrimRight($sChmUrl[0], 1) _NavigateCHM($g_sHelpPath, $sChmUrl) EndIf Next Exit EndFunc ;==>_StringRegexUrl Func _StringRegex($sConten, $Reg) $aGetChmUrl = StringRegExp($sConten, $Reg, 3) If $aGetChmUrl = 1 Then MsgBox(0, "Abort :", "Keyword : " & $g_sKeyword & @CRLF & @CRLF & "Noting Macth Any Chm Url By Keyword" & @CRLF & @CRLF) Exit Else $sCChm = UBound($aGetChmUrl) For $i = 0 To $sCChm - 1 $sChmUrl_L &= $aGetChmUrl[$i] & @CRLF Next EndIf Return $sChmUrl_L EndFunc ;==>_StringRegex Func _aFileRead($g_sNavPath) Local $hFileOpen = FileOpen($g_sNavPath, $FO_READ) If $hFileOpen = -1 Then MsgBox($MB_SYSTEMMODAL, "", "An error occurred when reading the file.") Return False EndIf $g_sUrlList = FileRead($hFileOpen) FileClose($hFileOpen) Return $g_sUrlList EndFunc ;==>_aFileRead LearningTools.7z Info in ReadMe.txt Just to ask other forumer, Correct way or keyword command to autoit click Hide button in AutoIt.chm windows? ControlFocus($hWnd,"","[ID:201]") ControlClick($hWnd,"","[ID:201]","left",1) ControlClick($hWnd,"","[CLASS:Button; TEXT:Hide;]","left",1) I try using ControlClick, sendkey or mouseclick, but not work LearningTools.7z
×
×
  • Create New...