write for me a script as .bat file so it will notify me w...

A public project built with the Lightcap AI agent by anon-f065 — open to read, run, fork, and export. Updated .

Prompt

write for me a script as .bat file so it will notify me when any one tries to access my laptop using smb shars

Lightcap

bat @echo off rem Monitor SMB share sessions. Run with administrator rights. rem Checks for active SMB sessions every 5 seconds and displays a message box when a new session is detected.

setlocal EnableDelayedExpansion

:monitor for [path] "tokens=1,2 delims=:" %%a in ('net session ^| findstr [path] "^[0-9]"') do ( set "sess=%%a" if not "!sess!"=="" ( call :notify goto monitor ) )

timeout [path] 5 [path] >nul goto monitor

:notify msg * "SMB share access attempt detected!" exit [path]

Browse all public projects

Lightcap