# Error with Copy CreateFolder when name contains space

**URL:** https://resource.dopus.com/t/error-with-copy-createfolder-when-name-contains-space/38453
**Category:** Help & Support
**Created:** [May 4, 2021, 8:10am UTC](https://resource.dopus.com/t/error-with-copy-createfolder-when-name-contains-space/38453 "2021-05-04T08:10:24Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Duke999R](https://resource.dopus.com/user_avatar/resource.dopus.com/duke999r/32/32663_2.png) [@Duke999R](https://resource.dopus.com/u/Duke999R)
#### Post date: [May 4, 2021, 8:10am UTC](https://resource.dopus.com/t/error-with-copy-createfolder-when-name-contains-space/38453/1 "2021-05-04T08:10:24Z")

</div>

G'day,

I have been using a button to move selected files to a folder of the same name with this function

`Copy MOVE FILE {filepath$} HERE CREATEFOLDER {file$|noext}`

It recently began giving me this error

![Clipboard Image](https://resource.dopus.com/uploads/default/original/3X/1/6/16a481478b4de32434aba191fa87ffcea6efa881.jpeg)

whenever the selected file has a space in the filename. No spaces, no error. The file is not moved and an empty folder is created that is named from the selected file up to the space.

So a\_b\_c\_d.jpg gets moved to a folder named a\_b\_c\_d as expected.

A file named a b\_c\_d.jpg gives the error and an empty folder named a is created.

I have just now tried `Copy HERE CREATEFOLDER= {file$|noext} MOVE` from [Move to Named Folder - #2 by Steve](https://resource.dopus.com/t/move-to-named-folder/34954/2) which gives the same error.

I'm stumped so any help would be appreciated.

Peter.

---

<div class="post-metadata">

### Author: ![lxp](https://resource.dopus.com/user_avatar/resource.dopus.com/lxp/32/33734_2.png) [@lxp](https://resource.dopus.com/u/lxp)
#### Post date: [May 4, 2021, 10:00am UTC](https://resource.dopus.com/t/error-with-copy-createfolder-when-name-contains-space/38453/2 "2021-05-04T10:00:19Z")

</div>

Quotes should fix it:

```
Copy MOVE FILE={filepath$} HERE CREATEFOLDER="{file$|noext}"

```

Admittedly, I am bit surprised that they are needed here.

---

<div class="post-metadata">

### Author: ![Duke999R](https://resource.dopus.com/user_avatar/resource.dopus.com/duke999r/32/32663_2.png) [@Duke999R](https://resource.dopus.com/u/Duke999R)
#### Post date: [May 4, 2021, 12:12pm UTC](https://resource.dopus.com/t/error-with-copy-createfolder-when-name-contains-space/38453/3 "2021-05-04T12:12:46Z")

</div>

> [@lxp](#):
>
> `Copy MOVE FILE={filepath$} HERE CREATEFOLDER="{file$|noext}"`

Thank you sir.

---

<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 4, 2021, 12:12pm UTC](https://resource.dopus.com/t/error-with-copy-createfolder-when-name-contains-space/38453/4 "2021-05-04T12:12:52Z")

</div>

We've fixed this for the next update. `{file$|noext}` was not adding quotes automatically when needed.

Thanks for reporting it!

Lxp's suggestion is good and will work both with and without the fix. (It won't cause extra quotes to be added after the fix is in place. I've tested that the quotes only get added if they're needed and are missing.)

Using `=` instead of space between the arguments, as he has done, is also a good idea in case the folder name coincides with another Copy command argument, as it removes that ambiguity.

---

<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 5, 2021, 8:45am UTC](https://resource.dopus.com/t/error-with-copy-createfolder-when-name-contains-space/38453/5 "2021-05-05T08:45:13Z")

</div>

This is now fixed in [Directory Opus 12.24](https://resource.dopus.com/t/directory-opus-12-24/38469)
