-
Posts
23 -
Joined
-
Last visited
About GajjarTejas
- Birthday 08/26/1990
Profile Information
-
Location
Gozaria
-
WWW
http://gajjartejas26.blogspot.com/
-
Interests
Telecommunication And Networking
GajjarTejas's Achievements

Seeker (1/7)
1
Reputation
-
mLipok reacted to a post in a topic: TrIDLib.dll+UDF+GUI
-
What is TrIDLib.dll? This standard Win32 DLL library, based on TrID's core engine, make adding file identification / file recognition capabilities to any kind of application a very easy & quick process. If you need a managed library, check the TrIDEngine. For more Info Go to Author website http://mark0.net/index-e.html Functions in the UDF are: _TrIDLib_Startup _TrIDLib_Shutdown _TrIDLib_GetInfo _TrIDLib_GetRealExtension _TrIDLib_GetVersion _TrIDLib_GetFileTypeDef Here is main udf: #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include-once ; TrIDlib AutoIt Demo[Modified] ; #INDEX# ======================================================================================================================= ; Title .........: 7Zip ; AutoIt Version : 3.3.8.1 ; Language ......: English ; Description ...: Functions that assist with TrIDLib DLL. ; Author(s) .....: Gajjar Tejas ; Notes .........: The original code came from this subject : http://mark0.net/download/tridlib-samples.zip ; - 12 June 2013 : ; * Intial ; * Added _TrIDLib_GetInfo, _TrIDLib_GetVersion, _TrIDLib_GetFileTypeDef,_TrIDLib_Startup, _TrIDLib_Shutdown,_TrIDLib_GetRealExtension ; * 32bit dll Version(v1.0.2.0). ; * Auto Open Dll, Manually Close ; - Note ; * Using _TrIDLib_Startup() and _TrIDLib_Shutdown() is recommanded for multiples Files. ; * The last x32 DLL file can be found here : http://mark0.net/code-tridlib-e.html ; * The last Definition file can be found here : http://mark0.net/soft-trid-e.html ; =============================================================================================================================== ; #CURRENT# ===================================================================================================================== ;_TrIDLib_Startup ;_TrIDLib_Shutdown ;_TrIDLib_GetInfo Auto Open dll*** ;_TrIDLib_GetVersion Auto Open dll ;_TrIDLib_GetFileTypeDef Auto Open dll ;***Using _TrIDLib_Startup() and _TrIDLib_Startup() is recommanded for multiples Files to avoid ; repetitive dll open that can increase operation time. ;***If _TrIDLib_Startup is not specified then dll will open and close automatically for _TrIDLib_GetInfo() ; =============================================================================================================================== ; #VARIABLES# =================================================================================================================== ; Definations & dll File Global $sTridDllFile = @ScriptDir & "\TrIDLib.dll" Global $sTridDefDir = @ScriptDir Global $sTridDefFile = $sTridDefDir & "\triddefs.trd" ; Others Global $iTridIsDllOpen = 0 ;Default Dll is not opened. Global $hTridDll = 0 ;Handle to Dll Global $iTridAutoLoad = 1 ;Default auto load Dll ; Constants FOR TrID_GetInfo Const $TRID_GET_RES_NUM = 1 ;Get the number of results available Const $TRID_GET_RES_FILETYPE = 2 ;Filetype descriptions Const $TRID_GET_RES_FILEEXT = 3 ;Filetype extension Const $TRID_GET_RES_POINTS = 4 ;Matching points Const $TRID_GET_VER = 1001 ;TrIDLib version (major * 100 + minor) Const $TRID_GET_DEFSNUM = 1004 ;Number of filetypes definitions loaded ; =============================================================================================================================== ; #FUNCTION# ==================================================================================================================== ; Name ..........: _TrIDLib ; Description ...: Identify file types from their binary signatures. ; Syntax ........: _TrIDLib($sFile) ; Parameters ....: $sFile - A full path of file. ; Return values .: Success - Returns the array (n x 4) with results ; n = Total No of possible file type found(UBound(array, 1)) ; array[0][0] = File Type 1st instant ; array[0][1] = Extension " ; array[0][2] = Points " ; array[0][3] = % Point " ; ... ; array[n-1][0] = File Type (n-1)th instant ; array[n-1][1] = Extension " ; array[n-1][2] = Points " ; array[n-1][3] = % Point " ; Failure - Returns 0 and and sets @error to non zero ; |1 = TrIDLib.dll File Not Found.(FileExist) ; |2 = Triddefs.trd File Not Found(FileExist) ; |3 = While Opening TrIDLib.dll(DllOpen) ; |4 = While Loading triddefs.trd(DllCall) ; |5 = While Submitting File(DllCall) ; |6 = While Analysing File(DllCall) ; |7 = Unable to detect file type(DllCall) ; Author ........: Gajjar Tejas ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: Yes ; =============================================================================================================================== Func _TrIDLib_GetInfo($sFile) If $iTridAutoLoad Then _TrIDLib_Startup() If @error Then Return SetError(@error, 0, 0) $iTridAutoLoad = 1 Else ;Check if Manually Load Using _TrIDLib_Startup and previously dll open or not If Not $iTridIsDllOpen Then _TrIDLib_Startup() If @error Then Return SetError(@error, 0, 0) EndIf EndIf ; load the definitions Local $Ret = DllCall($hTridDll, "int", "TrID_LoadDefsPack", "str", $sTridDefDir) If @error Then Return SetError(4, 0, 0) ; submit the file $Ret = DllCall($hTridDll, "int", "TrID_SubmitFileA", "str", $sFile) If @error Then Return SetError(5, 0, 0) ; perform the analysis $Ret = DllCall($hTridDll, "int", "TrID_Analyze") If @error Then Return SetError(6, 0, 0) Local $Buf $Ret = DllCall($hTridDll, "int", "TrID_GetInfo", "int", $TRID_GET_RES_NUM, "int", 0, "str", $Buf) Local $iTotalSumPoints = 0 Local $RetCom If $Ret[0] > 0 Then Local $aTridLibInfoInform2D[$Ret[0]][4] For $ResId = 0 To $Ret[0] - 1 ;Get File Type $RetCom = DllCall($hTridDll, "int", "TrID_GetInfo", "int", $TRID_GET_RES_FILETYPE, "int", $ResId + 1, "str", $Buf) $aTridLibInfoInform2D[$ResId][0] = $RetCom[3] ;First Element ;Get Extension $RetCom = DllCall($hTridDll, "int", "TrID_GetInfo", "int", $TRID_GET_RES_FILEEXT, "int", $ResId + 1, "str", $Buf) $aTridLibInfoInform2D[$ResId][1] = $RetCom[3] ;Second Element ;Get Points $RetCom = DllCall($hTridDll, "int", "TrID_GetInfo", "int", $TRID_GET_RES_POINTS, "int", $ResId + 1, "str", $Buf) $aTridLibInfoInform2D[$ResId][2] = $RetCom[0] $iTotalSumPoints += Number($aTridLibInfoInform2D[$ResId][2]) ;Third Element Next ;Get Points in Percentage If $iTotalSumPoints > 0 Then For $ResId = 0 To $Ret[0] - 1 $aTridLibInfoInform2D[$ResId][3] = Round($aTridLibInfoInform2D[$ResId][2] * 100 / $iTotalSumPoints, 2) ;Fourth Element Next EndIf Else Return SetError(7, 0, 0) EndIf If $iTridAutoLoad Then _TrIDLib_Shutdown() Return $aTridLibInfoInform2D EndFunc ;==>_TrIDLib_GetInfo ; #FUNCTION# ==================================================================================================================== ; Name ..........: _TrIDLib_GetRealExtension ; Description ...: ; Syntax ........: _TrIDLib_GetRealExtension($sFile) ; Parameters ....: $sFile - A full path of file. ; Return values .: Success - Returns the Original File Extension ; Failure - Returns Empty String('') and and sets @error to non zero ; |1 = TrIDLib.dll File Not Found.(FileExist) ; |2 = Triddefs.trd File Not Found(FileExist) ; |3 = While Opening TrIDLib.dll(DllOpen) ; |4 = While Loading triddefs.trd(DllCall) ; |5 = While Submitting File(DllCall) ; |6 = While Analysing File(DllCall) ; |7 = Unable to detect file type(DllCall) ; |8 = File was Identified But Extension Not Found in the Database(null('') extension return by dll) ; Author ........: Gajjar Tejas ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: Yes ; =============================================================================================================================== Func _TrIDLib_GetRealExtension($sFile) Local $at = _TrIDLib_GetInfo($sFile) Local $iErr = @error Local $sExt = $at[0][1] If Not $iErr Then If $sExt <> "" Then $sExt = "." & $sExt Else Return SetError(8, 0, '');null extension return by dll EndIf Else Return SetError($iErr, 0, '') EndIf Return $sExt EndFunc ;==>_TrIDLib_GetRealExtension ; #FUNCTION# ==================================================================================================================== ; Name ..........: _TrIDLib_GetVersion ; Description ...: Get the TrIDLib.dll version ; Syntax ........: _TrIDLib_GetVersion() ; Parameters ....: ; Return values .: Success - Returns Numrical - Version ; Failure - Returns 0 and and sets @error to non zero ; |1 = TrIDLib.dll File Not Found.(FileExist) ; |2 = Triddefs.trd File Not Found(FileExist) ; |3 = While Opening TrIDLib.dll(DllOpen) ; |4 = While Loading triddefs.trd(DllCall) ; Author ........: Gajjar Tejas ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: Yes ; =============================================================================================================================== Func _TrIDLib_GetVersion() ;Check if is dll open or not If Not $iTridIsDllOpen Then _TrIDLib_Startup() If @error Then Return SetError(@error, 0, 0) EndIf ;Get TrIDLib version Local $Buf Local $RetCom = DllCall($hTridDll, "int", "TrID_GetInfo", "int", $TRID_GET_VER, "int", 0, "str", $Buf) Return Round($RetCom[0] / 100, 2) EndFunc ;==>_TrIDLib_GetVersion ; #FUNCTION# ==================================================================================================================== ; Name ..........: _TrIDLib_GetFileTypeDef ; Description ...: Get the total no of Definitions triddefs.trd ; Syntax ........: _TrIDLib_GetFileTypeDef() ; Parameters ....: ; Return values .: Success - Returns Numrical - Version ; Failure - Returns 0 and and sets @error to non zero ; |1 = TrIDLib.dll File Not Found.(FileExist) ; |2 = Triddefs.trd File Not Found(FileExist) ; |3 = While Opening TrIDLib.dll(DllOpen) ; |4 = While Loading triddefs.trd(DllCall) ; Author ........: Your Name ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _TrIDLib_GetFileTypeDef() ;Check if is dll open or not If Not $iTridIsDllOpen Then _TrIDLib_Startup() If @error Then Return SetError(@error, 0, 0) EndIf ; load the definitions DllCall($hTridDll, "int", "TrID_LoadDefsPack", "str", $sTridDefDir) If @error Then Return SetError(4, 0, 0) ;Get Number of filetypes definitions loaded Local $Buf Local $RetCom = DllCall($hTridDll, "int", "TrID_GetInfo", "int", $TRID_GET_DEFSNUM, "int", 0, "str", $Buf) Return $RetCom[0] EndFunc ;==>_TrIDLib_GetFileTypeDef ; #FUNCTION# ==================================================================================================================== ; Name ..........: _TrIDLib_CheckFiles ; Description ...: Check File ; Syntax ........: _TrIDLib_CheckFiles() ; Parameters ....: ; Return values .: Success - Returns 1 ; Failure - Returns 0 and and sets @error to non zero ; |1 = TrIDLib.dll File Not Found.(FileExist) ; |2 = Triddefs.trd File Not Found(FileExist) ; Author ........: Gajjar Tejas ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _TrIDLib_CheckFiles() If Not FileExists($sTridDllFile) Then Return SetError(1, 0, 0) ElseIf Not FileExists($sTridDefFile) Then Return SetError(2, 0, 0) Else Return SetError(0, 0, 1) EndIf EndFunc ;==>_TrIDLib_CheckFiles ; #FUNCTION# ==================================================================================================================== ; Name ..........: _TrIDLib_Startup ; Description ...: Manually Load TrIDLib.dll ; Syntax ........: _TrIDLib_Startup() ; Parameters ....: ; Return values .: Success - Returns 1 ; Failure - Returns 0 and and sets @error to non zero ; |1 = TrIDLib.dll File Not Found.(FileExist) ; |2 = Triddefs.trd File Not Found(FileExist) ; |3 = While Opening TrIDLib.dll(DllOpen) ; Author ........: Gajjar Tejas ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _TrIDLib_Startup() _TrIDLib_CheckFiles() If @error Then Return SetError(@error, 0, 0) $hTridDll = DllOpen($sTridDllFile) If $hTridDll = -1 Then Return SetError(3, 0, 0) $iTridIsDllOpen = 1 $iTridAutoLoad = 0 Return SetError(0, 0, 1) EndFunc ;==>_TrIDLib_Startup ; #FUNCTION# ==================================================================================================================== ; Name ..........: _TrIDLib_Shutdown ; Description ...:Manually Unload TrIDLib.dll ; Syntax ........: _TrIDLib_Shutdown() ; Parameters ....: ; Return values .: None ; Author ........: Gajjar Tejas ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _TrIDLib_Shutdown() DllClose($hTridDll) $iTridAutoLoad = 1;Default auto load $iTridIsDllOpen = 0 EndFunc ;==>_TrIDLib_Shutdown Example:1 #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #Region ;************ Includes ************ #Include "_TrIDLib.au3" #include <Array.au3> #EndRegion ;************ Includes ************ _Example() Func _Example() MsgBox(0, "Info", _ "TrIDLib.dll version (major * 100 + minor): " & _TrIDLib_GetVersion() & @CRLF & _ "Number of filetypes definitions loaded:" & _TrIDLib_GetFileTypeDef()) Local $sFile, $at, $iErr $sFile = FileOpenDialog("Choose Any File", "", "Any File (*.*)", 3) ; a file to analyze If @error Then Exit $at = _TrIDLib_GetInfo($sFile) $iErr = @error If Not $iErr Then MsgBox(0, "Info", "Total No of possible file type found:" & UBound($at, 1)) MsgBox(0, "Info", "Suggested Extension:" & _TrIDLib_GetRealExtension($sFile)) _ArrayDisplay($at, "Result", -1, 0, "", "|", "No.|File Type|Extension|Points|% Points") Else Switch $iErr Case 1 MsgBox(0, "Error", "TrIDLib.dll File Not Found in Script Directory.") Case 2 MsgBox(0, "Error", "triddefs.trd File Not Found in Script Directory.") Case 3 MsgBox(0, "Error", "Error occurs during opening TrIDLib.dll") Case 4 MsgBox(0, "Error", "Error occurs during Loading triddefs.trd.") Case 5 MsgBox(0, "Error", "Error occurs during Submitting File: " & $sFile) Case 6 MsgBox(0, "Error", "Error occurs during Analysing File: " & $sFile) Case 7 MsgBox(0, "Error", "Unable to detect file type") Case 8 MsgBox(0, "Error", "File was Identified But Extension Not Found in the Database(null extension return by dll)") EndSwitch EndIf EndFunc ;==>_Example Example:2 #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #Region ;************ Includes ************ #Include "_TrIDLib.au3" #EndRegion ;************ Includes ************ _Example() Func _Example() ;Load Dll _TrIDLib_Startup() ;Select Folder Local $sDir = FileSelectFolder("choose folder", "") If @error Then Exit If StringRight($sDir, 1) <> "\" Then $sDir &= "\" ;Search Handle Local $search = FileFindFirstFile($sDir & "*.*") ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf MsgBox(0, "Info", "Now,Press Ok to See Console Output") Local $at, $iErr = 0 While 1 ;Search for file and Folder Local $sFile = FileFindNextFile($search) If @error Then ExitLoop ;Only file allowed If StringInStr(FileGetAttrib($sDir & $sFile), "D") = 0 Then ConsoleWrite("==============================================================" & @LF) ConsoleWrite(">File: " & $sDir & $sFile & @LF) ;Get detailed info in array $at = _TrIDLib_GetInfo($sDir & $sFile) $iErr = @error If Not $iErr Then ConsoleWrite("Total no of possible file type found:" & UBound($at, 1) & @LF) ConsoleWrite("-Suggested extension:" & $at[0][1] & @LF) For $i = 0 To UBound($at) - 1 ConsoleWrite($i + 1 & "==============" & @LF) ConsoleWrite("File Type:" & $at[$i][0] & @LF) ConsoleWrite("Extension:" & $at[$i][1] & @LF) ConsoleWrite("Points:" & $at[$i][2] & @LF) ConsoleWrite("Points %:" & $at[$i][3] & @LF) Next Else Switch $iErr Case 1 ConsoleWrite("!Error: TrIDLib.dll File Not Found in Script Directory.") Case 2 ConsoleWrite("!Error: triddefs.trd File Not Found in Script Directory.") Case 3 ConsoleWrite("!Error: Error occurs during opening TrIDLib.dll") Case 4 ConsoleWrite("!Error: Error occurs during Loading triddefs.trd.") Case 5 ConsoleWrite("!Error: Error occurs during Submitting File: " & $sFile) Case 6 ConsoleWrite("!Error: Error occurs during Analysing File: " & $sFile) Case 7 ConsoleWrite("!Error: Unable to detect file type") EndSwitch ConsoleWrite(@LF) EndIf EndIf WEnd ; Close the search handle FileClose($search) ;Close Dll _TrIDLib_Shutdown() EndFunc ;==>_Example This udf require the following components: TrIDLib.dll - The last x32 DLL file can be found here : http://mark0.net/code-tridlib-e.html triddefs.trd - The last Definition file can be found here : http://mark0.net/soft-trid-e.html Includes in Download: Examples, triddefs.trd and TrIDLib.dll _TrIDLib.7z This is my first udf Hope you will like.
-
Run Program without admin rights
GajjarTejas replied to GajjarTejas's topic in AutoIt General Help and Support
Thanks Decipher I Got solution From https://sites.google.com/site/ascend4ntscode/shellexecutewithreducedprivileges. I used _ShellExecuteWithReducedPrivileges() Function. -
Run Program without admin rights
GajjarTejas replied to GajjarTejas's topic in AutoIt General Help and Support
thanks both. I Will use RunAs() -
I have set Execution Level to highest available in Autoit3Wrapper in my autoit program.Then I Compile Program Here is Function of my code. Func _sRun_IDMexe() Local $s_IDMexe_Path = RegRead($s_regpath_IDM, "ExePath") If Not FileExists($s_IDMexe_Path) Then $s_IDMexe_Path = @ProgramFilesDir & "\" & "Internet Download Manager\IDMan.exe" If Not FileExists($s_IDMexe_Path) Then Return SetError(1) $s_IDMexe_Path &= " /onboot" If Not ProcessExists("idman.exe") Then Run($s_IDMexe_Path) Else ProcessClose("idman.exe") Run($s_IDMexe_Path) EndIf EndFunc ;==>_sRun_IDMexe This function restart IDM or Run IDM with an admin rights.Is there any way to run IDM Without admin rights? edit: autoit code!
-
GajjarTejas reacted to a post in a topic: Resources UDF
-
GajjarTejas reacted to a post in a topic: Run, RunWait... Run anything is not working for cmdline
-
Right!
-
hi! I have created menu with radio check box then button. My problem is that getting status of MenuItem3, MenuItem4 and MenuItem5. here is my script. #include #include #include $hGUI = GUICreate("Form1", 361, 94, 387, 377) ;Create GUI $MenuItem1 = GUICtrlCreateMenu("MenuItem1") ;Create Main Menu $MenuItem2 = GUICtrlCreateMenu("MenuItem2", $MenuItem1) ;Create SubMenu(branch: MenuItem1) $MenuItem3 = GUICtrlCreateMenuItem("MenuItem3", $MenuItem2, -1, 1) ;Create SubMenu WITH RADIO(branch: MenuItem2) $MenuItem4 = GUICtrlCreateMenuItem("MenuItem4", $MenuItem2, -1, 1) ;Create SubMenu WITH RADIO(branch: MenuItem2) GUICtrlSetState(-1, $GUI_CHECKED) ;Check MenuItem4 $MenuItem5 = GUICtrlCreateMenuItem("MenuItem5", $MenuItem2, -1, 1) ;Create SubMenu WITH RADIO(branch: MenuItem2) $Button = GUICtrlCreateButton("Test!", 125, 20, 131, 36) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button If GUICtrlRead($MenuItem3) = $GUI_CHECKED Then MsgBox(0, "Test", "MenuItem3 is checked!") If GUICtrlRead($MenuItem4) = $GUI_CHECKED Then MsgBox(0, "Test", "MenuItem4 is checked!") If GUICtrlRead($MenuItem5) = $GUI_CHECKED Then MsgBox(0, "Test", "MenuItem5 is checked!") EndSwitch WEnd
-
Crearing File: Specific byte
GajjarTejas replied to GajjarTejas's topic in AutoIt General Help and Support
@ncubeher Thanks Thats my mistake. I Corrected ... FileWrite($file, "0x41") -
I'm creating file in autoit just 10 byte but FileWrite Function create 40 bytes file.Below is my script.Where is error in my script? Also I can't create 1 or 2 byte file. FileDelete("File.bin") ;Delete Previous File if Exists For $i = 1 To 10 $file = FileOpen("File.bin", 19) ;Open File File.bin if Not Exists Then Create It FileWrite($file, 0x41) ;Write 0x41 (only 1 Byte) To File File.bin FileClose($file) Next
-
Problem with _7Zip_Extract()
GajjarTejas replied to GajjarTejas's topic in AutoIt General Help and Support
7z.exe is located in script dir but only "7z.exe" not working but when i put "7z.exe" & @ScriptDir & '' Have you tested on your system? is it working without adding @ScriptDir & '' .....? Here is _7Zip_Add function which is working without adding @ScriptDir & '' Func _7Zip_Add($s7z_File_Save_Name, $sDestinationFolder, $sCompression, $sPassword) If FileExists($sDestinationFolder) = 0 Then Return SetError(1, 0, 0) EndIf If StringRight($sDestinationFolder, 1) <> "" Then $sDestinationFolder &= "" EndIf If $sPassword <> "" Then $sPassword = "-p" & '"' & $sPassword & '" ' EndIf If $sCompression <> "" Then Switch $sCompression Case "1-No Compression" $sCompression = " -mx0" Case "2-Fastest Compression" $sCompression = " -mx1" Case "3-Fast Compression" $sCompression = " -mx3" Case "4-Normal Compression" $sCompression = " -mx5" Case "5-Maximum Compression" $sCompression = " -mx7" Case "6-Ultra Compression" $sCompression = " -mx9" EndSwitch EndIf Return RunWait("7z.exe" & " " & "a" & " " & '"' & $s7z_File_Save_Name & '"' & $sCompression & " " & $sPassword & '"' & $sDestinationFolder & "*" & '"', "") ;, @SW_HIDE EndFunc ;==>_7Zip_Add Func _7Zip_Update($name_of_archive, $name_file_to_update) If FileExists($name_of_archive) = 0 Then Return SetError(1, 0, 0) EndIf If FileExists($name_file_to_update) = 0 Then Return SetError(1, 0, 0) EndIf Return RunWait("7z.exe" & " " & "u" & " " & '"' & $name_of_archive & '"' & " " & '"' & $name_file_to_update & '"', "") ;, @SW_HIDE EndFunc ;==>_7Zip_Update -
I'm creating script that extract the .7z file to destination folder.Below Is my script #region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #endregion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstantsEx.au3> #include <GUIConstantsEx.au3> #include <GuiButton.au3> #region ### START Koda GUI section ### Form=C:UsersTejasDesktopForm1.kxf $Form1 = GUICreate("Form1", 600, 150, 100, 100) $input = GUICtrlCreateInput("", 25, 25, 241, 21) $output = GUICtrlCreateInput("", 25, 65, 241, 21) $inbt = GUICtrlCreateButton("....", 265, 25, 75, 25) $outbt = GUICtrlCreateButton("....", 265, 60, 75, 25) $extract = GUICtrlCreateButton("Extract...", 360, 30, 200, 45) GUISetState(@SW_SHOW) #endregion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $inbt $file1 = FileOpenDialog("Input File", "", "All files (*.*;)") If $file1 <> "" Then GUICtrlSetData($input, $file1) Case $outbt $file2 = FileSelectFolder("Choose a folder.", "") If $file2 <> "" Then GUICtrlSetData($output, $file2) Case $extract _7Zip_Extract($file1, $file2,"") EndSwitch WEnd Func _7Zip_Extract($sZipFile, $sDestinationFolder, $sPassword = "") If FileExists($sZipFile) = 0 Then Return SetError(1, 0, 0) EndIf If StringRight($sDestinationFolder, 1) <> "" Then $sDestinationFolder &= "" EndIf If FileExists($sDestinationFolder) = 0 Then DirCreate($sDestinationFolder) EndIf If $sPassword <> "" Then $sPassword = "-p" & '"' & $sPassword & '" ' EndIf Return RunWait('7z.exe' & ' x "' & $sZipFile & '" ' & $sPassword & "-y -o" & '"' & $sDestinationFolder & '"') EndFunc ;==>_7Zip_Extract when i press extract button 7z.exe can not run but when i use @ScriptDir & '7z.exe' its run correctly.in other function look like _7Zip_Add run correctly without adding @ScriptDir & '' what is problem in _7Zip_Extract function?
-
GajjarTejas reacted to a post in a topic: 7zip script using Run/RunWait does not work
-
First use resHacker to extract destination icon then compare it.
-
While and If Statement Question
GajjarTejas replied to tabutcher's topic in AutoIt General Help and Support
in basic @error is error returned by the previous function in case of error. while 1 is always true and it is terminated by exit loop when condition is (@error=1) true -
Assistance with ControlClick script
GajjarTejas replied to shaunexe's topic in AutoIt General Help and Support
Script is paused due to WinwaitActive just check title it may be wrong or else.