Changing Environment Variables (not jre path)

I am writing a setup program which will modify an Environment Variables. I need to add the string ";%PROGRAM_HOME%bin"to the Path variable. The problem lies in appending the new string onto the old one. For instance, say that
Path=%SystemRoot%\system32;andSystemRoot=C:\WINDOWSIf I get the current Path variable (so I can append to it) I get Path=C:\WINDOWS\system32After appending my new variable I getPath=C:\WINDOWS\system32;%PROGRAM_HOME%\binWhile this will work, problems will arise in the future if changes are made to the SystemRoot variable, since the Path value no longer contains a link to the SystemRoot variable.
Basically, is there a way to append to Environmental Variables?

I am writing a setup program which will modify an
Environment Variables. I need to add the string
";%PROGRAM_HOME%bin"to the Path
variable. The problem lies in appending the new
string onto the old one. For instance, say that
Path=%SystemRoot%\system32;andSystemRoot=C:\WINDOWSIf I get the current Path variable (so I can append
to it) I get Path=C:\WINDOWS\system32After appending my new variable I
getPath=C:\WINDOWS\system32;%PROGRAM_HOME%\bin[/
code]
While this will *work,* problems will arise in the
future if changes are made to the SystemRoot
variable, since the Path value no longer contains a
link to the SystemRoot variable. 
Basically, is there a way to append to Environmental
Variables?set PATH=%PROGRAM_HOME%\bin;%PATH%
(T)

