PC Review


Reply
Thread Tools Rate Thread

refreshing environment variables while processing batch file

 
 
Pedro CR
Guest
Posts: n/a
 
      5th Sep 2005
hi

i am trying to write a bath file that first calls a wsh script that sets an
environment variable and later in the same batch file that variable is
needed as an argument to a program that is called.
the problem is that, although the script sets the envirnment variable
correctly, it is not available to the console who called the script. I
assume that the problem is that the console does not refresh its environment
variables, because if I open a new console, the environment variable is
there.

What I wanted to know was if there a way to force the console to reload the
environment variables while processing the batch file, and making the new
environment variable visible to the console who ran it and batch file being
processed in that console.

thanks in advance
pedro


 
Reply With Quote
 
 
 
 
Jerold Schulman
Guest
Posts: n/a
 
      5th Sep 2005
On Mon, 5 Sep 2005 05:19:21 +0100, "Pedro CR" <(E-Mail Removed)> wrote:

>hi
>
>i am trying to write a bath file that first calls a wsh script that sets an
>environment variable and later in the same batch file that variable is
>needed as an argument to a program that is called.
>the problem is that, although the script sets the envirnment variable
>correctly, it is not available to the console who called the script. I
>assume that the problem is that the console does not refresh its environment
>variables, because if I open a new console, the environment variable is
>there.
>
>What I wanted to know was if there a way to force the console to reload the
>environment variables while processing the batch file, and making the new
>environment variable visible to the console who ran it and batch file being
>processed in that console.
>
>thanks in advance
>pedro
>


Try using SETENV.EXE to set the environment variable.
See tip 4928 » SETENV.EXE is a freeware replacement for SETX.EXE, and it has more functionality.
in the 'Tips & Tricks' at http://www.jsifaq.com

Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting environment variables of current process by batch file Zach Microsoft C# .NET 4 21st Jan 2010 11:44 AM
can environment variables be globally set via a batch file? iidabashiboy@writeme.com Microsoft Windows 2000 1 4th Feb 2006 06:07 AM
refreshing environment variables on a console Pedro CR Microsoft Windows 2000 CMD Promt 3 6th Sep 2005 01:39 AM
refreshing environment variables on a console Pedro CR Microsoft Windows 2000 3 6th Sep 2005 01:39 AM
Help Configuring Environment Variables with a batch file. arymal29 Microsoft Windows 2000 2 22nd Feb 2004 11:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:49 AM.