Mike Slinn

Multiscreen Windows Tracker Script

Published 2025-12-17.
Time to read: 1 minutes.

This page is part of the posts collection, categorized under Windows.

This article help you set the startup position of Microsoft Terminal.

The following PowerShell script tracks the mouse across multiple monitors.

multiscreen.ps1
# multiscreen.ps1 - Live Mouse Coordinate Tracker for 2025
# Mike Slinn mslinn@mslinn.com

Add-Type -AssemblyName System.Windows.Forms

Write-Host "--- Multi-Screen Coordinate Tracker ---" -ForegroundColor Cyan
Write-Host "Press CTRL+C to stop the script.`n" -ForegroundColor Yellow

while ($true) {
    # Get current global mouse position
    $pos = [System.Windows.Forms.Cursor]::Position

    # Get all screens to identify which one the mouse is on
    $currentScreen = [System.Windows.Forms.Screen]::FromPoint($pos)
    $screenName = $currentScreen.DeviceName.Replace("\\.\", "")

    # Construct the display string
    $output = "`r[Screen: $screenName] | X: $($pos.X.ToString().PadRight(6)) | Y: $($pos.Y.ToString().PadRight(6))"

    # Write to console without a new line for a "live" dashboard feel
    Write-Host $output -NoNewline

    Start-Sleep -Milliseconds 50
}

Enable script execution:

PowerShell (Administrative)
PS C:\WINDOWS\system32> Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force

See Add To Windows User Path if you need to add the directory you saved multiscreen.ps1 to the Windows user path.

The following multiscreen.ps1 can be run in any PowerShell.

PowerShell
PS C:\Users\Mike Slinn> multiscreen.ps1
--- Multi-Screen Coordinate Tracker ---
Press CTRL+C to stop the script.

[Screen: DISPLAY2] | X: -1524 | Y: 678 

The following shows the number of characters the current Bash terminal can display:

Shell
$ echo $COLUMNS
209 
* indicates a required field.

Please select the following to receive Mike Slinn’s newsletter:

You can unsubscribe at any time by clicking the link in the footer of emails.

Mike Slinn uses Mailchimp as his marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp’s privacy practices.