Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prevent a particular file(name) from being created. 2

Status
Not open for further replies.

ChrisCalvert

Technical User
Mar 18, 2002
231
0
0
US
Is there a way to forbid a particular filename from being created? I am running a program that drops a logfile on my desktop. I don't use this file, and the program doesn't
provide a means to change the location, or to disable logging.
 
Why not call the program from a .CMD file, whose last step is to remove the undesired file from your desktop?

 
Well, it's something that stays running all the time. So, unfortunately, that won't work.
 
Then use scheduled tasks.

I know of no Group Policy object or registry entry that would accomplish your goal.
 
This will not exactly achieve your stated goal, but it may be an acceptable alternative.

Create a file on your desktop with the name of the file you do not wish to be created. It does not need to have any content, it can be 0 bytes. Right-click on the new file and select Properties. Mark the boxes for "Hidden" and "Read-only". Click OK.

The file now exists, but it is a fixed size and should not appear on your desktop. Attempts to create a file with that name will result in an error.

I'm not certain what effect this will have on the program that is creating the undesirable log file. It may throw an error message, it may hang, or it may just go on as if nothing is different. In any case, I suspect the problem would be the same or similar for any method you may find of preventing the file creation.
 
Another way, If you find the file is deleted, or the program ignores the read only flag, is to create a folder with the same name as the log file
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top