-4

I already set environment variable using batch file in windows. i am struct in load in that environment variable into one text file. i searched in stack overflow, but not getting my solution, thanks in advance.

Harry Johnston
  • 35,639
  • 6
  • 68
  • 158
Balasubramanian
  • 700
  • 7
  • 26
  • question is how to load environment variable in my property file. Ex: i configured like this ${demo_home}/log in that property file. but not setting this demo_home but i am having in environment variable. – Balasubramanian Aug 31 '17 at 15:22
  • So you want the program that reads the property file to look up the environment variable? Is it your program that reads the property file? How do you go about reading the file? What language are you using? What part of the problem are you stuck on? Post some code. – Harry Johnston Aug 31 '17 at 21:51
  • In java language, i need to load in log4j.property ex:log4j.appender.Daily.File=${demo_home}/Rflite.log – Balasubramanian Sep 01 '17 at 04:30
  • Please edit your question to include the necessary details. That doesn't look like Java code to me, please include the actual code that reads the file. – Harry Johnston Sep 01 '17 at 04:41
  • In java application log4j.property i am having this line, log4j.appender.Daily.File=${Retail_HOME}/Rflite.log . also i already set Retail_HOME path as environment variable. my question is how to load that path in my property – Balasubramanian Sep 01 '17 at 04:45
  • Possible duplicate: https://stackoverflow.com/q/2263929/886887 – Harry Johnston Sep 01 '17 at 04:48
  • in java application application.proeprty is different and logger property also different. i dint process in logger property like map conversion. so it is not duplicate – Balasubramanian Sep 01 '17 at 05:00
  • The answers in the proposed duplicate explain how you can change your code so that it does what you want it to do. Why doesn't that answer your question? – Harry Johnston Sep 01 '17 at 05:10

1 Answers1

0

If you want to load the contents of you PATH variable to a text file using windows cmd, use the following command:

D:\>path>myPath.txt

The myPath.txt file will be created in your D drive in this case.

Saad Patel
  • 49
  • 7