Jump to content
Sign in to follow this  

Script to monitor how long a USB has been plugin.

Recommended Posts


Need help on my script. I got two codes to work the monitor I'm trying to use. Both of them are working, I just want to convert this part to exe file but I'm getting an error message

@echo off
eventcreate /t SUCCESS /ID 365 /L System /SO Alert /D "USB Backup drive was plugged in %date% %time%"
Set now=%date%
Set now1=%time%
taskkill /f /im counter.exe /t
del /f /s /q C:\Counter
Set Counter=0
if %Counter%==7 GOTO Event
Del /f /q c:\Counter\%Counter%.txt
Set /A Counter+=1
echo > C:\Counter\%Counter%.txt
ping -n 86400
eventcreate /t WARNING /ID 365 /L System /SO Alert /D "USB Backup drive needs to be Swapped. The drive was plugged in last %now% %now1%"

I think I would need help converting the code to .au3.

Edited by stupidout

Share this post

Link to post
Share on other sites

Start with the helpfile and see what parts you think relate to your script then knock something together and then post it so the members can guide you.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.