Thanks for the reply however this will not get me what I'm after, I'm not
using the variable directly in my program.
I'm using an ODBC connection (third party ODBC driver) in my program when I
setup the system ODBC connection going through the control panel I cannot
type in the full path to the data files, it doens't allow for enough
characters. The workaround for this (provided by the company who makes the
driver) is to only put a '.' (just the full stop) in the path of the ODBC
connection and set an environment variable, it will then automatically use
that variable as the path. As I said before if I set this for the system it
causes me problems (the ODBC driver is just an add on to a set of other
programs, if the env var is set the programs will also use this as the path,
which is fine unless you have more that one instance of the program using
different data paths - you set the env var for the system and they ALL start
using the same data path, big problem).
Any other suggestions? anyone?
be much appreciated, Gav
"Altaf Al-Amin Najwani" <Al****************@discussions.microsoft.com> wrote
in message news:ED**********************************@microsof t.com...
You can pass data to your windows service when it starts in Main function.
"Gav" wrote:
Hi all,
I have written a program which seriously depends on an environment
variable.
When I set the env var for the system it caused me major problems
unrelated
to what I was trying to achieve. So in order to get around this I just
used
a simple script which would set the variable using the 'set' command and
then call my program. This worked and only held the env var for that
script
session so once my program was finished it was gone and therefore not
affecting anything else...
I now want to convert this program to a windows service, all was going
well
until I remembered this fine point. Is there a way I can programatically
set
an environment variable just for the use of the service?
Regards
Gavin