A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » Windows XP Help and Support
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Help with Windows script



 
 
Thread Tools Display Modes
  #1  
Old August 5th 20, 05:17 PM posted to microsoft.public.windowsxp.help_and_support
No_Name
external usenet poster
 
Posts: 4
Default Help with Windows script

I use Windows scheduler to run BAT files using the "At startup" option. Is it possible to insert some script into the BAT file that will prevent it from running on weekends?

If not, is there some way to accomplish this while still being able to run at startup the rest of the time?

All help appreciated.
Ads
  #3  
Old August 14th 20, 04:19 PM posted to microsoft.public.windowsxp.help_and_support
Ivan Denisovich
external usenet poster
 
Posts: 16
Default Help with Windows script

On Thursday, August 6, 2020 at 10:23:53 AM UTC-5, JJ wrote:
On Wed, 5 Aug 2020 09:17:54 -0700 (PDT), wrote:
I use Windows scheduler to run BAT files using the "At startup" option.
Is it possible to insert some script into the BAT file that will prevent
it from running on weekends?

If not, is there some way to accomplish this while still being able to
run at startup the rest of the time?

All help appreciated.

Make the batch file check the current day. If it's weekend, exit the batch
file (don't continue to execute its main task). Otherwise, continue as
normal.

e.g.: (note: Sunday is 1, Monday is 2, etc.)

@echo off
setlocal
echo wscript.echo datepart("w", now)"%temp%\day.vbs"
for /f %%A in ('cscript //nologo "%temp%\day.vbs"') do set d=%%A
del "%temp%\day.vbs"
if "%d%" == "7" goto :eof

rem the main task code
rem ...

Many thanks for your help, I appreciate it!
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off






All times are GMT +1. The time now is 09:13 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.