User
Welcome, Guest. Please login or register.
September 09, 2010, 04:44:50 AM

Login with username, password and session length

Search
News
Mogware announces the ReplicationPlugin!
Latest Downloads
Links
« previous next »
Pages: [1] Print
Author Topic: Day Of Week - batch file for script plugin  (Read 4404 times)
Endless Loop
FileHamster Beta
Hamster
**

Karma: +3/-0
Posts: 72


« on: February 25, 2009, 10:03:36 AM »

Thought someone might find this handy.

Here is a simple batch file that can be used with the script plugin or Windows Task scheduler if you want to perform an action only on a specific day.

The echo and pause statements for each day can be removed they were just for testing.

Code:

@echo off

for /f %%a in ('date /t') do set DAY=%%a
if %DAY%==Mon goto :mon
if %DAY%==Tue goto :tue
if %DAY%==Wed goto :wed
if %DAY%==Thu goto :thu
if %DAY%==Fri goto :fri
if %DAY%==Sat goto :sat
if %DAY%==Sun goto :sun

:mon
:: put your processing here
echo %day%
pause
exit

:tue
:: put your processing here
echo %day%
pause
exit

:wed
:: put your processing here
echo %day%
pause
exit

:thu
:: put your processing here
echo %day%
pause
exit

:fri
:: put your processing here
echo %day%
pause
exit

:sat
:: put your processing here
echo %day%
pause
exit

:sun
:: put your processing here
echo %day%
pause
exit


This was only tested on XP as I "don't do Vista"

Endless Loop


Logged
Dave
Mogware Developer
Guinea Pig
*****

Karma: +1/-1
Posts: 318


« Reply #1 on: February 25, 2009, 02:22:22 PM »

Sweetness!!!

I think I will open up a Scripts section so we can get a good list of ideas and things people do with the Script Plugin.
Logged
akshunjo
Mouse
*

Karma: +0/-0
Posts: 1


« Reply #2 on: June 10, 2010, 05:22:04 AM »

I just registered and am necro'ing this thread just because the OP helped me out greatly with a batch I was scribbling out.  The solution I was looking at was a lot more complicated than this little elegant piece.

Good work.
Logged
JohnRen
Mogware Developer
Rabbit
*****

Karma: +3/-0
Posts: 1046


« Reply #3 on: June 10, 2010, 12:25:13 PM »

Please post your finished work when you are done; I'd like to see what you're working on...Besides, I'm sure the next guy would appreciate having your example.  Wink
Logged
dodecahedron
Mouse
*

Karma: +0/-0
Posts: 1


« Reply #4 on: August 20, 2010, 10:11:50 AM »

Endless Loop -
Thank you thank you.  Day of the Week script is clean, simple and beautiful.  Very happy to have found you.
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by SMF 1.1.9 | SMF © 2006-2007, Simple Machines LLC Epsilon design by Bloc