Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8292289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:25:32+00:00 2026-06-08T13:25:32+00:00

I have a java file TestOutput.java that we need to run only on Sundays.

  • 0

I have a java file TestOutput.java that we need to run only on Sundays. We also have a DOS based file copy command that need to run only on Sunday. How can this be achieved?
The batch file has some parts that need to run every day, and some that runs only on Sunday.

It has to do the following in the batch file:

REM This part runs every day
copy E:\Data\output1.psv S:\Output\output1.psv
...
...
...
REM This part runs on Sunday only
IF (DAY of sysdate=='SUNDAY')
    java TestOutput
    copy E:\Data\output2.psv S:\Output\output2.psv
END IF

please help.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T13:25:35+00:00Added an answer on June 8, 2026 at 1:25 pm

    This solution is locale independent.

    set "dayOfWeek="
    for /f "skip=1" %%A in ('wmic path win32_localtime get dayofweek') do if not defined dayOfWeek set "dayOfWeek=%%A"
    ::0=Sunday, 1=Monday,... 6=Saturday
    if "%dayOfWeek%"=="0" (
      REM Sunday processing goes here
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a java class file which I need to run on every file
I have a java JAR file that is triggered by a SQL server job.
I have two Java.io.File objects file1 and file2. I want to copy the contents
I have a Java program that opens a file using the RandomAccessFile class. I'd
i have a java ee project which has a text file that uses a
I have a single .java (driver.java) file I'm trying to compile and run from
I have java file and a few libraries which I need to import. How
I have a java file in Eclipse that is in UTF-8 and has some
Assume that I have a java file, how can I wrap it into a
I currently have a java file that has buttons to create new GUI windows.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.