Board index » delphi » Exec(GetEnv('COMSPEC'),'/C '+ 'program.exe'); versus GetEnvironmentStrings; need advice

Exec(GetEnv('COMSPEC'),'/C '+ 'program.exe'); versus GetEnvironmentStrings; need advice

How do I use GetEnvironmentStrings; similar to the old pascal
GetEnv('COMSPEC')
I have figured out how to get all the environment strings into a
TString list but I just need command.com which I wish to pass a
parameter to..

 

Re:Exec(GetEnv('COMSPEC'),'/C '+ 'program.exe'); versus GetEnvironmentStrings; need advice


Im Artikel <36f02028.14766...@news.ark.com>, webmas...@comox-valley.com
(Martin) schreibt:

Quote
>I have figured out how to get all the environment strings into a
>TString list

Perhaps the Name and Value properties will do the job?

result := env.Value[env.IndexOf('envname...')];

DoDi

Re:Exec(GetEnv('COMSPEC'),'/C '+ 'program.exe'); versus GetEnvironmentStrings; need advice


Quote
webmas...@comox-valley.com (Martin) wrote:
>How do I use GetEnvironmentStrings; similar to the old pascal
>GetEnv('COMSPEC')

You get a single environment variable using the appropriately named
GetEnvironmentVariable.
--
- Tim Roberts, t...@probo.com
  Providenza & Boekelheide, Inc.

Other Threads