A lightweight Windows toast notification utility for environments with PowerShell language mode restrictions.
This tool enables Windows toast notifications in corporate environments where PowerShell is restricted to Constrained Language Mode, preventing access to Windows.UI.Notifications .NET objects. It provides a native executable solution that works without administrative privileges.
- No Admin Required - Runs under standard user privileges
- Minimal Size - ~20KB executable without embedded icon
- Secure - Input validation, path sanitization, XML injection prevention
- Native Templates - Uses proper Windows toast templates (ToastImageAndText01/02, ToastText01/02)
- Customizable - Title, message, icon, audio, and notification types
- Windows 11 Ready - Tested on Windows 11 x64 v23H2
- Windows 10/11 (tested on Windows 11 x64 v23H2)
- .NET Framework 4.8 (pre-installed on Windows 10/11)
- Standard user account (no admin privileges required)
- .NET Framework 4.8
- Windows SDK 10.0.26100.0 or compatible version
- 64-bit Windows OS
CSV.ToastNotifier.exe -m "Hello World" -s "MyApp"CSV.ToastNotifier.exe -m "Build completed" -s "BuildSystem" -t "Success"CSV.ToastNotifier.exe -m "Meeting starting" -s "Calendar" -t "Reminder" -i "C:\Icons\meeting.png" -a "C:\Sounds\chime.wav"CSV.ToastNotifier.exe -m "Background task finished" -s "Backup" --mutedCSV.ToastNotifier.exe -m "Important deadline" -s "TaskManager" --type reminder| Argument | Short | Description | Max Length |
|---|---|---|---|
--message |
-m |
Notification message (required) | 256 chars |
--source |
-s |
Application name (required) | 32 chars |
--title |
-t |
Notification title | 32 chars |
--icon |
-i |
Path to PNG icon file | 259 chars |
--audio |
-a |
Path to WAV audio file | 259 chars |
--muted |
Disable notification sound | ||
--type |
Type: default, reminder, alarm, incomingCall, urgent |
||
--help |
-h, /? |
Show help message |
Important
Read before using build.bat: DO NOT COPY build.bat to other project directory without testing and modification of build.bat as needed. Create a backup of larger project before using build.bat there.
Warning
build.bat will perform cleanup of the following directories:
CSV.ToastNotifier\Source Files\bin
CSV.ToastNotifier\Source Files\obj
build.bat will perform cleanup of the following files:
CSV.ToastNotifier\Release\CSV.ToastNotifier.pdb
CSV.ToastNotifier\Source Files\Release\CSV.ToastNotifier.pdb
build.bat can perform 2 types of build: LocalBuild and ProjectBuild. build.bat will choose build type automatically - based on location of build.bat file.
If running build.bat from 'CSV.ToastNotifier\Build System' output will be in 'CSV.ToastNotifier\Release'.
If running build.bat from 'CSV.ToastNotifier\Source Files' output will be in 'CSV.ToastNotifier\Source Files\Release'.
build.bat supports compiling project '.csproj' file with MSBuild dotnet and supports compiling directly with .NET Framework 4.8 csc.exe.
Build.batBuild.bat /usedotnetBuild.bat /useframeworkbuild.bat will automatically include 'CSV.ToastNotifier.manifest' and 'Icon.ico' if found near source file.
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /target:exe /out:CSV.ToastNotifier.exe /platform:x64 ^
/reference:"C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.26100.0\Windows.winmd" ^
/reference:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Runtime.WindowsRuntime.dll" ^
/reference:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Runtime.dll" ^
/reference:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Runtime.InteropServices.WindowsRuntime.dll" ^
/optimize+ /debug:pdbonly /win32manifest:CSV.ToastNotifier.manifest ^
CSV.ToastNotifier.csmsbuild CSV.ToastNotifier.csproj /p:Configuration=Release /p:Platform=x64dotnet build CSV.ToastNotifier.csproj -c Release -o Release
dotnet publish CSV.ToastNotifier.csproj -c Release -o Release- .NET Framework 4.8
- Windows.UI.Notifications (Windows Runtime)
- Windows SDK 10.0.26100.0 or later
- Provides Windows.winmd for Windows Runtime APIs
- Download: https://developer.microsoft.com/windows/downloads/windows-sdk/
signtool sign /f "certificate.pfx" /p "password" /t http://timestamp.digicert.com CSV.ToastNotifier.exesigntool sign /n "Certificate Name" /t http://timestamp.digicert.com CSV.ToastNotifier.exeBuild.bat /sign /cert "certificate.pfx" /pass "password"- Input Validation - Length limits enforced on all text inputs
- Path Security - Regex validation prevents directory traversal
- XML Safety - Invalid XML characters removed
- File Verification - Binary signature validation for PNG/WAV
- System Protection - Blocks access to Windows system directories
- Size Limits - 1MB for PNG, 10MB for WAV files
[To be updated with official release hash]
CSV.ToastNotifier.exe: ________________________________________________________________
Verify with:
certutil -hashfile CSV.ToastNotifier.exe SHA256- Language: C# 5.0
- Framework: .NET Framework 4.8
- Target: x64 Windows
- Templates: ToastImageAndText01/02, ToastText01/02
- Output Type: WinExe (no console window)
MIT License - Copyright Β© 2025 Jon Damvi
- Icon shows small if Windows visual effects disabled (System β Performance β "Adjust for best appearance")
- Focus Assist blocks notifications when enabled
- Line 282 contains
iconPathValid = true;debug code
Current Build.bat references Windows SDK path directly. Update line:
/reference:"C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.26100.0\Windows.winmd" ^