Sign in to follow this  
Followers 0
stupidout

Script to monitor how long a USB has been plugin.

2 posts in this topic

#1 ·  Posted (edited)

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
 
:LOOP
 
if %Counter%==7 GOTO Event
Del /f /q c:\Counter\%Counter%.txt
Set /A Counter+=1
echo > C:\Counter\%Counter%.txt
ping -n 86400 127.0.0.1
GOTO LOOP
 
:Event
 
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%"
 
:End

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

Edited by stupidout

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  
Followers 0