๐Ÿ‘จโ€๐Ÿซ Tutorial AutoHotkey v2.0 | Auto-Save Screenshots in Windows (AHK + Batch File Guide)

Szy

Honorary Poster
This guide shows how to automatically save Win + Shift + S screenshots to a folder without manual pasting using AutoHotkey (AHK) and a Batch File.

Tools Used​

  1. Windows Snipping Tool (Win + Shift + S)​
  2. AutoHotkey v2.0 (for automating the process) โ†’ You do not have permission to view the full content of this post. Log in or register now.
  3. Batch File (CMD & PowerShell) (for handling file storage)​

How It Works​

โœ… Press Win + Shift + S โ†’ Screenshot is copied to clipboard
โœ… AHK script triggers the batch file
โœ… Batch file creates a folder with today's date
โœ… Screenshot is auto-saved inside that folder with sequential numbering



๐Ÿ“‚ Final Folder Structure Example:
Code:
C:\Users\Administrator\Pictures\Screenshots\
    โ”œโ”€โ”€ 2025-02-24\
    โ”‚   โ”œโ”€โ”€ screenshot1.png
    โ”‚   โ”œโ”€โ”€ screenshot2.png
    โ”œโ”€โ”€ 2025-02-25\
    โ”‚   โ”œโ”€โ”€ screenshot1.png



Step 1: Install AutoHotkey​

๐Ÿ”น Download & Install AutoHotkey v2.0 from You do not have permission to view the full content of this post. Log in or register now.

Step 2: Create the AutoHotkey Script​

๐Ÿ“Œ Open Notepad and paste the following code:
Code:
#Requires AutoHotkey v2.0

#+s:: {
    ; Simulate pressing Win + Shift + S (to trigger Windows Snipping Tool)
    Send("#+s")
 
    Sleep(1000) ; Wait for clipboard to update

    ; Run batch script to save the screenshot
    Run("C:\Users\Administrator\Documents\Batch File\autosave_screenshot.bat", , "Hide")
}
๐Ÿ“Œ Save it as screenshot.ahk
๐Ÿ“Œ Run the script (Right-click โ†’ Run Script)

Step 3: Create the Batch File

๐Ÿ“Œ Open Notepad and paste the following code:
Code:
@echo off
setlocal enabledelayedexpansion

:: Define base screenshots folder (Auto-adjusts to current user's account)
set "baseFolder=C:\Users\%USERNAME%\Pictures\Screenshots"

:: Get today's date in YYYY-MM-DD format
for /f "tokens=2 delims==" %%I in ('"wmic os get localdatetime /value"') do set datetime=%%I
set "dateFolder=%baseFolder%\%datetime:~0,4%-%datetime:~4,2%-%datetime:~6,2%"

:: Ensure today's folder exists
if not exist "%dateFolder%" mkdir "%dateFolder%"

:: Auto-increment filename
set "count=1"
:check
if exist "%dateFolder%\screenshot!count!.png" (
    set /a count+=1
    goto check
)

:: Save clipboard image to next available file
powershell -command "Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.Clipboard]::GetImage().Save('%dateFolder%\screenshot!count!.png')"

echo Screenshot saved as %dateFolder%\screenshot!count!.png
๐Ÿ“Œ Save it as autosave_screenshot.bat
๐Ÿ“Œ Store it in: C:\Users\Administrator\Documents\Batch File\autosave_screenshot.bat

Step 4: Run the AHK Script

  1. Double-click screenshot.ahk to run the script
  2. Press Win + Shift + S โ†’ Screenshot will be automatically saved!



Final Result

Every time you take a screenshot (Win + Shift + S), it will:
โœ… Create a folder per day ๐Ÿ“‚
โœ… Save the screenshot automatically ๐Ÿ–ผ๏ธ
โœ… Name it sequentially (screenshot1, screenshot2, etc.) ๐Ÿ”ข

๐Ÿ›  Troubleshooting

Screenshots arenโ€™t saving?
โœ” Check that the batch file path is correct in the AHK script
โœ” Ensure AutoHotkey is running
โœ” Manually run the batch file to see if it works

Want to change the save location?
โœ” Edit baseFolder in the batch file

Done! No more manually pasting into Paint or other apps. Feel free to modify & improve the script.
 

About this Thread

  • 0
    Replies
  • 607
    Views
  • 1
    Participants
Last reply from:
Szy

Trending Topics

Online now

Members online
536
Guests online
913
Total visitors
1,449

Forum statistics

Threads
2,273,600
Posts
28,950,528
Members
1,235,851
Latest member
djilali21
Back
Top