Similar Messages

  • Changing environment variables not reflected in axis2.

    Hi,
    I am using axis2(1.2).And my problem is that I am trying to call two or more webservice from the same host .Let me explain.I have a web page .Its take some info to serach and also the parameter to which service to call.Suppose there are two service running (A and B).For A, need the following environment to set before calling :
    System.setProperty("javax.net.ssl.keyStore",keyStore);
    System.setProperty("javax.net.ssl.keyStorePassword", keyPwd);
    System.setProperty("javax.net.ssl.keyStoreType",keyType);
    System.setProperty("javax.net.ssl.trustStoreType",trustType);
    System.setProperty("javax.net.ssl.trustStore",trustStore);
    System.setProperty("javax.net.ssl.trustStorePassword",trustPwd);And for B do not required any environment variable.
    When I try to connect the B(clear all the environment) after accessing the A its throw the following exception :
    org.apache.axis2.AxisFault: sun.security.validator.ValidatorException:
    PKIX path building failed:
    sun.security.provider.certpath.SunCertPathBuilderException: unable to find
    valid certification path to requested targetBut if I restart the webserver and try to call B its working but if I try to access A its failed.
    So its seem to me that once the environment is set its not possible to reset it.
    So is there any solution.
    Thanks & Regrads

    i haven't used axis2 specifically, but i would imagine that it provides a way to configure that connection information for a specific webservice connection (as opposed to globally for the jvm). a quick google for "axis 2 custom keystore" found this link: http://shivendra-tripathi.blogspot.com/2010/11/enabling-ssl-for-axis2-service-and.html which shows how to configured an axis2 client with a custom keystore ("Approach 2", at the very end of the article). actually, looking again at that article, it may be configuring a system-wide setting (the Protocol.registerProtocol() call looks to be static). this looks better: http://wso2.org/library/1646 .
    Edited by: jtahlborn on Jul 11, 2011 2:06 PM

  • Add firewall rule with custom environment variable in program path

    Hi,
    We want to create a firewall rule for a program which is placed in folder which changes sometimes. I know you can add a firewall with the ProgramFiles environment variable like this:
    netsh advfirewall firewall add rule name="Test Firewall rule" dir=in program="%%ProgramFiles%%\Test\Test.exe" action=allow security=notrequired
    The environment variable ProgramFiles isn't expanded and if the Program Files folder is different on a system the rule still works.
    We try to use this with a custom environment variable which we set a system environment variable with this command:
    SETX SomeFolder "D:\Some Folder\Apr 2015" /M
    If we use the command below to add the firewall rule in a batch file the environment variable SomeFolder is expanded correctly and the program path is added as a static path.
    netsh advfirewall firewall add rule name="Some Firewall Rule" dir=in program="%SomeFolder%\AFile.exe" action=allow security=notrequired
    Because the folder changes sometimes we want to change the environment variable SomeFolder and not remove the old firewall rule and create a new one. We want to add the environment variable SomeFolder to the program path as a (dynamic) environment variable
    and not as the expanded path at the moment when the rule is added. If we use this command:
    netsh advfirewall firewall add rule name="Some Firewall Rule" dir=in program="%%SomeFolder%%\AFile.exe" action=allow security=notrequired
    We get the error:
              Windows Firewall with Advanced Security
              An error occurred while adding the rule.
              Error: The parameter is incorrect
              Status: The application name could not be resolved
              OK   
    Why can't we use %%SOMEFOLDER%% like we can use %%PROGRAMFILES%%? The same error is shown when we try to add the firewall rule through the management console 'Windows Firewall with Advanced Security'
    W. Spu

    Hi,
    Based on my plenty of test with this problem, it seems like there is no better method to achieve your requirement. To add new policy to firewall, it would be better using general cmdlet. The path parameter like %%SomeFolder%% do have problem in add firewall
    policy cmdlet. 
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • How to change Environment variables Windows Vista SP1 Home premuim 32 bit

    Hei. I run Windows Vista Home Premium 32bit SP1. Now i have a huge problem. By a mistake i changed the name in the environment variables settings. Now i cant access it to change it back. the message is "cannot find systemproperteis, control the
    settings and try again" But i cant controll the settings when i dont get access!! I remember it was %SystemRoot% before. If i right click My Computer-->Properties i cannot access the advanced tab. I cannot run anything from System32. If i run
    services.msc i get the note "the path do not exist, controll the setttings and try again". I am adminstrator. I can run cmd but not in adminstrator. Is it som way i can change or restore it to the right variables??

    Have you tried System Restore? See:
    http://www.howtogeek.com/howto/windows-vista/using-windows-vista-system-restore/
    If the initial instructions don't work, scroll down to the heading "If Your System Won't Boot"

  • SQLPATH environment variable not read by Sql Developer

    Does anyone know why Sql Developer doesn't seem to read the SQLPATH environment variable? I've googled this situation quite a bit with no luck. Am frankly very confused...How can Sql Developer not have the ability to read from the SQLPATH environment variable?
    Considering all the scripts out there that have been written for Sql*Plus, with the assumption that the SQLPATH variable has been set to allow for multiple directories?
    I feel like I'm just missing something in Tools->Preferences in Sql Developer. I just can't see what it is. As a side note, my overall intention is to enable my team members to run the db build scripts from Sql Developer, rather than Sql*Plus...
    Thanks in advance.

    Hi 917092 ,
    Gary Graham wrote:
    Hi,
    The closest equivalent is Tools|Preferences|Database|Worksheet|Select default path to look for scripts, but supports only a single directory.
    This parameter takes multiple directories. For example in Windows the separation character is ";" . The chooser only allows one directory to be chosen at a time - but multiple paths can be typed in.
    SQLPATH reads the environmental variable (it may not read the windows registry setting).
    set SQLPATH=C:\Documents and Settings\THE_USER\first;C:\Documents and Settings\THE_USER\second
    @first
    (reads first.sql from C:\Documents and Settings\THE_USER\first)
    @second
    (reads second.sql from C:\Documents and Settings\THE_USER\second)
    Is that sufficient?
    If there is a bug to be logged please provide more details:
    Including:
    -OS
    -SQLPATH (environmental variable or set via preferences)
    -worksheet command
    -.sql file / reproducible test case
    -output
    -expected output
    Turloch
    SQLDeveloper Team

  • Environment variables not passed through to player in flexunit 4.1.0-beta3

    fyi, to get flexunit-4.1.0-beta3 FlexUnit4AntTasks invocation of flashplayer to not be rejected by the vncserver, i needed to modify the FlexUnitLauncher to pass through the environment variables to the command environment.
    the reason this is required, i think, is the use of Runtime.exec() directly in CustomPlayerCommand -- in flexunit-4.0.0, the same function was accomplished using the ant executor, which does passthrough by default.
    anyway, curious if anyone else has seen this issue, or if i'm doing something dumb.
    --- flexunit/flexunit-4.1.0-beta3/flexunit-flexunit-da29198/FlexUnit4AntTasks/src/org/flexuni t/ant/launcher/FlexUnitLauncher.java    (revision 7250)
    +++ flexunit/flexunit-4.1.0-beta3/flexunit-flexunit-da29198/FlexUnit4AntTasks/src/org/flexuni t/ant/launcher/FlexUnitLauncher.java    (revision 7251)
    @@ -79,7 +82,13 @@
           command.setSwf(swf);
           if (runHeadless())
    -         command.setEnvironment(new String[]{ "DISPLAY=:" + xvncStart.getCurrentDisplay() });
    +         Map<String, String> env = System.getenv();
    +         List<String> envArgs = new ArrayList<String>();
    +         for (Map.Entry<String, String> entry : env.entrySet()) {
    +            envArgs.add(entry.getKey() + "=" + entry.getValue());
    +         }
    +         envArgs.add("DISPLAY=:"+xvncStart.getCurrentDisplay());
    +         command.setEnvironment(envArgs.toArray(new String[0]));
              LoggingUtil.log("Setting DISPLAY=:" + xvncStart.getCurrentDisplay());

    ok. i went looking for a JIRA link somewhere around here and couldn't find it.  do you have a URL handy?
    there are a couple of other things too:
    you probably want trustDirectory.mkdirs() rather than mkdir() in TrustFile.java
    you probably want CustomPlayerCommand.setLocalTrusted() -- my player command isn't in the machine's path, but i still want to be able to touch the trust file.  So I copied the trustFile.add() stuff from FlashPlayerCommand.launch() into CustomPlayerCommand.launch().  probably a better solution would be refactoring CustomPlayerCommand to be more like FlashPlayerCommand.
    anyway, if you want patches, tell me where to put them and i'll post some.

  • Win7 11g  -- Environment variables not set?

    I have an 11g installation on a school harddrive that doesn't seem to have any of the environment variables set properly. Even ORACLE_HOME is not set. How can I fix that situation and how many environment variables need to be defined?
    Also some of the Oracle scripts seem to use the forward-slash rather than the back-slash for paths. Will Win7 care?
    Thanks

    >
    I have an 11g installation on a school harddrive that doesn't seem to have any of the environment variables set properly. Even ORACLE_HOME is not set. How can I fix that situation and how many environment variables need to be defined?
    >
    You can set the following 3 basic environment variable in your system variables list. So that you can connect to database with out manually specifying the variables every time.
    ORACLE_HOME: the ORACLE_HOME variable should be set.
    ORACLE_SID: it is the name of the instance.
    PATH=$ORACLE_HOME/bin : this is the place where your oracle binaries exists.
    >
    Also some of the Oracle scripts seem to use the forward-slash rather than the back-slash for paths. Will Win7 care?
    >
    Windows server uses back-slash
    Unix flavours use forward-slash

  • Ora-7217 sltln environ variable not set..

    Here's the story..
    Oracle 8.1.7 on RHat 6.2..
    Installation unbelievably perfect!!!
    no core dump in any programs like sqlpus, svrmgrl..but..
    trying to start with svrmgrl..connect internal or thru sqlplus as sysdba
    ora-7217--sltln environment var not set
    keeps coming..made sure all the vars are
    set in .profile..any clue what's happening?
    vinny.

    A way to set environment variables to binaries is to specify
    it on the command line. For example:
    LD_LIBRARY_PATH=/usr/mylibs httpd
    If you are using apache, it could be changed in the /etc/init.d/apache
    script.
    If you use a script to startup the server, you can use the same approach.
    I am not sure about the obj.conf file.
    Sun - DTS

  • How do I use a UNIX environment variable for the path of a file name

    We are running Forms 6i over the web. The forms server runs on a UNIX (HP-UX) machine.
    I want to read the contents of a file, which is simple enough, using the TEXT_IO package. However, I want to reference a UNIX environment variable that specifies the file path i.e
    PROCEDURE get_file IS
    in_file Text_IO.File_Type;
    linebuf VARCHAR2(1800);
    filename VARCHAR2(200);
    BEGIN
    filename:= '$LOG_DIR/RCAS181.log';
    in_file := Text_IO.Fopen(filename, 'r');
    .....other stuff
    Notice the filename string references my unix env variable '$LOG_DIR'. However, this doesnt work. If I put the full pathname it works fine.
    Any suggestions ?

    Have a look at TOOL_ENV.GETVAR()

  • [SOLVED] Change environment variables with Shell scripts

    How can I change the "BROWSER" environment variable with a shell script; so I can change it on the fly?
    Last edited by oldtimeyjunk (2012-10-31 12:57:42)

    If you just want to do it for BROWSER so that you can change your default web browser on the fly, you could set BROWSER to e.g. ~/bin/mybrowser and create a symlink to the browser you want at ~/bin/mybrowser. Then you could change the symlink at will.
    EDIT: man xdg-settings
    Last edited by cfr (2012-10-31 02:20:16)

  • JAVA_HOME Environment Variable "Not Available"

    I have installed j2sdk 1.4.2_17 for Windows Server 2008 64 bit for an installation of ERP 6.0.  I have installed this in the following directory:
    C:\j2sdk14217x64
    - I have the JAVA_HOME variable (User variable for Administrator and System variable) set to: C:\j2sdk14217x64
    - I have the PATH system variable (System variable) set to: C:\j2sdk14217x64\bin
    When running the prerequisite checker I get the following error:
    "It is not recommended to use JDK version 1.4.2_10. Current version: JAVA_HOME not available."
    When I run %JAVA_HOME% from the command line the system finds it.  I'm not sure what the issue is here.

    Hello,
    Best to unistall JDK and reinstall latest one
    There is a download page solely for SAP customers:
    http://www.sun.com/software/javaforbusiness/sap_download.jsp
    See notes
    709140 Recommended JDK and VM Settings for the WebAS630/640/7.0
    Note 716604 for the Sun JDK (Windows, Linux, Solaris)
    regards,
    John Feely

  • SMF environment variables not working

    I have a Glassfish application in SMF with the following manifest file. I am trying to set the JAVA_HOME to /usr/jdk/latest.
    svccfg -s svc:/application/SUNWappserver/domain1 setenv -m stop JAVA_HOME /usr/jdk/latest
    svccfg -s svc:/application/SUNWappserver/domain1 setenv -m start JAVA_HOME /usr/jdk/latest
    svcadm refresh svc:/application/SUNWappserver/domain1:default
    # svcs -av |grep appser
    online - 12:22:51 249170 svc:/application/SUNWappserver/domain1:default
    # svccfg -s svc:/application/SUNWappserver/domain1 listprop | grep JAVA
    start/environment astring JAVA_HOME=/usr/jdk/latest
    stop/environment astring JAVA_HOME=/usr/jdk/latest
    I have a default instance and the stop/start methods are not defined inside it. After the refresh and restart, I still don't see Java using the /usr/jdk/latest JDK. Does anyone know why?
    Do those variables need to be defined inside the "default1" instance? If so, how do I do that with svccfg?
    <service_bundle type="manifest"
    name="SUNWasu appserver services">
    <service name="application/SUNWappserver/domain1"
    version="1"
    type="service">
    <single_instance/>
    <exec_method type="method"
    name="start"
    exec="/usr/local/glassfish/bin/asadmin start-domain --user admin --passwordfile /usr/local/glassfish/passfile --domaindir /usr/local/glassfish/domains domain1"
    timeout_seconds="0">
    <method_context working_directory=":default">
    <method_credential user="root"
    group=":default"/>
    <!-- privileges="basic,net_privaddr" -->
    </method_context>
    <stability value="Evolving"/>
    </exec_method>
    <exec_method type="method"
    name="stop"
    exec="/usr/local/glassfish/bin/asadmin stop-domain --domaindir /usr/local/glassfish/domains domain1"
    timeout_seconds="0">
    <method_context working_directory=":default">
    <method_credential user="root"
    group=":default"/>
    </method_context>
    <stability value="Evolving"/>
    </exec_method>
    <instance name="default" enabled="false">
    <dependency
    name='network'
    grouping='require_all'
    restart_on='none'
    type='service'>
    <service_fmri value='svc:/milestone/network:default' />
    </dependency>
    <!-- for ZFS, we need this to state this dependency -->
    <dependency
    name='filesystem-local'
    grouping='require_all'
    restart_on='none'
    type='service'>
    <service_fmri value='svc:/system/filesystem/local:default' />
    </dependency>
    </instance>
    <stability value="Evolving"/>
    <template>
    <common_name>
    <loctext xml:lang="C"> Appserver Domain Administration Server </loctext>
    </common_name>
    <documentation>
    <manpage title="Appserver" section="1" manpath="/opt/SUNWappserver/appserver/man"/>
    </documentation>
    </template>
    </service>
    </service_bundle>

    You're right....... it worked.
    The Content Server is case sensitive and the documentation is wrong......
    Thanks!

  • Jdev 10.1.2: Using environment variable in library path?

    Hi,
    I'm trying to use Maven2 for my build process besides JDeveloper for maintaining the code. MAven puts all necessary jars in a local repository, in my case in the folder: 'C:\Documents and Settings\PAlma\.m2\repository'. Now if I want to compile the code in JDeveloper I add libraries to my projects that are refering to the jars in the Maven local repository. In that way I am sure they use the same jars.
    The problem arises if another developer on another machine wants to use this Jdeveloper configuration. Because his Maven repository will not be in the folder 'c:\...\palma\..' but in 'c:\...\HIS_NAME\...'.
    So it would be great if I could use some variable like M2_REPOSITORY_HOME in my library path and each machine can have it's own value for that variable. I tried to use an enviroment-variable but that isn't working.
    Does anyone have an idea for this?
    Kind regards,
    Paskal

    Refer to
    http://www.oracle.com/technology/products/jdev/htdocs/10.1.2.0.0/install.html#migrating

  • Unset environment variables not commiting, still there when bash restart

    I want to remove some environment varibles so i use the unset command
         unset variable
    However when I list the varibles using:
         env
    The variable seems to be gone but when I restart the bash it comes back again? Any ideas why? And how to resolve this?

    Every shell instance has its own environment. Changing the environment in one shell session has no effect on future sessions.
    (An exception is a sub-shell, which inherits its parent's environment. For example, if you run a script from an interactive session, the script will start with the interactive session's environment.)
    If you want every login session to have a certain environment, you set it in a .bash_profile file. See the bash man page for details.

  • Environment variables not set by the install process

    Hello,
    Installed 11.5.10 on Redhat LIniux AS3.0
    None of the env variables (like APPL_TOP, OA_HTML, AR_TOP etc.,) are set by the install process do I need to run a separate script to set these varibales?
    Thanks

    Hi guys,
    I'm having exactly the same issues and more, when i try execute the *.env files i get a permission denied. Below is the output when running APPSORA.env
    [oracle@linux prodappl]$ ./APPSORA.env
    -bash: ./APPSORA.env: Permission denied
    below i list the permission etc on the *.env files in the APPL_TOP
    [oracle@linux prodappl]$ ls -l *.env
    -rw-r--r-- 1 oracle oracle 989 Oct 8 08:22 APPSORA.env
    -rw-r--r-- 1 oracle oracle 989 Oct 8 08:22 APPSPROD_linux.env
    -rw-r--r-- 1 oracle oracle 9396 Oct 8 08:22 PROD.env
    -rw-r--r-- 1 oracle oracle 9396 Oct 8 08:22 PROD_linux.env
    I've tried to change the permissions on the files and running, even though they don't return a permission denied message i'm get the same problem as KAR. The environments are just not getting setting, if i tried cd $APPL_TOP i just get dumped into /oracle/home

