Dual-pane Explorer

Discussion in 'Scripting' started by freddie-o, Sep 17, 2019.

  1. freddie-o

    freddie-o MDL Expert

    Jul 29, 2009
    1,148
    1,537
    60
    #1 freddie-o, Sep 17, 2019
    Last edited: Apr 15, 2022
    About:
    • These AutoIt scripts open 2 instances of Explorer and "shows windows side by side".
    • When multitasking in Windows, it is more productive and convenient using a dual-pane Explorer.



    Download:

    AutoIt (To convert AU3 script to EXE)




    How To:
    1. Install AutoIt (or extract if you downloaded the portable zip version.)
    2. Open SciTE Script Editor (or any source code editor)
    3. Copy and paste a script below
    4. Save as “Dual-pane Explorer.au3” (or whatever name you choose, as long as the extension is "au3")
    5. You can test “Run Script” using AutoIt3
    6. “Compile Script to .exe” using Aut2exe (Have an icon ready for your exe.)



    Scripts:

    1. This script opens 2 Explorer windows at the root of the hard drive and "shows windows side by side"
    Code:
    Local $hRun1 = _Run('Explorer.exe', 0, 0, @DesktopWidth/2, @DesktopHeight - 40)
    Local $hRun2 = _Run('Explorer.exe', @DesktopWidth/2, 0, @DesktopWidth/2, @DesktopHeight - 40)
    
    Func _Run($sRunCommand, $iX, $iY, $iW, $iH)
        Local $aWinList_Before = WinList("[CLASS:CabinetWClass]")
        Run($sRunCommand)
        Do
            $aWinList_After = WinList("[CLASS:CabinetWClass]")
        Until $aWinList_After[0][0] > $aWinList_Before[0][0]
        Local $hWnd = $aWinList_After[1][1]
        Sleep(1000)
        WinMove($hWnd, "", $iX, $iY, $iW, $iH)
    EndFunc
    
    




    2. This script opens 2 Explorer windows at the drive or folder that is specified in "Local $Path1" & "Local $Path2" and "shows windows side by side"
    Code:
    Local $Path1 = "D:\"
    Local $hRun1 = _Run("explorer /e, " & '"' & $Path1 & '"', 0, 0, @DesktopWidth/2, @DesktopHeight - 40)
    Local $Path2 = "F:\"
    Local $hRun2 = _Run("explorer /e, " & '"' & $Path2 & '"', @DesktopWidth/2, 0, @DesktopWidth/2, @DesktopHeight - 40)
    
    Func _Run($sRunCommand, $iX, $iY, $iW, $iH)
        Local $aWinList_Before = WinList("[CLASS:CabinetWClass]")
        Run($sRunCommand)
        Do
            $aWinList_After = WinList("[CLASS:CabinetWClass]")
        Until $aWinList_After[0][0] > $aWinList_Before[0][0]
        Local $hWnd = $aWinList_After[1][1]
        Sleep(1000)
        WinMove($hWnd, "", $iX, $iY, $iW, $iH)
    EndFunc