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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T21:28:42+00:00 2026-05-10T21:28:42+00:00

I am familiar with using the os.system to run from the command line. However,

  • 0

I am familiar with using the os.system to run from the command line. However, I would like to be able to run a jar file from inside of a specific folder, eg. my ‘test’ folder. This is because my jar (located in my ‘test’ folder) requires a file inside of my ‘test’ folder. So, how would I write a function in my script that does the following: c:\test>java -jar run_this.jar required_parameter.ext ? I’m a python newbie so details are greatly appreciated. Thanks in advance.

  • 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. 2026-05-10T21:28:43+00:00Added an answer on May 10, 2026 at 9:28 pm

    Here is a small script to get you started. There are ways to make it ‘better’, but not knowing the full scope of what you are trying to accomplish this should be sufficient.

    import os  if __name__ == '__main__':    startingDir = os.getcwd() # save our current directory    testDir = '\\test' # note that \ is windows specific, and we have to escape it    os.chdir(testDir) # change to our test directory    os.system('java -jar run_this.jar required_paramter.ext')    os.chdir(startingDir) # change back to where we started 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using NetBeans, trying to change the familiar Java coffee cup icon to a
I am not really familiar with Maven program but I've been using Eclipse for
I'm already familiar with the standard Java package naming convention of using a domain
I am familiar with standard practices to assess performance query or stored procedure using
I am using LaTeX and the figure environment. I am well familiar with the
Anyone familiar with specific security issues in the current version of DotNetNuke? (I've already
Anyone familiar with error below? When I run my webapp to generate a dynamic
I am familiar with nunit for unit testing of the business layer however I
If you're familiar with the phrase build one to throw away, well, we seem

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.