# 打印记录怎么脱敏

**URL:** <https://meta.appinn.net/t/topic/57394>\
**Category:** 问题求助\
**Created:** [2024 年6 月 7 日 02:54 UTC](https://meta.appinn.net/t/topic/57394 "2024-06-07T02:54:24Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

作者： ![seigaa](https://meta-edge.appinn.com/letter_avatar_proxy/v4/letter/s/74df32/32.png) [@seigaa](https://meta.appinn.net/u/seigaa)\
发布日期： [2024 年6 月 7 日 02:54 UTC](https://meta.appinn.net/t/topic/57394/1 "2024-06-07T02:54:24Z")

</div>

**打印记录怎么脱敏**

单位的打印机，记录了每个人打印的文件名称和用纸量，有么有软件，能在打印之前，将文件名脱敏，这样打印点私人东西，就不会泄露隐私了。

之前发了一次，找不到了，

---

<div class="post-metadata">

作者： ![VictoryRoad](https://meta-edge.appinn.com/user_avatar/meta.appinn.net/victoryroad/32/58964_2.png) [@VictoryRoad](https://meta.appinn.net/u/VictoryRoad)\
发布日期： [2024 年6 月 7 日 03:35 UTC](https://meta.appinn.net/t/topic/57394/2 "2024-06-07T03:35:08Z")

</div>

文件名的话可以自己重命名，比如统一成 “print”。另外，Word 好像是有删除个人信息的功能，在软件的 “开始” 主菜单中。

---

<div class="post-metadata">

作者： ![lilyhcn1](https://meta-edge.appinn.com/letter_avatar_proxy/v4/letter/l/439d5e/32.png) [@lilyhcn1](https://meta.appinn.net/u/lilyhcn1)\
发布日期： [2024 年6 月 7 日 04:51 UTC](https://meta.appinn.net/t/topic/57394/3 "2024-06-07T04:51:45Z")

</div>

如果光光是这个的话，那你可以写个简单的小脚本，然后打印

---

<div class="post-metadata">

作者： ![Fiend\_FEARing](https://meta-edge.appinn.com/user_avatar/meta.appinn.net/fiend_fearing/32/47535_2.png) [@Fiend\_FEARing](https://meta.appinn.net/u/Fiend_FEARing)\
发布日期： [2024 年6 月 7 日 06:52 UTC](https://meta.appinn.net/t/topic/57394/4 "2024-06-07T06:52:52Z")

</div>

让AI写了一个简单的批处理，把要打印的文件拖到图标上就能在bat所在的目录生成一个以日期作为文件名的备份。  
然后备份文件会被打开，可以进去选择打印。  
批处理会文件打开8秒后开始检测文件占用。文件关闭，解除占用以后备份会被删除。

\*\*我试了下，office文档没啥问题，但是打开不会继续占用文件的应用不太适合，比如Windows照片查看器，文件没占用会被直接删除。可以把check loop后面删除，自己处理复制出来的文件。

```auto
@echo off
REM Check if a file was dragged onto the script
if "%~1"=="" (
    echo Please drag and drop a file onto this script to create a backup.
    pause
    exit /b
)

REM Get the full path of the dragged file
set "original_file=%~1"

REM Get the directory of the script
set "script_dir=%~dp0"

REM Get the extension of the original file
set "original_ext=%~x1"

REM Get the current date and time in the format YYYYMMDDHHMMSS
for /f "tokens=2 delims==" %%i in ('"wmic os get localdatetime /value"') do set datetime=%%i
set "timestamp=%datetime:~0,4%%datetime:~4,2%%datetime:~6,2%%datetime:~8,2%%datetime:~10,2%%datetime:~12,2%"

REM Create the backup file name
set "backup_file=%script_dir%%timestamp%%original_ext%"

REM Copy the original file to the backup file
copy "%original_file%" "%backup_file%"

REM Check if the copy was successful
if %errorlevel% neq 0 (
    echo Failed to create the backup file.
    pause
    exit /b
)

REM Open the backup file
start "" "%backup_file%"

echo Backup created and opened successfully.
timeout /t 8 >nul

:check_loop
REM Attempt to delete the backup file
del "%backup_file%" >nul
REM Check if the backup file still exists
if exist "%backup_file%" (
    REM File still exists, wait and check again
    timeout /t 2 >nul
    goto check_loop
) else (
    REM File is deleted, exit the loop
    echo Backup file deleted.
    exit /b
)

```

---

<div class="post-metadata">

作者： ![netcharm](https://meta-edge.appinn.com/user_avatar/meta.appinn.net/netcharm/32/11247_2.png) [@netcharm](https://meta.appinn.net/u/netcharm)\
发布日期： [2024 年6 月 7 日 07:19 UTC](https://meta.appinn.net/t/topic/57394/5 "2024-06-07T07:19:52Z")

</div>

参考上面的批处理工作原理, 用 Powershell 写脚本, `Start-Process` 启动进程

```auto
$app = Start-Process "your_app_path" -passthru
Wait-Process $app.Id

```

或者简单点

```auto
Wait-Process (Start-Process "your_doc_file_path" -Passthru).Id

```

这样启动的进程结束后, `Wait-Process` 才会结束继续执行下一条指令

---

<div class="post-metadata">

作者： ![tiger](https://meta-edge.appinn.com/user_avatar/meta.appinn.net/tiger/32/23490_2.png) [@tiger](https://meta.appinn.net/u/tiger)\
发布日期： [2024 年6 月 7 日 10:43 UTC](https://meta.appinn.net/t/topic/57394/6 "2024-06-07T10:43:00Z")

</div>

啊？竟然还有这种东西？:sob:我之前打印了好多作业。这个要怎么看是不是有记录呀？

---

<div class="post-metadata">

作者： ![LambertCrofts](https://meta-edge.appinn.com/user_avatar/meta.appinn.net/lambertcrofts/32/50237_2.png) [@LambertCrofts](https://meta.appinn.net/u/LambertCrofts)\
发布日期： [2024 年6 月 7 日 11:32 UTC](https://meta.appinn.net/t/topic/57394/7 "2024-06-07T11:32:10Z")

</div>

我也头一回知道。。。

我还打印过准考证。。。

---

<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)\
发布日期： [2024 年6 月 7 日 12:26 UTC](https://meta.appinn.net/t/topic/57394/8 "2024-06-07T12:26:37Z")

</div>

`新建Microsoft Word文本文档.docx` 最有用的一回 :rofl:

---

<div class="post-metadata">

作者： ![allor](https://meta-edge.appinn.com/user_avatar/meta.appinn.net/allor/32/1268_2.png) [@allor](https://meta.appinn.net/u/allor)\
发布日期： [2024 年6 月 7 日 14:27 UTC](https://meta.appinn.net/t/topic/57394/9 "2024-06-07T14:27:53Z")

</div>

打印机的国产化替代甚至涉及国安的

资料拿去打印店打印，店里完全可以留底  
所以我需要复印身份证都是做了带水印的扫描件再去打印

---

<div class="post-metadata">

作者： ![RachelSherman](https://meta-edge.appinn.com/letter_avatar_proxy/v4/letter/r/74df32/32.png) [@RachelSherman](https://meta.appinn.net/u/RachelSherman)\
发布日期： [2024 年6 月 7 日 15:13 UTC](https://meta.appinn.net/t/topic/57394/10 "2024-06-07T15:13:46Z")

</div>

如果只是通过文件名和文档元数据记录的话，完全可以去除，但如果还通过记录ip等方法，那要查完全查得到。，另外，商用打印机有存储单元，会记录打印过的资料，你要考虑清楚。

---

<div class="post-metadata">

作者： ![xiaokonglong](https://meta-edge.appinn.com/user_avatar/meta.appinn.net/xiaokonglong/32/908_2.png) [@xiaokonglong](https://meta.appinn.net/u/xiaokonglong)\
发布日期： [2024 年6 月 8 日 09:05 UTC](https://meta.appinn.net/t/topic/57394/11 "2024-06-08T09:05:59Z")

</div>

如果你用 wps或者 word。

可以使用vba来实现， 当然了， 用我的公文排版助手的话，复制代码存成.vba文件（ASCII编码），直接运行脚本即可。

vba或者脚本代码如下：

```basic
Sub 脱敏打印()
   Dim file As String
   file = "C:\windows\temp\工作总结.pdf"
   ActiveDocument.SaveAs2 file, WdSaveFormat.wdFormatPDF
   Shell "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe " & file
End Sub

```

这个代码的作用就是把文件生成一个临时的pdf文件，然后用浏览器打开它，然后手动打印。对于我来说，打印机太多，一般要选一下打印机。 如果你想要直接打印可以参考下面的代码自己改改。

```auto
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
        ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
        ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Sub PrintPDFUsingAPI()
    Dim PDFPath As String, result
    PDFPath = "d:\temp\test.pdf"
    result = ShellExecute(0, "print", PDFPath, 0&, 0&, 0)
    If result > 32 Then
        MsgBox "打印命令已发送至默认打印机。"
    Else
        MsgBox "无法执行打印命令。"
    End If
End Sub

```

---

<div class="post-metadata">

作者： ![seigaa](https://meta-edge.appinn.com/letter_avatar_proxy/v4/letter/s/74df32/32.png) [@seigaa](https://meta.appinn.net/u/seigaa)\
发布日期： [2024 年6 月 11 日 03:30 UTC](https://meta.appinn.net/t/topic/57394/12 "2024-06-11T03:30:21Z")

</div>

在打印机 的 机器里面记录着，非常详细，一般都设了管理员密码，普通人能看，不能导出，或者干脆看不到，

---

<div class="post-metadata">

作者： ![seigaa](https://meta-edge.appinn.com/letter_avatar_proxy/v4/letter/s/74df32/32.png) [@seigaa](https://meta.appinn.net/u/seigaa)\
发布日期： [2024 年6 月 11 日 03:30 UTC](https://meta.appinn.net/t/topic/57394/13 "2024-06-11T03:30:33Z")

</div>

看到了楼上几位 大侠的 代码，我回头有时间去挨个试试，希望有大神 做出exe，直接懒人应用，长期驻留后台，无感操作 就完美了。
