Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Automatically remove a certain file from a given directory Desktop
Many of us have found a profiles.bin file in our home folders. Many think it is created by MS Office for some reason, but nobody knows for sure. Everybody hates it and tries to remove it, to no avail: the file will respawn the next time you open MS Office. The file is completely useless, as far as anybody can tell.

I don't suggest a solution to the issue, nor an explanation; just a cool workaround to have that file delete itself every time you open its containing folder. It does so by means of a Folder Action. Folder Actions are pieces of AppleScript code to be executed automatically every time you open or close a folder, or add/remove items to/from it.

Here's how to create the one we need. Open Script Editor (in Applications » AppleScript) and type the following script and then click Compile to test for (most) spelling mistakes:
on opening folder
  tell application "Finder" to delete file "profiles.bin" of home
end opening folder
Save the script as Delete profiles_bin somewhere appropriate, such as in Home » Library » Scripts » Folder Action Scripts (this is where Automator saves its folder actions), then open a Finder window. Control-clik on your home folder in the sidebar and select Enable Folder Actions. From the same menu, choose "Attach a Folder Action" and point it to the file you just saved

Done! Now every time you open your home folder in Finder, if a "profiles.bin" file is there, it will be deleted! Obviously, you could easily modify the above script to work on any other unwanted files that are automatically generated.

[robg adds: From what I can find on Google, it seems this issue only affects non-English versions of Office. I checked my machines, and none of them had the file. There are other solutions to this problem, of course. For instance, you could use Terminal and a cron job set to run once a day (or whenever) to check for and delete the file if found.]
    •    
  • Currently 2.80 / 5
  You rated: 2 / 5 (5 votes cast)
 
[10,073 views]  

Automatically remove a certain file from a given directory | 3 comments | Create New Account
Click here to return to the 'Automatically remove a certain file from a given directory' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Automatically remove a certain file from a given directory
Authored by: JayBee on Aug 06, '07 08:07:11AM

Any time I come across this, I tend to favour using SetFile in the developers' tools. /Developer/Tools/SetFile -a V "FILENAME" hides it in Finder.

I'm a little averse to deleting unsightly files when you don't know what they're for.



[ Reply to This | # ]
Automatically remove a certain file from a given directory
Authored by: briandj62 on Aug 11, '07 03:31:27AM

I can confirm what robg writes: with my Italian version of Office 2004 the file does exist. And it is really quite annoying to have it just in the user's home dir (well, MS way of doing software... :) ).

Of the three alternatives for dealing with it, I favor the idea of simply hiding the file, because I don't see any improvement in having to continuously delete a file that always gets recreated.



[ Reply to This | # ]
Automatically remove a certain file from a given directory
Authored by: sig eigei on Sep 13, '07 08:43:53AM

This happens on most of the machines in my office that I know of. We have the US version of Microsoft office.



[ Reply to This | # ]