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 3676864
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:09:07+00:00 2026-05-19T03:09:07+00:00

I have a DOS batch file to run on a daily basis. Something similar

  • 0

I have a DOS batch file to run on a daily basis.
Something similar like –

@ECHO ON
SET COMMON_LIB=commons-io-1.3.1.jar;
SET AR_CLASS_PATH=%CLASSPATH%%COMMON_LIB%

java -cp %AR_CLASS_PATH% -Xms128m -Xmx256m FileCreating

PAUSE

When I run the batch file directly, i.e. double cliking on the .bat file, it runs fine, the command window opens up and executes all the required commands( note the PAUSE ).
But when I schedule a daily task, I see the status as Running. Also, when I right click on the task, it gives me an option to end the task(when status is Running ) but I cant see the command window and so I cant make out if it has been processed or the error it has generated.
And so, cant understand if the error is in classpath or my java code or somewhere else.

The environment is Windows Server 2003 R2 EE, SP2. The user has Admin priviledges.
I checked but there is no file of Schedlgu.txt in WINDOWS\Tasks dir.
One thing I noticed was the CLASSPATH value had no reference to the jdk/bin, can that be a issue?
Please advise.

EDIT

Just to simplify things, I commented the java command for the bat file to do almost nothing then set some variables and then pause to keep the window open. Still no success.

  • 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-05-19T03:09:07+00:00Added an answer on May 19, 2026 at 3:09 am

    Well, after some trial and error, I was finally able to get my scheduled task to run.
    As suggested by Dave, I had the std out redirected to a text file, so that I can see what errors are generated. But the text file came out blank and the task was run.
    So I added a java -version

    @ECHO ON
    
    SET COMMON_LIB=commons-io-1.3.1.jar;
    SET AR_CLASS_PATH=%CLASSPATH%%COMMON_LIB%
    
    java -version
    
    java -cp %AR_CLASS_PATH% -Xms128m -Xmx256m FileCreating
    

    and still no result, even now the text file was blank.

    Then, I created a simple HelloWorld program and added this java command to the bat file

    @ECHO ON
    
    SET COMMON_LIB=commons-io-1.3.1.jar;
    SET AR_CLASS_PATH=%CLASSPATH%%COMMON_LIB%
    
    java -version
    
    java HelloWorld > C:\ChechHW.txt
    
    java -cp %AR_CLASS_PATH% -Xms128m -Xmx256m FileCreating
    

    The CheckHW.txt had the output text, I had given in the HelloWorld program.

    So now all these added to the confusion and annoyance.

    Interestingly and surprisingly, the issue was the CLASSPATH variable I am using to set the classpath with the java command.
    I dont know how and importantly why it started working after I removed the %CLASSPATH% from

    SET AR_CLASS_PATH=%CLASSPATH%%COMMON_LIB% 
    

    The bat file in my question was and is working on a Windows XP system without this change.
    I wonder some setting on the Windows 2003 Server related to Java class path was not allowing it to process.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DOS-batch like this : @echo off if %1 == %2 GOTO
First some background. I have a batch-type java process run from a DOS batch
I have a batch file in DOS that does some checking and I need
I have an FTP batch file that uses DOS commands to pull down some
I have a DOS batch file that show some results on the cmd console.
In a DOS batch file we can only have 1 line if statement body?
I know I have already answered a similar question ( Running Batch File in
I have the following values in a DOS batch file (for example...): ..\Apple\Jones ..\Banana\Smith
In DOS batch, I have to read file paths from a file encoded in
I have written huge MS DOS Batch file. To test this batch file I

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.