I have a column set up my DOpus window that displays the amount of files in a folder, however, for some reason it keeps counting a file called "desktop.ini", even if I have hidden files disabled.I have tried deleting the file but it keeps coming back.
Is there any way I can change the setting to not count this file?
There isn't a setting to make the normal file count settings ignore particular files.
If you are using Opus 11, a script add-in could be written which adds a custom file count column and filters things however you wish. Please link your account if you'd like help with that.
Hi - I am sorry to resurrect a thread - but I have the same question. I would like a filecount column that IGNORES desktop.ini files in the count.
Could someone please help get me started with this?
AvgFileSize Column is a good starting point and probably has all the building blocks needed, including filtering.
You'll probably want to change it to filter out instead of in, so you can set the wildcard to "desktop.ini". The main function at the bottom might end up something like this (untested):
'Called by DOpus to get the value of a column for an item.
Dim lFileCount, Wild, FolderEnum, FolderItem
'Initialize tallies and get custom filter.
lFileCount = 0
Set Wild = DOpus.FSUtil.NewWild(Script.config.Filter)
'If item is a folder, sum its files that pass the filter recursively.
If scriptColData.item.is_dir Then
Set FolderEnum = DOpus.FSUtil.ReadDir(scriptColData.item, True) 'True=Recursive
Do Until FolderEnum.complete
Set FolderItem = FolderEnum.next
If Not FolderItem.is_dir Then
If Not Wild.Match(FolderItem.name) Then 'apply filter
lFileCount = lFileCount + 1
scriptColData.value = lFileCount
The rest should just involve changing the name of the column and similar details, which should be straightforward.
Thanks Leo - this worked perfectly. I had to dig a little bit to figure out how to make an .OSP file, but it was quite easy.
You only need an osp file if you want to include icons or other things in with the script. Scripts work in normal text format as well.