Jump to content

ppp

Member
  • Posts

    2
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Greece

Posts posted by ppp

  1. Does anyone know how to do this in a Batch Script?


    ; Restart explorer with opened windows

    $_WinList = WinList ( "[REGEXPCLASS:(Explore|Cabinet)WClass]" )
    Do
    ProcessClose ( 'explorer.exe' )
    Until Not ProcessExists ( 'explorer.exe' )
    For $_I = 1 To $_WinList[0][0]
    ConsoleWrite ( $_WinList[$_I][0] & @Crlf )
    If FileExists ( $_WinList[$_I][0] ) Then Run ( 'explorer.exe "' & $_WinList[$_I][0] & '"' )
    Next

  2. I wanted a shortcut to toggle the autohide option of the taskbar and I've come up with the following batch file.

    My registry value is not the same with the one given above. I noticed that by only changing that option from the taskbar properties just a digit of the value was altered from 2 to 3 and back. So I just toggle this digit. However this digit may also represent more options in its bits and be different to other PCs. But one can easily adapt it the same way.

    :}The problem is that I have to restart explorer so the new registry value takes effect and I loose all opened explorer windows. Can anyone give a script of how I can just refresh the taskbar. Alternatively we could save and restore all opened paths as in this thread, but I want it in a batch script.


    @ECHO OFF

    ::Get the Registry Key, in delims there is a TAB and a space before "
    FOR /F "tokens=3 delims= " %%A IN ('REG QUERY "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2" /v Settings') DO SET RES=%%A

    ::Backup Initial Value
    IF NOT EXIST "autohide-toggle.bak" (
    ECHO %RES%>"%userprofile%\autohide-toggle.bak"
    )

    ::Find Important Digit
    SET DIGIT=%RES:~17,1%

    ::Toggle Important Digit
    IF %DIGIT% EQU 2 (
    SET TOGL=3
    ) ELSE (
    SET TOGL=2
    )

    ::Set New Value
    SET NEW=%RES:~0,17%%TOGL%%RES:~18%
    REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2" /v "Settings" /t REG_BINARY /d "%NEW%" /F

    ::Restart Explorer.exe process
    TSKILL "explorer" /A /V

    EXIT

×
×
  • Create New...