Maybe you are looking for

  • I'm using Safari 5.0.5 on a 13" MacBook Pro and can't get Safari to fully load web pages or pictures on web pages. Any suggestions?

    I bought a MacBook Pro in October of 2010 and it's been running greatly up to this month. Now I am experiencing problems with Safari loading web pages. Sometimes it will load web pages just fine and other times it doesn't load web pages at all. This

  • ITunes no longer plays any sound

    So basically, I logged on yesterday to find iTunes making no sound. I thought it'd just be fixed by resetting the computer, unfortunately, it hasn't. So today I tried uninstalling and reinstalling iTunes. This also has not fixed the problem! I've als

  • Same sender and receiver service but different communication channel

    Hi Exoerts I am doing a scenario  Proxy to JMS,HTTP and SOAP Adapter ( everything resides in the same recieiver service ) Mesage from  SRM System ( proxy ) has to sent to MQ service. But in MQ I have to pass to the same message to three different nod

  • Ios 7 changing color of icons

    changed to ios7 and the background behinf the icon app keys is some awful pinkish color. can this be changed?

  • Request Status Red

    After data load from ODS to Cube request status is RED.But data successfully transfered and validated the data,exactly it matching.No where I am getting log also.What could be the problem.But forcibly made it to green.But in production i cant change