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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:50:03+00:00 2026-05-28T16:50:03+00:00

I have a problem dealing with Windows environment variables in a puppet (configuration management)

  • 0

I have a problem dealing with Windows environment variables in a puppet (configuration management) script. My scripts deal with silent instalation of resources and configuration of their requirements (environment variables, files, etc..)

My problem comes here. One of my scripts installs a JDK in a windows system, this means install the executable, configure JAVA_HOME and JRE_HOME and include %JAVA_HOME%/bin into %PATH%. This is easy to perform through setx commands but has a problem when it comes to performing a second execution of the script: the PATH variable ends up being %PATH%;%JAVA_HOME%/bin;%JAVA_HOME%/bin (and further executions will mean a longer var).

The solution to this side effect is perform the command only if %PATH% does not already contains %JAVA_HOME/bin and that could be performed through an echo %PATH% | find "%JAVA_HOME/bin" only if variables would not be expanded by default…

I have to say, that the previous command fails because JAVA_HOME contains its version (like C:\Program Files\Java\jdk_6u30).

So… it is possible to echo an environment variable without expanding its contents? I only need the RAW variable at find command, nothing more.

  • 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-28T16:50:05+00:00Added an answer on May 28, 2026 at 4:50 pm

    You can read the PATH directly from the registry:

    reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v Path
    

    This will allow to get it’s value without expansion.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have problems with dealing with widows within a multicols environment, that is, I
I have a big problem dealing with data I try to download in my
I am wondering on the best way of dealing with a problem I have.
I have a problem while dealing with a data set which the value range
Ok, so, I have a different kind of problem when dealing with Radio button
I'm dealing with a strange problem. I have a GUI built using swing. Its
i have a hard problem dealing with template. please help me. App.xaml <Application x:Class=WpfApplication1.App
I have a problem dealing with Generics. Some background: The Animal class is a
I have a problem dealing with bad_alloc. It is thrown during a std::vector.push_back when
I have a pretty strage problem im dealing with. Lost sessionvariables in firefox. Im

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.