PersistentWindows README

The project's README from github.com/kangyu-california/PersistentWindows. As one markdown file: README.md.

PersistentWindows

This project addresses a long-standing issue in Windows 7, 10, and 11, where windows get repositioned after events such as the system waking up, external monitor connections or disconnections, changes in monitor resolution (e.g., exiting full-screen gaming), or during RDP reconnections. The code was forked from ninjacrab.com/persistent-windows.

Original Description

What is PersistentWindows?

A poorly named utility that persists window positions and size when the monitor display count/resolution adjusts and restores back to its previous settings.

For those of you with multi-monitors running on a mixture of DisplayPort and any other connection, you can run this tool and not have to worry about re-arranging when all is back to normal.

Key Features

Installation

Method 1.

Method 2.

For PersistentWindows to be able to restore windows with elevated privileges (for tools like Task Manager or Event Viewer), it needs to be run with Administrator privileges.

To set up PersistentWindows to automatically start at user login:

This can be done by creating a task in Task Scheduler, or by adding a shortcut to the Startup Folder (shell:startup).

Choose one of the three methods:

Method 1. Task Scheduler (Windows 10/11)

Method 2. Task Scheduler (Windows 7/10/11)

  start "" /B "%~dp0PersistentWindows.exe" -splash=0
schtasks /create /sc onlogon /tn "StartPersistentWindows" /f /tr "'%~dp0pw.bat'" /rl HIGHEST
REM Override High DPI Scaling
REG ADD "HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "%~dp0PersistentWindows.exe" /t REG_SZ /d "~ HIGHDPIAWARE" /f

Method 3. Startup Folder (Windows 7/10/11)

Uninstall

Step 1. run uninstall.bat as admin to delete private appdata folder created by PersistentWindows and remove auto start task

Step 2. if installed using winget, run "winget uninstall PersistentWindows", otherwise remove the directory containing PersistentWindows.exe

Usage Instructions

Privacy Statement

Known Issues

Tips To Digest Before Reporting A Bug or Enhancement Request

PersistentWindows (kangyu-california/PersistentWindows)

Searching Database…

What is this?PersistentWindows is a Windows desktop utility that remembers where your windows were positioned and automatically restores that layout after events like waking from sleep, monitor connect/disconnect, resolution changes, or RDP reconnections.
Is this an app I run, or a background service?It's a standalone .exe that runs with no main window, sitting hidden in the System Tray; you interact with it via a right-click menu.
How do I install and run it?Install via 'winget install PersistentWindows', or download PersistentWindows.zip from the Releases page and unzip it anywhere, then run PersistentWindows.exe.
Do I need admin rights for it to work properly?For full functionality, like restoring elevated windows (Task Manager, Event Viewer), it needs to run with Administrator privileges.
Any known quirks I should watch for?On fractionally scaled displays (125%, 150%, etc.) it may malfunction unless launched via the auto-start task, and you may need to override its high-DPI scaling property to 'Application'. It can also get stuck in a red-icon 'busy' state if an unresponsive window blocks a restore.
Does it work on Windows 7 as well as 10/11?Yes, it targets Windows 7, 10, and 11, with startup setup instructions provided for all three.
What data does it collect, and where does it go?It records window position/size/Z-order, captions, process IDs, and keyboard/mouse events tied to its own UI actions; keystroke/mouse history is erased about 1 second after being received, and window history is kept in RAM or saved locally in a LiteDB file.
Can I take manual snapshots of my window layout?Yes, you can manually capture a layout to RAM as a snapshot (up to 36 per display configuration) or save it to disk in LiteDB format so it survives a reboot.
Does it restore the order windows were stacked in, not just position?Yes, window Z-order is preserved in manual snapshots, and can optionally be enabled for automatic restores too using the -fixzorder=1 option.
What is the 'webpage commander' feature?It's a vi-editor-style, one-letter keyboard shortcut system (triggered with Alt+W) for navigating web pages more efficiently in any major browser.
How do I make it start automatically at login?Three options: run the included autostartpw.bat to register a Task Scheduler task, create one manually via a .bat/.vbs wrapper for admin rights, or drop a shortcut into the Startup folder (shell:startup).
Size
2.4 MB
Stars
2.1K
Age
6y
Commits · 90 Days