different path variables on command line and in registry?

  • Thread starter Thread starter Karsten
  • Start date Start date
K

Karsten

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
 
Karsten said:
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.)
 
@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
 
Back
Top