# 【无用工具】剪贴板合法文件名转换器mfn\_legal

**URL:** https://meta.appinn.net/t/topic/70012
**Category:** 喵喵喵的新旧闻
**Tags:** autohotkey, windows, rust
**Created:** [2025 年4 月 13 日 09:27 UTC](https://meta.appinn.net/t/topic/70012 "2025-04-13T09:27:01Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### 作者： ![CCR](https://meta-edge.appinn.com/user_avatar/meta.appinn.net/ccr/32/68442_2.png) [@CCR](https://meta.appinn.net/u/CCR)
#### 发布日期： [2025 年4 月 13 日 09:27 UTC](https://meta.appinn.net/t/topic/70012/1 "2025-04-13T09:27:01Z")

</div>

# 无用工具——剪贴板合法文件名转换器mfn\_legal

mfn\_legal （make filename legal）是专用于Windows的一个剪贴板工具，他可以将不合法的文件名内容转换为可以被接受的字符。该项目的创意来源是之前我闲的蛋疼，结果发现竟然似乎有人有这个需求 [有没有自动修改剪贴板内容的工具](https://meta.appinn.net/t/topic/70009) ，所以就实现了一下

## 警告，本程序对程序员不友好！！！

## 开源地址（不同branch有ahk2实现和rust实现）

> **[GitHub - Mikachu2333/mfn\_legal: make filename acceptable for windows](https://github.com/Mikachu2333/mfn_legal)**
>
> make filename acceptable for windows

## 主要思路

```rust
let result = text
    .replace('<', "＜")
    .replace('>', "＞")
    .replace(':', "：")
    .replace('"', "'")
    .replace('/', "／")
    .replace('\\', "＼")
    .replace('|', "｜")
    .replace('?', "？")
    .replace('*', "＊");

```

## 其他说明

rust版本的由于过于懒惰因此直接通过每秒一次的循环解决（我相信够用了），并且没写快捷键，所以关闭只能通过任务管理器（taskmgr）了……

---

<div class="post-metadata">

### 作者： ![Lu\_Rodney](https://meta-edge.appinn.com/letter_avatar_proxy/v4/letter/l/f6c823/32.png) [@Lu\_Rodney](https://meta.appinn.net/u/Lu_Rodney)
#### 发布日期： [2025 年4 月 13 日 14:26 UTC](https://meta.appinn.net/t/topic/70012/2 "2025-04-13T14:26:28Z")

</div>

利益相关发言：实在是太有用了 :wink:
