# Windows illegal filename characters - can't find the github bug report

**URL:** <https://help.nextcloud.com/t/windows-illegal-filename-characters-cant-find-the-github-bug-report/117924>\
**Category:** ℹ️ Support\
**Tags:** github\_issue\_exists, nc21\
**Created:** [June 7, 2021, 9:42am UTC](https://help.nextcloud.com/t/windows-illegal-filename-characters-cant-find-the-github-bug-report/117924 "2021-06-07T09:42:42Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![RuudschMaHinda](https://help.nextcloud.com/user_avatar/help.nextcloud.com/ruudschmahinda/32/79_2.png) [@RuudschMaHinda](https://help.nextcloud.com/u/RuudschMaHinda)\
**Post date:** [August 9, 2021, 11:37am UTC](https://help.nextcloud.com/t/windows-illegal-filename-characters-cant-find-the-github-bug-report/117924/10 "2021-08-09T11:37:26Z")

</div>

I still maintain that this is something that must be addressed. Until then, I created a workaround for myself - maybe this helps others as well, so I will post it here - as well as on github:

Using [Flow External Scripts](https://apps.nextcloud.com/apps/workflow_script) I created the following rule:

> When file is created, renamed, copied  
> and User is not member of Temp-Ban-Group  
> Run script  
> `rename 's/[\?\<\>\:\@\*\|\$]/_/g' /path/to/datafolder/%n && php /path/to/nextcloud/occ files:scan %o`

This replaces any of the offending characters with an underscore, and then rescans the userfolder. This can take a while depending on the amount of files and folders. It also depends on the hardware. In my case I had to install `rename` with `apt install rename`.

This also seems to be working with group folders.

Edit: This does NOT work with folder names - only files! Flow currently can’t be triggered by folders being created/uploaded/renamed.

---

_[View the full topic](https://help.nextcloud.com/t/windows-illegal-filename-characters-cant-find-the-github-bug-report/117924)._
