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 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

To all those familiar with D programming language , how would go about using
I'm very familiar with using Enums in other languages, but I'm having some difficulty
I'm familiar with using NSLocalizedString() to localize strings, but the problem I have today
I am not familiar with using event handlers, and I was wondering if anyone
I'm using AdventureWorks as a database to get familiar with linq and asp.net interface
I'm using a new no-name framework that I'm not completely familiar with and I'm
I have been using emacs for a while but not so familiar with lisp
I'm familiar with creating websites in ASP.NET MVC using C#. But I never learned
I am somewhat familiar to Java, but am using it more now for Android.
As a developer using DB2 for the first time, I'm not familiar with what

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.