# Evaluator column error with This PC

**URL:** <https://resource.dopus.com/t/evaluator-column-error-with-this-pc/55603>\
**Category:** Help & Support\
**Created:** [May 2, 2025, 7:59pm UTC](https://resource.dopus.com/t/evaluator-column-error-with-this-pc/55603 "2025-05-02T19:59:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![galaxyhub](https://resource.dopus.com/user_avatar/resource.dopus.com/galaxyhub/32/42793_2.png) [@galaxyhub](https://resource.dopus.com/u/galaxyhub)\
**Post date:** [May 2, 2025, 7:59pm UTC](https://resource.dopus.com/t/evaluator-column-error-with-this-pc/55603/1 "2025-05-02T19:59:02Z")

</div>

![image](https://resource.dopus.com/uploads/default/original/3X/2/0/20ea2f31ee1e9e443a6bc4498bc838d38182f619.png)

Getting an evaluator error with this **Drive Total Size** column for `This PC`. Seems to happen when format lock is on and another folder is navigated to.  
(The columns that were locked in another folder do not show in `This PC` when navigated to, which is good, but when navigating away from `This PC` the columns from `This PC` are retained in the new folder - bug ?)

```auto
<?xml version="1.0"?>
<evalcolumn align="2" attrrefresh="no" autorefresh="no" customgrouping="no" foldertype="all" header="Drive Size" keyword="DriveTotalSize" maxstars="5" namerefresh="no" nocache="no" reversesort="no" supportmarkup="no" title="Drive Total Size" type="0">// column for total size of drive in TB or GB

tb = (1024 * 1024 * 1024 * 1024) as int64;
gb = (1024 * 1024 * 1024) as int64;
total_free = Val(&quot;sh:freespace&quot;) as int64;
total_used = Val(&quot;sh:usedspace&quot;) as int64;

total = (total_free + total_used) as int64;

if ( total &gt; 549755813888)
  return (Ceil(total / tb) + 1) as int + &quot; TB&quot;;
else
  {
    size = (Ceil(total / gb) + 1) as int;
    if (size &lt;= 1) return &quot;1 GB&quot;;
	elseif (size &lt;= 2) return &quot;2 GB&quot;;
	elseif (size &lt;= 4) return &quot;4 GB&quot;;
	elseif (size &lt;= 8) return &quot;8 GB&quot;;
	elseif (size &lt;= 16) return &quot;16 GB&quot;;
	elseif (size &lt;= 32) return &quot;32 GB&quot;;
	elseif (size &lt;= 64) return &quot;64 GB&quot;;
	elseif (size &lt;= 128) return &quot;128 GB&quot;;
	elseif (size &lt;= 256) return &quot;256 GB&quot;;
	else return &quot;512 GB&quot;;
  }

</evalcolumn>

```

`sh:freespace` has been copied from  
[Keywords for Columns [Directory Opus Manual]](https://docs.dopus.com/doku.php?id=reference:metadata_keywords:keywords_for_columns)

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [May 2, 2025, 8:58pm UTC](https://resource.dopus.com/t/evaluator-column-error-with-this-pc/55603/2 "2025-05-02T20:58:30Z")

</div>

Is the error happening for a specific item in This PC, or all the drives there?

---

<div class="post-metadata">

**Author:** ![galaxyhub](https://resource.dopus.com/user_avatar/resource.dopus.com/galaxyhub/32/42793_2.png) [@galaxyhub](https://resource.dopus.com/u/galaxyhub)\
**Post date:** [May 3, 2025, 3:27am UTC](https://resource.dopus.com/t/evaluator-column-error-with-this-pc/55603/3 "2025-05-03T03:27:29Z")

</div>

it is not happening in `This PC`  
it happens when navigating to another folder.  
The `This PC` folder format is retained because format lock is on, and from what I can tell it happens for all items in the folder being navigated to.

I think the evaluator column is trying to get `sh:freespace` from each item.

so the issue is, should the unique folder format for `This PC` (unique because it contains columns that are exclusive to `This PC`) be retained if folder format is locked and a different folder navigated to.  
Usually with format lock off, this is not a problem as the `This PC` folder format will not be retained.

Perhaps,

- if format lock on
- if `This PC` navigated to (whilst format lock is on)
- remember old format (navigating to `This PC` will change to `This PC` folder format if folder format is locked)
- restore the remembered format if `This PC` navigated away from (and format lock still on)

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [May 3, 2025, 6:39am UTC](https://resource.dopus.com/t/evaluator-column-error-with-this-pc/55603/4 "2025-05-03T06:39:51Z")

</div>

Your Evaluator code should test if the value exists before using it, if it’s something that only exists in one folder. Nothing stops the column being turned on in other folders.

> **[IsSet \[Directory Opus Manual\]](https://docs.dopus.com/doku.php?id=reference:evaluator:isset)**

---

<div class="post-metadata">

**Author:** ![galaxyhub](https://resource.dopus.com/user_avatar/resource.dopus.com/galaxyhub/32/42793_2.png) [@galaxyhub](https://resource.dopus.com/u/galaxyhub)\
**Post date:** [May 3, 2025, 7:43am UTC](https://resource.dopus.com/t/evaluator-column-error-with-this-pc/55603/5 "2025-05-03T07:43:33Z")

</div>

Many thanks, that is now working 🙂
