---
title: setvar doesn’t work in accoreconsole
description: "# Problem Sometimes you may find that specifying `(setvar \"filedia\" 1)` in an `.scr` script simply doesn’t reset `filedia` to `1`. Here’s the simplest `.scr` script that reproduces the issue: ```bash (command \"NETLOAD\" \"%YourDLL%\") %YourCommandMethod% (setvar \"filedia\" 1) ``` Or…"
url: "https://civilwhiz.com/docs/setvar-doesnt-work-in-accoreconsole/"
updated: "2025-12-04"
category: API
---

# setvar doesn’t work in accoreconsole

# Problem

Sometimes you may find that specifying `(setvar "filedia" 1)` in an `.scr` script simply doesn’t reset `filedia` to `1`.

Here’s the simplest `.scr` script that reproduces the issue:

```bash
(command "NETLOAD" "%YourDLL%")
%YourCommandMethod%
(setvar "filedia" 1)
```

Or just

```
(setvar "filedia" 1)
```

The outcome is the same; the program behaves as if `filedia=0`. In other words, the AutoCAD dialog is simply not shown when running in AutoCAD GUI.

Setting `filedia` to `1` is absolutely essential when running an `.scr` script via AutoCAD Console (`accoreconsole.exe`). `accoreconsole`, which is the GUI-less AutoCAD/Civil 3D engine, automatically resets `filedia` to `0` at the beginning of execution—and leaves it that way.

---

# Why is `filedia` so important?

`filedia` is the AutoCAD system variable that controls whether file-related dialog boxes appear (`0` disables them). This is [a common source of confusion](https://forums.autodesk.com/t5/autocad-forum/dialog-box-missing/td-p/7511350) for many new AutoCAD users because someone may have changed the variable, and the next operator will assume AutoCAD is “broken” when dialog boxes stop appearing.

---

# Solution 1: Change the registry manually

The registry entry for `filedia` is located at:

```
HKCUSoftwareAutodeskAutoCADR25.1ACAD-9100:409FixedProfileGeneral ConfigurationFileDialog
```

*(Civil 3D 2026)*

Changing the value to `1` restores dialog boxes.

---

# Solution 2: Explicitly call `QUIT`

For some reason, you must explicitly issue the `QUIT` command at the end of the `.scr` script for the `setvar` change to persist. The script below works:

```
(command "NETLOAD" "%YourDLL%")
%YourCommandMethod%
(setvar "filedia" 1)
QUIT
```

It appears that executing `QUIT` forces AutoCAD to save the system variable.

# Solution 3: Create a new profile and run `accoreconsole` on it

Refer to [here](https://forums.autodesk.com/t5/net-forum/set-filedia-doesn-t-work-in-accoreconsole-with-specific-argument/m-p/13930826#M86225) how it can be done.

  [![](https://civilwhiz.com/wp-content/uploads/2025/02/someoneme.jpg)](https://civilwhiz.com/author/civilwhiz/)[Ngu Soon Hui](https://civilwhiz.com/author/civilwhiz/)

My passion is in [sharing knowledge](/about/) — Civil 3D or otherwise– with the world.

I’m also the [benevolent dictator for life](https://mes100.com/about-ngu-soon-hui/) at MES Innovation Sdn Bhd.
