gpt4 book ai didi

windows - 如何回复/避免要求 rmdir 确认?

转载 作者:可可西里 更新时间:2023-11-01 10:25:22 26 4
gpt4 key购买 nike

我正在尝试制作一个批处理文件,该文件将删除每个用户配置文件中的一个文件夹。但是当我运行批处理文件时,它会询问“你确定要删除 Y/N 吗?我需要这个文件在没有用户交互的情况下运行,所以有没有办法解决这个问题?即让它自动回答 Y 或完全隐藏 CMD 窗口的方法?

这是我目前所拥有的:

@echo off

REM This will hide the CMD window while the processes are running
REM Input code here to hide CMD window

REM A message to ask the user to save their Outlook emails they have open

mshta javascript:alert("Please be sure to save any emails that you need in Outlook. Click OK to continue.");close();

REM This will stop DM, Email Marker, Email Filer, Interceptor, Papihost, and Outlook.
taskkill /IM DM.exe /F
taskkill /IM DMMarkEmail.exe /F
taskkill /IM EmailAutoBulkFiling.exe /F
taskkill /IM Interceptor.exe /F
taskkill /IM OUTLOOK.EXE /F
taskkill /IM PAPIHost.exe /F

REM This will delete the DM cache in Appdata under the current user
RMDIR /s "%userprofile%\Appdata\Roaming\OpenText\DM\Cache"

REM This will start all of the programs that were closed
REM START DM.exe

REM Commenting the Marker and Filer since some users don't want it

REM START DMMarkemail.exe
REM START Email AutoBulkFiling.exe
REM START Interceptor.exe
REM START OUTLOOK.EXE
REM START PAPIHost.exe
@echo off

提前感谢您的反馈。

*编辑,我去掉了 C:,成功了,感谢 David Candy。

最佳答案

您可以使用“/Q”选项:

rmdir /S /Q "%userprofile%\Appdata\Roaming\OpenText\DM\Cache"

关于windows - 如何回复/避免要求 rmdir 确认?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19688324/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com