Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/06/2016 in all areas

  1. Here is the first new issue of the debugger for a long time! Error List: Variables: Tool Chest: Class Viewer: Features: Automatic updates.COM operation replaced with Windows messaging (script no longer closes when program finishes).Output window, showing Console output.Automatic program tracing.Toggle between Release and Debug AutoIt.Script editing using ScintillaNET editor (looks and feels the same as SciTE).Single step debug through your script and #include files.Debug script in compiled (exe) or script (au3) form.View and modify variable values while your program is running. Allows you to test all parts of you program.Breakpoints (toggled by clicking on the line number). Breakpoints are stored between sessions.Scripts can be debugged by right clicking on the au3 file, running the debugger from the Start>Programs menu, from UltraEdit/UEStudio by using AutoIt4UE, or from within SciTE with this mod.Portable version (just install and select 'Portable' instead of 'Full').Automatic Context Check option.Access to 3rd party tools (Context Check, Koda, open in SciTE, Run script, Compile script, Tidy, Code Wizard).Easy switch between Release and Beta AutoIt.Syntax highlighting in either SciTE, or Visual Studio style.Upcoming features (don't hold your breath though!): Detection of changes in the script and prompt to automatically reloadVariable breakpoints (stop if x>1, or @error=1)Variable value tooltips in the code windowSome method of jumping back in the script to an earlier line without restarting. Don't really know if this is possible without the GOTO command.Some sort of variable value popup window to allow long strings to be viewedRun to Cursor option in code windowHere is link to a web page for the program: Autoit Debugger
    1 point
  2. Agreed. What's wrong with using WMI? I could see partdisk being an issue if you don't have admins rights, but WMI seems viable....as long as it's enabled and running. Local $sComputer = "." Local $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $sComputer & "\root\cimv2") Local $colDiskDrives = $objWMIService.ExecQuery ("Select * from Win32_DiskDrive") For $objDiskDrive in $colDiskDrives Local $sDisk = "Caption: " & $objDiskDrive.Caption & @CRLF & _ "Device ID: " & $objDiskDrive.DeviceID & @CRLF msgbox(0,"",$sDisk) Next Another method which uses the DeviceAPI UDF. #include <Array.au3> #include <DeviceAPI.au3> ;Populate Installed System Devices Array Dim $arrHW[1][2] = [["Device Class", "FriendlyName"]] $devIDX = 1 _DeviceAPI_Open() _DeviceAPI_GetAllDevices() ;Build list of ALL device classes While _DeviceAPI_EnumDevices() Local $sDeviceClass = _DeviceAPI_GetClassName(_DeviceAPI_GetDeviceRegistryProperty($SPDRP_CLASSGUID)) If $sDeviceClass = "DiskDrive" Then ReDim $arrHW[$devIDX + 1][2] $arrHW[$devIDX][0] = $sDeviceClass $arrHW[$devIDX][1] = _DeviceAPI_GetDeviceRegistryProperty($SPDRP_FRIENDLYNAME) $devIDX += 1 EndIf WEnd _DeviceAPI_DestroyDeviceInfoList() ;Cleanup for good measure _DeviceAPI_Close() _ArrayDisplay($arrHW)
    1 point
  3. Here an example how to create a small animation in the tray. You can modify it accordingly to display text instead. @nend: the code doesn't look like my coding style.
    1 point
  4. Try this small example: #include <Array.au3> Global $aDrives[26][10] _CreateDriveItems() Func _CreateDriveItems($bDelete = False) Local $aLdrives, $iFound, $hIcon $aLdrives = DriveGetDrive('ALL') _ArrayDelete($aLdrives, 0) ;_ArrayDisplay($aLdrives) For $i = 25 To 0 Step -1 If $bDelete And $aDrives[$i][0] <> '' Then ;_GUICtrlTreeView_Delete($idTVLocal, $aDrives[$i][0]) $aDrives[$i][0] = '' EndIf $iFound = _ArraySearch($aLdrives, Chr($i + 65) & ':') If @error Then If $aDrives[$i][0] <> '' Then ;_GUICtrlTreeView_Delete($idTVLocal, $aDrives[$i][0]) $aDrives[$i][0] = '' EndIf Else If $aDrives[$i][0] = '' Then $aDrives[$i][0] = Chr($i + 65) $aDrives[$i][1] = DriveGetType($aLdrives[$iFound] & '\') $aDrives[$i][2] = DriveGetType($aLdrives[$iFound] & '\', 2) $aDrives[$i][3] = DriveGetType($aLdrives[$iFound] & '\', 3) $aDrives[$i][4] = DriveStatus($aLdrives[$iFound] & '\') $aDrives[$i][5] = Hex(DriveGetSerial($aLdrives[$iFound] & '\')) $aDrives[$i][6] = DriveGetLabel($aLdrives[$iFound] & '\') $aDrives[$i][7] = DriveGetFileSystem($aLdrives[$iFound] & '\') $aDrives[$i][8] = DriveSpaceFree($aLdrives[$iFound] & '\') $aDrives[$i][9] = DriveSpaceTotal($aLdrives[$iFound] & '\') #cs Switch $aDrives[$i][1] Case 'Unknown' $hIcon = $UNKNOWN_ICON_INDEX Case 'RAMDisk' $hIcon = $Ram_ICON_INDEX Case 'CDRom' $hIcon = $CDRom_ICON_INDEX Case 'Fixed' $hIcon = $HDD_ICON_INDEX Case 'Removavle' $hIcon = $Removable_ICON_INDEX Case 'Network' $hIcon = $Network_ICON_INDEX EndSwitch If $bDelete Then $aDrives[$i][0] = _GUICtrlTreeView_AddChildFirst($idTVLocal, $hLocal, Chr($i + 65) & ':\', $hIcon, $hIcon) Else $aDrives[$i][0] = _GUICtrlTreeView_AddChild($idTVLocal, $hLocal, Chr($i + 65) & ':\', $hIcon, $hIcon) EndIf _GUICtrlTreeView_SetItemParam($idTVLocal, $aDrives[$i][0], $aDrives[$i][0]) _AddFolderLocal($aLdrives[$iFound] & '\', $aDrives[$i][0]) _GUICtrlTreeView_Expand($idTVLocal, $aDrives[$i][0], False) #ce EndIf EndIf Next _ArrayInsert($aDrives,0) $aDrives[0][1] = 'Drive Type' $aDrives[0][2] = 'SSD Status' $aDrives[0][3] = 'Bus Type' $aDrives[0][4] = 'Drive Status' $aDrives[0][5] = 'Windows Volume ID' $aDrives[0][6] = 'Label' $aDrives[0][7] = 'File System Type' $aDrives[0][8] = 'Free Space' $aDrives[0][9] = 'Space Total' _ArrayDisplay($aDrives) EndFunc ;==>_CreateDriveItems
    1 point
  5. Melba23

    while loop

    ZeroByDevide, This works for me: Local $rndSleep = Int (Random(180,240,1)) $iSec = @SEC While 1 If $iSec <> @SEC Then $iSec = @SEC $rndSleep -= 1 If $rndSleep Then ConsoleWrite("This note will show the sleeptime before closing the tabs, you got " & $rndSleep & " seconds left." & @CRLF) Else ExitLoop EndIf EndIf ; Important to let the CPU breathe Sleep(10) WEnd M23
    1 point
  6. mLipok

    Retreiving data from SQL

    Try my ADO.au3 in my signature.
    1 point
  7. Yes Brother it is this : (HKEY_LOCAL_MACHINE64) Thank you.
    1 point
  8. I'm not sure but maybe it has something to do with this? How to view the system registry by using 64-bit versions of Windows
    1 point
  9. kylomas

    arry error

    faustf, What happens at the end of the array? Try like this For $i = 0 To UBound($aBLSplitarray, 2) - 2 kylomas
    1 point
  10. Hi Please take a look at RegWrite here is a link https://www.autoitscript.com/autoit3/docs/functions/RegWrite.htm
    1 point
  11. ; List of the ODBC Drivers installed on this computer Local $HKEY_LOCAL_MACHINE = 0x80000002 Local $strComputer = "." Local $objRegistry = ObjGet("winmgmts:\\" & $strComputer & "\root\default:StdRegProv") Local $strKeyPath = "SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers" Local $arrValueNames, $arrValueTypes, $strValue $objRegistry.EnumValues($HKEY_LOCAL_MACHINE, $strKeyPath, $arrValueNames, $arrValueTypes) For $i = 0 to UBound($arrValueNames) - 1 $strValueName = $arrValueNames[$i] $objRegistry.GetStringValue($HKEY_LOCAL_MACHINE,$strKeyPath,$strValueName,$strValue) ConsoleWrite($arrValueNames[$i] & " -- " & $strValue & @CRLF) Next Exit
    1 point
  12. You could generate an icon with text?
    1 point
  13. Awesome Thanks for sharing mLipok
    1 point
  14. LarsJ

    Automating Windows Explorer

    Here is a collection of small examples. Windows Explorer should be open before you run the examples. If you create shortcuts for the scripts, and copy the shortcuts to the desktop, you can run the examples and use Windows Explorer at the same time. For some of the examples you can select files or folders before you run the example. 1) GetCurrentFolder.au3 #include "Includes\AutomatingWindowsExplorer.au3" Opt( "MustDeclareVars", 1 ) Example() Func Example() ; Windows Explorer on XP, Vista, 7, 8 Local $hExplorer = WinGetHandle( "[REGEXPCLASS:^(Cabinet|Explore)WClass$]" ) If Not $hExplorer Then MsgBox( 0, "Automating Windows Explorer", "Could not find Windows Explorer. Terminating." ) Return EndIf ; Get an IShellBrowser interface GetIShellBrowser( $hExplorer ) If Not IsObj( $oIShellBrowser ) Then MsgBox( 0, "Automating Windows Explorer", "Could not get an IShellBrowser interface. Terminating." ) Return EndIf ; Get other interfaces GetShellInterfaces() ; Get current folder Local $pFolder = GetCurrentFolder(), $sFolder SHGetPathFromIDList( $pFolder, $sFolder ) MsgBox( 0, "Folder", $sFolder ) ; Free memory _WinAPI_CoTaskMemFree( $pFolder ) EndFunc 2) SetCurrentFolder.au3 #include "Includes\AutomatingWindowsExplorer.au3" Opt( "MustDeclareVars", 1 ) Example() Func Example() ; Windows Explorer on XP, Vista, 7, 8 Local $hExplorer = WinGetHandle( "[REGEXPCLASS:^(Cabinet|Explore)WClass$]" ) If Not $hExplorer Then MsgBox( 0, "Automating Windows Explorer", "Could not find Windows Explorer. Terminating." ) Return EndIf ; Get an IShellBrowser interface GetIShellBrowser( $hExplorer ) If Not IsObj( $oIShellBrowser ) Then MsgBox( 0, "Automating Windows Explorer", "Could not get an IShellBrowser interface. Terminating." ) Return EndIf ; Get other interfaces GetShellInterfaces() ; Set current folder to desktop Local $pDesktop = _WinAPI_ShellGetSpecialFolderLocation( $CSIDL_DESKTOP ) SetCurrentFolder( $pDesktop, $SBSP_ABSOLUTE ) ; Free memory _WinAPI_CoTaskMemFree( $pDesktop ) EndFunc 3) CountItems.au3 #include "Includes\AutomatingWindowsExplorer.au3" Opt( "MustDeclareVars", 1 ) Example() Func Example() ; Windows Explorer on XP, Vista, 7, 8 Local $hExplorer = WinGetHandle( "[REGEXPCLASS:^(Cabinet|Explore)WClass$]" ) If Not $hExplorer Then MsgBox( 0, "Automating Windows Explorer", "Could not find Windows Explorer. Terminating." ) Return EndIf ; Get an IShellBrowser interface GetIShellBrowser( $hExplorer ) If Not IsObj( $oIShellBrowser ) Then MsgBox( 0, "Automating Windows Explorer", "Could not get an IShellBrowser interface. Terminating." ) Return EndIf ; Get other interfaces GetShellInterfaces() ; Count files and folders MsgBox( 0, "Count files and folders", CountItems() ) ; Count selected files and folders MsgBox( 0, "Count selected files and folders", CountItems( True ) ) EndFunc 4) GetFiles.au3 #include "Includes\AutomatingWindowsExplorer.au3" #include <Array.au3> Opt( "MustDeclareVars", 1 ) Example() Func Example() ; Windows Explorer on XP, Vista, 7, 8 Local $hExplorer = WinGetHandle( "[REGEXPCLASS:^(Cabinet|Explore)WClass$]" ) If Not $hExplorer Then MsgBox( 0, "Automating Windows Explorer", "Could not find Windows Explorer. Terminating." ) Return EndIf ; Get an IShellBrowser interface GetIShellBrowser( $hExplorer ) If Not IsObj( $oIShellBrowser ) Then MsgBox( 0, "Automating Windows Explorer", "Could not get an IShellBrowser interface. Terminating." ) Return EndIf ; Get other interfaces GetShellInterfaces() ; Get all files with full path ;GetFiles( $fSelected = False, $fFullPath = False, $fPidl = False, $iMax = 0 ) Local $aFiles = GetFiles( False, True ) _ArrayDisplay( $aFiles, "All files" ) ; Get selected files with full path ;GetFiles( $fSelected = False, $fFullPath = False, $fPidl = False, $iMax = 0 ) $aFiles = GetFiles( True, True ) _ArrayDisplay( $aFiles, "Selected files" ) EndFunc 5) GetFolders.au3 #include "Includes\AutomatingWindowsExplorer.au3" #include <Array.au3> Opt( "MustDeclareVars", 1 ) Example() Func Example() ; Windows Explorer on XP, Vista, 7, 8 Local $hExplorer = WinGetHandle( "[REGEXPCLASS:^(Cabinet|Explore)WClass$]" ) If Not $hExplorer Then MsgBox( 0, "Automating Windows Explorer", "Could not find Windows Explorer. Terminating." ) Return EndIf ; Get an IShellBrowser interface GetIShellBrowser( $hExplorer ) If Not IsObj( $oIShellBrowser ) Then MsgBox( 0, "Automating Windows Explorer", "Could not get an IShellBrowser interface. Terminating." ) Return EndIf ; Get other interfaces GetShellInterfaces() ; Get all folders ;GetFolders( $fSelected = False, $fFullPath = False, $fPidl = False, $iMax = 0 ) Local $aFolders = GetFolders() _ArrayDisplay( $aFolders, "All folders" ) ; Get selected folders ;GetFolders( $fSelected = False, $fFullPath = False, $fPidl = False, $iMax = 0 ) $aFolders = GetFolders( True ) _ArrayDisplay( $aFolders, "Selected folders" ) EndFunc 6) SetSelectedItem.au3 #include "Includes\AutomatingWindowsExplorer.au3" Opt( "MustDeclareVars", 1 ) Example() Func Example() ; Windows Explorer on XP, Vista, 7, 8 Local $hExplorer = WinGetHandle( "[REGEXPCLASS:^(Cabinet|Explore)WClass$]" ) If Not $hExplorer Then MsgBox( 0, "Automating Windows Explorer", "Could not find Windows Explorer. Terminating." ) Return EndIf ; Get an IShellBrowser interface GetIShellBrowser( $hExplorer ) If Not IsObj( $oIShellBrowser ) Then MsgBox( 0, "Automating Windows Explorer", "Could not get an IShellBrowser interface. Terminating." ) Return EndIf ; Get other interfaces GetShellInterfaces() ; Set second item selected SetSelectedItem( 1 ) EndFunc 7) GetSetIconView.au3 #include "Includes\AutomatingWindowsExplorer.au3" Opt( "MustDeclareVars", 1 ) Example() Func Example() ; Windows Explorer on XP, Vista, 7, 8 Local $hExplorer = WinGetHandle( "[REGEXPCLASS:^(Cabinet|Explore)WClass$]" ) If Not $hExplorer Then MsgBox( 0, "Automating Windows Explorer", "Could not find Windows Explorer. Terminating." ) Return EndIf ; Get an IShellBrowser interface GetIShellBrowser( $hExplorer ) If Not IsObj( $oIShellBrowser ) Then MsgBox( 0, "Automating Windows Explorer", "Could not get an IShellBrowser interface. Terminating." ) Return EndIf ; Get other interfaces GetShellInterfaces() ; Get current icon view Local $view = GetIconView() Local $iView, $iSize If IsArray( $view ) Then ; OS > XP $iView = $view[0] ; Icon view $iSize = $view[1] ; Icon size If $iView <> $FVM_DETAILS Then ; Not details view SetIconView( $FVM_DETAILS, 16 ) ; Set details view ElseIf $iView <> $FVM_ICON Then ; Not icon view SetIconView( $FVM_ICON, 48 ) ; Set icon view EndIf Sleep( 3000 ) ; Wait 3 seconds SetIconView( $iView, $iSize ) ; Restore old view Else ; OS = XP $iView = $view If $iView <> $FVM_DETAILS Then ; Not details view SetIconView( $FVM_DETAILS ) ; Set details view ElseIf $iView <> $FVM_ICON Then ; Not icon view SetIconView( $FVM_ICON ) ; Set icon view EndIf Sleep( 3000 ) ; Wait 3 seconds SetIconView( $iView ) ; Restore old view EndIf EndFunc Zipfile The zip contains examples and necessary include files. Examples.7z
    1 point
  15. Here is another method MsgBox(0, 'Free drive letter ', _GetFreeDriveLetter()) Func _GetFreeDriveLetter() For $x = 67 To 90 If DriveStatus(Chr($x) & ':\') = 'INVALID' Then Return(Chr($x) & ':') Next EndFunc
    1 point
  16. Rick

    Auto Assign drive letter

    ok, i was at last drive first, and not looking at what was free inbetween in my first example, so i've done this to.... $All = DriveGetDrive( "all" ) $First = StringUpper(StringLeft($All[1],1)) Local $Found = "", $Next = ASC($First)+1 if $Next = 66 then $Next = $Next + 1 ; if b: found make it c: While $Found = "" if DriveGetType(CHR($Next) & ":") = "" then $Found = CHR($Next) & ":" $Next = $Next + 1 Wend MsgBox(4096,"Free Letter", $Found )
    1 point
×
×
  • Create New...