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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:29:31+00:00 2026-05-27T07:29:31+00:00

Something equivalent to this command line: set PATH=%PATH%;C:\Something\bin To run my application, some thing

  • 0

Something equivalent to this command line:

set PATH=%PATH%;C:\Something\bin

To run my application, some thing has to be in a PATH variable. So I want at the program beginning catch exceptions if program fails to start and display some wizard for user to select the installation folder of a program that needs to be in a PATH. The I would took that folder’s absolute path and add it to the PATH variable and start my application again.

EDIT:

That “something” is VLC player. I need it’s installation folder in PATH variable (for example: C:\Program Files\VideoLAN\VLC). My application is single executable .jar file and in order to use it, VLC needs to be in a PATH. So when the user first starts my app, that little wizard would pop up to select the VLC folder and then I would update PATH with it.

  • 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-27T07:29:31+00:00Added an answer on May 27, 2026 at 7:29 am

    You can execute commands using the Process object, you can also read the output of that using a BufferedReader, here’s a quick example that may help you out:

    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    
    public class Main {
    
        public static void main(String args[]) {
            try {
                Process proc = Runtime.getRuntime().exec("cmd set PATH=%PATH%;C:\\Something\\bin");
                proc.waitFor();
                BufferedReader reader = new BufferedReader(new InputStreamReader(proc.getInputStream()));
    
                String line = reader.readLine();
                while (line != null) {
                    //Handle what you want it to do here
                    line = reader.readLine();
                }
            } 
            catch (IOException e1) { 
                //Handle your exception here
            }
            catch(InterruptedException e2) {
                //Handle your exception here
            }
    
            System.out.println("Path has been changed");
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like something equivalent to this code, except I don't want my_func to be
Came across something like this today, and was wondering if there was an equivalent
I'm trying to format some strings for output on the command-line, report style, and
I would like to implement something equivalent to the unix command 'rm foo*' using
I want to run a command and, when it's complete, have a record of
I'm currently working on a Flash application that has a sibling AIR equivalent. From
I always thought base.Something was equivalent to ((Parent)this).Something , but apparently that's not the
Is there something equivalent to OmniCppComplete for java in vim ? I know of
I'm looking for the equivalent in Qt to GetTickCount() Something that will allow me
I am looking for something like TRYCAST in TSQL or an equivalent method /

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.