3

各ユーザー プロファイルのフォルダーを削除するバッチ ファイルを作成しようとしています。しかし、バッチ ファイルを実行すると、「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 に感謝します。

4

2 に答える 2

3

「/Q」オプションを使用できます。

rmdir /S /Q "%userprofile%\Appdata\Roaming\OpenText\DM\Cache"
于 2013-10-30T17:04:18.277 に答える
0

正確には覚えていませんが、以下のような内容でした。

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

また

ECHO Y| RMDIR /S "%userprofile%\Appdata\Roaming\OpenText\DM\Cache"
于 2013-10-30T17:19:05.353 に答える