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

  • SEARCH
  • Home
  • 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 8738711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:47:11+00:00 2026-06-13T10:47:11+00:00

I am trying to create two bat files. one is c.bat and the other

  • 0

I am trying to create two bat files. one is c.bat and the other is r.bat

c.bat just contains:

cls
javac *.java

which will compile all .java files.

in r.bat I have:

cls
java *

it will not run the class files. I think its because the * in the “java *” line translates to “java Class1.class”, “java Class2.class” and so one when it should be “java Class1” and “java Class2” only. (without the extensions) how can I do this? I just started learning these things and I can’t find the right answer anywhere.

  • 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-13T10:47:12+00:00Added an answer on June 13, 2026 at 10:47 am

    The following loops over all the .javafiles found in C:\java\stuff and runs them one after another. The %%~nf is formatting the files name to not display the file extension i.e the java class name. If you change java %%~nf to echo java %%~nf you can see exactly what is going on.

    cls
    for "C:\java\stuff" %%f in (*.java) do (
        java %%~nf
    )
    

    For: The following options are available:

    Variable with modifier  Description
    
    %~I                     Expands %I which removes any surrounding 
                            quotation marks ("").
    %~fI                    Expands %I to a fully qualified path name.
    %~dI                    Expands %I to a drive letter only.
    %~pI                    Expands %I to a path only.
    %~nI                    Expands %I to a file name only.
    %~xI                    Expands %I to a file extension only.
    %~sI                    Expands path to contain short names only.
    %~aI                    Expands %I to the file attributes of file.
    %~tI                    Expands %I to the date and time of file.
    %~zI                    Expands %I to the size of file.
    %~$PATH:I               Searches the directories listed in the PATH environment 
                            variable and expands %I to the fully qualified name of 
                            the first one found. If the environment variable name is 
                            not defined or the file is not found by the search,
                            this modifier expands to the empty string. 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to create two clients; one is pub/sub, the other is a standard connection.
I am trying to create two separate sessions- one for if the user is
I am trying to create two separate sessions- one for if the user is
I am trying to create a two component UIPickerView, the left side of which
I am trying to create two types where one is able to remove itself
Trying to create an outer join on two other joined tables when recieving this
I'm trying to create two dropdownlist, the first one with a list of users,
I am trying to create two WCF services which should be able to access
I am currently trying to create two simple one-to-one mappings using Hibernate but somehow
Hi every one i'm trying to create two divs. One div has a different

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.