How can i ignore file access from system32 folder?

I

immi

Scanario:
-------------
Suppose abc.txt file is used by different programs (say Prog1, Prog2,
Prog3). abc.txt is placed in local application's folders of Prog1,
Prog2 and Prog3. On copy of abc.txt is found in system32 folder as
well. I have observer that if OS find a file in system32 then it
ignores the file present in application local folders. To access
abc.txt locally I used Prog1.exe.local file and place the path of
abc.txt in Environment Variables path. Even then it always go for
system32 path.

Question:
 
D

Don Phillipson

Suppose abc.txt file is used by different programs (say Prog1, Prog2,
Prog3). abc.txt is placed in local application's folders of Prog1,
Prog2 and Prog3. On copy of abc.txt is found in system32 folder as
well. I have observer that if OS find a file in system32 then it
ignores the file present in application local folders. To access
abc.txt locally I used Prog1.exe.local file and place the path of
abc.txt in Environment Variables path. Even then it always go for
system32 path.

This looks like a defect in programming
1. If PROG1 is configured to load ABC.TXT from
filepath#1 and write it to the same filepath, and it
(instead or additionally) writes a copy to /Win/System32
that is a defect in PROG1.
2. In general, we do not expect any data.txt files to be
written anywhere in c:/Windows (usually reserved for
OS files including configuration instructions.)
Is there any way through which system32 path can be ignored and
abc.txt can be accessed locally? Infect abc.txt is copied in system32
folder by some other mean which I can’t restrict. Also these files
have different configuration settings.

This is not sufficiently clear. E.g. data files usually have
no "configuration settings:" these are configurations of the
installed program that reads/writes the data file.
 
P

Pegasus [MVP]

Scanario:
-------------
Suppose abc.txt file is used by different programs (say Prog1, Prog2,
Prog3). abc.txt is placed in local application's folders of Prog1,
Prog2 and Prog3. On copy of abc.txt is found in system32 folder as
well. I have observer that if OS find a file in system32 then it
ignores the file present in application local folders. To access
abc.txt locally I used Prog1.exe.local file and place the path of
abc.txt in Environment Variables path. Even then it always go for
system32 path.

Question:
-------------
Is there any way through which system32 path can be ignored and
abc.txt can be accessed locally? Infect abc.txt is copied in system32
folder by some other mean which I can’t restrict. Also these files
have different configuration settings.

==================

The Windows search process applies to executables only, that is to files
with extensions that you can see in the environmental variable %PathExt%. If
your application opens a .txt file in the System32 folder then this occurs
because of two reasons:
- The application does not use a fully qualified path (which is bad), and;
- The current default folder happens to be the System32 folder.
You may be able to implement a fragile fix by starting the application in
the desired application folder.
 
I

immi

This looks like a defect in programming
1.  If PROG1 is configured to load ABC.TXT from
filepath#1 and write it to the same filepath, and it
(instead or additionally) writes a copy to /Win/System32
that is a defect in PROG1.
2.  In general, we do not expect any data.txt files to be
written anywhere in c:/Windows (usually reserved for
OS files including configuration instructions.)


This is not sufficiently clear.  E.g. data files usually have
no "configuration settings:"  these are configurations of the
installed program  that reads/writes the data file.

Don Phillipson, Thanx for reply

You are very right in saying that data files usually have no
"configuration settings" plus system32 folder is reserved for OS
files. Now I try to make my question a bit clear.

First of all the txt file i am talking about is "nethasp.ini" which
have some server paths separated by semicolons so that multiple
programs can use them.

2ndly the programs Prog1, Prog2 etc are not developed by me. These are
3rd party programs for me and my role is a sort of bridge or plateform
thru which these programs execute. My client has already nethasp.ini
in their system32 folder by some application ran earlier. I have no
access to change the implementation of Prog1, Prog2 etc neither i can
delete existing nethasp.ini from system32 folder.

In most simple words I want to redirect the searching mechanism to
access files from application's folder.

Waiting for your quick responce.

Regards
Immi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top