2

When I use the "Snip & sketch" tool, I don't close the "Snip saved to clipboard" notifications.
But I want to make them disappear after rebooting the PC, how can I do that?

2
  • 1
    You have to clear clipboard as you need (most users I know do not want clipboard history cleared).
    – anon
    Commented Jan 26 at 12:40
  • Actually, I already know the answer, I should have prepared the text earlier. On StackOverflow, you can add an answer with the "Answer your own question" option. Commented Jan 26 at 12:54

1 Answer 1

1

Windows 10 notifications are stored in "%LOCALAPPDATA%\Microsoft\Windows\Notifications\wpndatabase.db".

In order to remove the notifications on log off (shutdown/reboot), you need to:

  1. Install the "PSSQLite" library to PowerShell (if it's not installed already):
    Install-Module -Name PSSQLite -Force
  2. Create a PowerShell script anywhere with a name you want, for example "RemoveSnipNotifications.ps1" (make sure that you have checked "File extensions" view option in the Explorer).
  3. Write the following code in it:
Import-Module PSSQLite

$DatabasePath = "$env:LOCALAPPDATA\Microsoft\Windows\Notifications\wpndatabase.db"

$DeleteQuery = @"
DELETE FROM Notification
WHERE Type = "toast"
AND (Payload LIKE "%Snip saved to clipboard%")
"@
Invoke-SqliteQuery -DataSource $DatabasePath -Query $DeleteQuery
  1. Open the "Group policy editor" - type gpedit.msc in the search field near the "Start" button (bottom left corner of the screen) and press Enter.
  2. Go to "User configuration" - "Windows settings" - "Scripts (Logon/Logoff)" and open the "Logoff" entry.
    (I didn't find the exact picture for that) I didn't find the exact picture for that
  3. Go to the "PowerShell Scripts" tab and press the "Add" button.
  4. Select the script that you created beforehand and press "OK".

From now, it should remove these notifications on log off.

Also, you can remove other type of notifications by adding more notification text conditions like this:

...
AND (Payload LIKE "%Snip saved to clipboard%" OR
     Payload LIKE "%other notification text%")
...

And you also can remove all the notifications by simply omitting the last line:

...
$DeleteQuery = @"
DELETE FROM Notification
WHERE Type = "toast"
"@
...
3
  • Please have a look at Can I answer my own question? and come back two days later and check as answered if you have more than 15 reputation. Commented Jan 26 at 13:12
  • Oh, it's not available because I don't have enough reputation, okay Commented Jan 26 at 13:15
  • Now enough reputation - try it again two days later. Commented Jan 26 at 15:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .