Hello,

I have a very simple C# WindowsForms app accessing a file. Framework 1.0
SP2. The filename is used without any path reference. On 99% of machines I
tested, the file is correctly located in the applications startup
directory.

On one machine however, it looks for the file in c:\winnt\system32.
I can of course reference the path by using Application.StartupPath, but I
would like to know what is causing this, since the one machine is a
production server...

Any clues?

Hans

Re: default directory c:\winnt\system32? by Vance

Vance
Tue Feb 10 20:55:57 CST 2004

What is probably happening (I had a similar problem recently) is that the
"current directory" is changed by something you are doing to
C:\winnt\system32. To pinpoint where this happens you can use
Directory.GetCurrentDirectory().

-Vance

"HVE" <eylenh@hotmail.com> wrote in message
news:6kpv9cmrbc6d.tqa2yphwuck5$.dlg@40tude.net...
> Hello,
>
> I have a very simple C# WindowsForms app accessing a file. Framework 1.0
> SP2. The filename is used without any path reference. On 99% of machines I
> tested, the file is correctly located in the applications startup
> directory.
>
> On one machine however, it looks for the file in c:\winnt\system32.
> I can of course reference the path by using Application.StartupPath, but I
> would like to know what is causing this, since the one machine is a
> production server...
>
> Any clues?
>
> Hans



Re: default directory c:\winnt\system32? by HVE

HVE
Wed Feb 11 02:42:18 CST 2004


On Tue, 10 Feb 2004 18:55:57 -0800, Vance Gloster wrote:

> What is probably happening (I had a similar problem recently) is that the
> "current directory" is changed by something you are doing to
> C:\winnt\system32. To pinpoint where this happens you can use
> Directory.GetCurrentDirectory().
>
> -Vance
>
> "HVE" <eylenh@hotmail.com> wrote in message
> news:6kpv9cmrbc6d.tqa2yphwuck5$.dlg@40tude.net...
>> Hello,
>>
>> I have a very simple C# WindowsForms app accessing a file. Framework 1.0
>> SP2. The filename is used without any path reference. On 99% of machines I
>> tested, the file is correctly located in the applications startup
>> directory.
>>
>> On one machine however, it looks for the file in c:\winnt\system32.
>> I can of course reference the path by using Application.StartupPath, but I
>> would like to know what is causing this, since the one machine is a
>> production server...
>>
>> Any clues?
>>
>> Hans
I checked Directory.GetCurrentDirectory after every line of code and it
always showed me the correct application path. Yet the application keeps
looking for my file in c:\winnt\system32. Very strange behaviour.

Hans

Re: default directory c:\winnt\system32? by Ron

Ron
Wed Feb 11 08:03:41 CST 2004

Hans,
I'd check the PATH setting of the machine in question to see if
something is set differently.

Ron Allen
"HVE" <eylenh@hotmail.com> wrote in message
news:7uokkuvrcfgt$.4a2t5kmxhpbn$.dlg@40tude.net...
>
> On Tue, 10 Feb 2004 18:55:57 -0800, Vance Gloster wrote:
>
> > What is probably happening (I had a similar problem recently) is that
the
> > "current directory" is changed by something you are doing to
> > C:\winnt\system32. To pinpoint where this happens you can use
> > Directory.GetCurrentDirectory().
> >
> > -Vance
> >
> > "HVE" <eylenh@hotmail.com> wrote in message
> > news:6kpv9cmrbc6d.tqa2yphwuck5$.dlg@40tude.net...
> >> Hello,
> >>
> >> I have a very simple C# WindowsForms app accessing a file. Framework
1.0
> >> SP2. The filename is used without any path reference. On 99% of
machines I
> >> tested, the file is correctly located in the applications startup
> >> directory.
> >>
> >> On one machine however, it looks for the file in c:\winnt\system32.
> >> I can of course reference the path by using Application.StartupPath,
but I
> >> would like to know what is causing this, since the one machine is a
> >> production server...
> >>
> >> Any clues?
> >>
> >> Hans
> I checked Directory.GetCurrentDirectory after every line of code and it
> always showed me the correct application path. Yet the application keeps
> looking for my file in c:\winnt\system32. Very strange behaviour.
>
> Hans



Re: default directory c:\winnt\system32? by HVE

HVE
Wed Feb 11 10:05:31 CST 2004

On Wed, 11 Feb 2004 09:03:41 -0500, Ron Allen wrote:

> Hans,
> I'd check the PATH setting of the machine in question to see if
> something is set differently.
>
> Ron Allen
> "HVE" <eylenh@hotmail.com> wrote in message
> news:7uokkuvrcfgt$.4a2t5kmxhpbn$.dlg@40tude.net...
>>
>> On Tue, 10 Feb 2004 18:55:57 -0800, Vance Gloster wrote:
>>
>>> What is probably happening (I had a similar problem recently) is that
> the
>>> "current directory" is changed by something you are doing to
>>> C:\winnt\system32. To pinpoint where this happens you can use
>>> Directory.GetCurrentDirectory().
>>>
>>> -Vance
>>>
>>> "HVE" <eylenh@hotmail.com> wrote in message
>>> news:6kpv9cmrbc6d.tqa2yphwuck5$.dlg@40tude.net...
>>>> Hello,
>>>>
>>>> I have a very simple C# WindowsForms app accessing a file. Framework
> 1.0
>>>> SP2. The filename is used without any path reference. On 99% of
> machines I
>>>> tested, the file is correctly located in the applications startup
>>>> directory.
>>>>
>>>> On one machine however, it looks for the file in c:\winnt\system32.
>>>> I can of course reference the path by using Application.StartupPath,
> but I
>>>> would like to know what is causing this, since the one machine is a
>>>> production server...
>>>>
>>>> Any clues?
>>>>
>>>> Hans
>> I checked Directory.GetCurrentDirectory after every line of code and it
>> always showed me the correct application path. Yet the application keeps
>> looking for my file in c:\winnt\system32. Very strange behaviour.
>>
>> Hans

Ron,

the path contains nothing extraordinary.

Meanwhile I have found a couple of other strange issues on that server
though. I ran Filemon from Sysinternals and found that my app calls the COM
services dll of Windows 2000, the Microsoft database support DLL for
Oracle,... It also doesn't access the security config files.

Enough to seriously consider removing and reinstalling the .NET Framework
over the weekend.

thanks

Hans