2

How can I remove files of a Folders for Different USers with a batch file?. For example:

C:\Documents and Setting\UserA\Folder1\file.abc
C:\Documents and Setting\UserB\Folder1\file.abc
C:\Documents and Setting\UserC\Folder1\file.abc
C:\Documents and Setting\UserD\Folder1\file.abc
C:\Documents and Setting\UserE\Folder1\file.abc

I want to remove the file.abc of every FOLDER1 of Every User. Every User has the same folder (Folder1) but they also have more Folders that I dont want to remove. At the end the files must be like this.

    C:\Documents and Setting\UserA\Folder1\
    C:\Documents and Setting\UserB\Folder1\
    C:\Documents and Setting\UserC\Folder1\
    C:\Documents and Setting\UserD\Folder1\
    C:\Documents and Setting\UserE\Folder1\

I really hope you can help me with this.

Regards

4

2 に答える 2

2

これを試して:

for /d /r %%a in (*) do del "%%~a\Folder1\file.abc" 2>nul
于 2013-06-08T18:08:32.727 に答える
0
cd "C:\Documents and Settings"
for /f %%a in ('dir /b') do del %%a\Folder1\file.abc

Folder1\file.abcこれにより、 の下のすべてのフォルダーが検索されますDocuments and Settings%%aこれをバッチ ファイルの外で実行する場合は、 justに変更します%a

于 2013-06-08T17:36:33.613 に答える