Jump to content

get environment variables simultaneously after set


EetieD
 Share

Recommended Posts

For my application, I need to permanently set and get environment variables simultaneously. For my Java application, you have to start a 'Command Prompt' window first. I am using the Resource Toolkit 'setx.exe' to set environment variables, but it didn't succeed me to get the environment variables realtime, without restarting the Command Prompt. Is there a way, maybe a tool, to get the most recent environment variables, without restarting the Command Prompt?

Thanks for help!

EetieD.

Link to comment
Share on other sites

Welcome to the Windows Forum.

You don't explain enough what you are trying to achieve, or why you need to restart Command Prompt to 'get' environment variables in a Java app.

I hope I can make more clear by this text:

I have a Java application that sets a environment variable permanently (using setx.exe). This Java application will be started from a Command Prompt window.

For monitoring of this setting in my Java application, I would like to verify this action after I set this variable. But, the new environment variables will only be reloaded when I re-open this Command Prompt window. I don't want to re-open a Command Prompt window, because that means I have to restart my Java application.

So, is there a way to reload the most recent 'environment variables' in a Command Prompt window, without re-opening a Command Prompt window?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy