A common means of hacking attacks on websites is to embed a large number of read-only and hidden files. These documents are very harmful, and some are used to external contracts, and some are used to hang horses, there are hackers left behind the backdoor procedures. Because hackers set these files as read-only and hidden attributes, and with special characters in their filenames, we are generally not easy to find and difficult to delete. We can use the following batch command to remove these pesky files.
First, we need to adjust the system options to expose these hidden files. To do this: open My Computer, click on the Tools on the menu bar, select Folder Options, and then open the View tab.
Then, remove both options for hiding protected operating system files and extensions that hide known file types. In this way, we will be able to see the hacker implanted hidden files.
Delete method One: Single delete
We create a new bat batch file on the desktop, and the filename can be arbitrarily taken. The contents are as follows:
Del/f/a/q "?%1"
RD/S/q "?%1"
Then drag the file you want to delete onto the bat file. As shown in the following illustration:
Delete Method Two: bulk Delete
If the hacker implanted a large number of hidden files, we cannot delete one by one, you can use the following batch delete script.
We create a new bat batch file on the desktop, and the filename can be arbitrarily taken. The contents are as follows:
@echo off
CD/D D:wwwroot
for/f%%i in (' dir/arh/s/b ') do echo%%i
Pause
The function of this program is to list all the read-only and hidden files, and if your data directory is not d:wwwroot, modify it to the appropriate directory. If there is no problem, the following batch will be executed to remove them in bulk, which is the benefit of preventing accidental deletion.
@echo off
CD/D D:wwwroot
for/f "delims="%%i in (' dir/arh/s/b ') do (
Del/f/a/q "?%%i"
RD/S/q "?%%i"
)
Pause
If you have more files, it takes a while to find a read-only hidden file, please be patient
Note : More wonderful tutorials Please pay attention to the triple computer tutorial section, triple Computer office group: 189034526 welcome you to join