PC Review


Reply
Thread Tools Rate Thread

different path variables on command line and in registry?

 
 
Karsten
Guest
Posts: n/a
 
      11th Dec 2007
Hello,
due to incompatibilities I've installed 2 versions of a software into
different folders (on Win2000 server), which the user starts via shortcuts to
batch files, which only overwrite the registry for the %path% user
environment variable and start the software. Something like:

start_V1.cmd:
regedit /s c:\V1.reg
C:\....exe
with V1.reg:
[HKEY_CURRENT_USER\Environment]
"PATH"="C:\\...

(OT: it's not the best solution, as %path% can change; usually it should be
parsed, the old path removed and the new added... but it's a quick solution)

Now it can happen, that the %path% on the command line doesn't update, while
the env vars in registry and control panel are ok. It's consistent in new
instances of cmd, and seems only a restart helps to overcome this deadlock.
Qestion to the experts: is there a solution beside reboot/assembling the
%path%?

Thanks in advance, any idea is welcome
Karsten
 
Reply With Quote
 
 
 
 
billious
Guest
Posts: n/a
 
      11th Dec 2007

"Karsten" <(E-Mail Removed)> wrote in message
news:3B4A7ECD-9D55-48C0-AC85-(E-Mail Removed)...
> Hello,
> due to incompatibilities I've installed 2 versions of a software into
> different folders (on Win2000 server), which the user starts via shortcuts
> to
> batch files, which only overwrite the registry for the %path% user
> environment variable and start the software. Something like:
>
> start_V1.cmd:
> regedit /s c:\V1.reg
> C:\....exe
> with V1.reg:
> [HKEY_CURRENT_USER\Environment]
> "PATH"="C:\\...
>
> (OT: it's not the best solution, as %path% can change; usually it should
> be
> parsed, the old path removed and the new added... but it's a quick
> solution)
>
> Now it can happen, that the %path% on the command line doesn't update,
> while
> the env vars in registry and control panel are ok. It's consistent in new
> instances of cmd, and seems only a restart helps to overcome this
> deadlock.
> Qestion to the experts: is there a solution beside reboot/assembling the
> %path%?
>
> Thanks in advance, any idea is welcome
> Karsten


Not really sure what you're getting at. Does this mysterious software
actually retrieve PATH from the registry, or from the environment?

Could you simply set PATH to the appropriate value within the batch, then
execute whateveryourexecutablenameis?

Or, if you insist on changing the registry value, would a simple START /I
do the job (not sure whether this re-established PATH from the registry or
whether it inherits the original environment, as per a literal reading of
the documentation.)



 
Reply With Quote
 
Karsten
Guest
Posts: n/a
 
      13th Dec 2007
@billious
I don't understand, how %path% cannot be the same on command line and in
registry...but whatever.
START /I doesn't help, but seems the software doesn't query the registry, so
your solution to set path in the context of the cmd instance seems to work...
Thanks :-)

PS: no mysterious s/w, but irrelevant; it's a layout viewer

"billious" wrote:

>

.....
> Not really sure what you're getting at. Does this mysterious software
> actually retrieve PATH from the registry, or from the environment?
>
> Could you simply set PATH to the appropriate value within the batch, then
> execute whateveryourexecutablenameis?
>
> Or, if you insist on changing the registry value, would a simple START /I
> do the job (not sure whether this re-established PATH from the registry or
> whether it inherits the original environment, as per a literal reading of
> the documentation.)
>
>
>
>

 
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
How to change/add environment variables from command line PERMANENTLY? Sebastian Kaist Windows XP Help 3 1st Apr 2009 01:16 PM
Path environment variables and the registry beaker Microsoft VB .NET 2 24th Oct 2005 09:46 AM
Implement Command Line Variables Stewart Saathoff Microsoft VB .NET 5 10th Nov 2004 10:35 AM
Environment variables not being expand in Path registry entry Joi Osoy Windows XP Customization 1 25th Jul 2004 01:25 AM
RE: Location for all command-line environment variables =?Utf-8?B?QXVzdGluIE0uIEhvcnN0?= Microsoft Windows 2000 CMD Promt 0 25th Oct 2003 11:26 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:03 PM.