Set WshShell = CreateObject("WScript.Shell") WshShell.SendKeys "PRTSC" Run with:
The "Print Screen" (PrtScn) functionality in Windows is not a single command-line executable but rather a system-wide keyboard interrupt. However, you can control screenshot behavior, save files, and automate captures using built-in Windows commands ( powershell , snippingtool , start ) and shortcuts. 1. Native Keyboard Commands (No Software) These are the most direct "commands" triggered by keys: print screen windows command
| Command (Key Combo) | Action | |---------------------|--------| | PrtScn | Copies entire screen to clipboard. | | Alt + PrtScn | Copies only the active window to clipboard. | | Win + PrtScn | Saves full-screen screenshot as PNG in C:\Users\<YourName>\Pictures\Screenshots . Also copies to clipboard. | | Win + Shift + S | Opens / Snip & Sketch UI to select a region. Copies to clipboard. | | Win + G (Game Bar) | Opens Game Bar → click camera icon or use Win + Alt + PrtScn to save screenshot of active window to C:\Users\<YourName>\Videos\Captures . | Note: These are not cmd or PowerShell commands, but they are the standard Windows "print screen commands." 2. Command Line & PowerShell Methods For automation or scripting, use these real commands in cmd or PowerShell. a) PowerShell: Capture & Save Screen Run in PowerShell (not CMD by default): Set WshShell = CreateObject("WScript
# Capture entire screen and save as PNG Add-Type -AssemblyName System.Windows.Forms Add-Type -AssemblyName System.Drawing $screen = [System.Windows.Forms.SystemInformation]::VirtualScreen $bitmap = New-Object System.Drawing.Bitmap $screen.Width, $screen.Height $graphics = [System.Drawing.Graphics]::FromImage($bitmap) $graphics.CopyFromScreen($screen.X, $screen.Y, 0, 0, $bitmap.Size) $bitmap.Save("$env:USERPROFILE\Desktop\screenshot.png") $graphics.Dispose() $bitmap.Dispose() To run this from : Native Keyboard Commands (No Software) These are the
powershell -Command "Add-Type -AssemblyName System.Windows.Forms; Add-Type -AssemblyName System.Drawing; $screen = [System.Windows.Forms.SystemInformation]::VirtualScreen; $bmp = New-Object System.Drawing.Bitmap $screen.Width, $screen.Height; $g = [System.Drawing.Graphics]::FromImage($bmp); $g.CopyFromScreen($screen.X, $screen.Y, 0, 0, $bmp.Size); $bmp.Save('%USERPROFILE%\Desktop\screenshot.png'); $g.Dispose(); $bmp.Dispose()" # Open Snipping Tool in region-select mode snippingtool /clip Or (Windows 11/10 newer versions) start ms-screenclip: c) Simulate Print Screen Key via Script Using a Visual Basic Script (save as printscreen.vbs and run via cscript or wscript ):