简体   繁体   English

如何使用Windows命令行获取已删除的临时文件名列表和只读文件名列表?

[英]How to get the deleted temp file names list and read only file names list using windows command line?

I have tried to delete the temp files and display the deleted file and read only file names. 我试图删除临时文件并显示已删除的文件和只读文件名。

The below code i used for deleting the files and displaying the read only files. 下面的代码用于删除文件和显示只读文件。

@echo off
cd %temp%
for /d %%D in (*) do rd /s /q "%%D"
del /f /q *
del /f /q

but for me after deleting the files it should list and display the deleted file names.i guess we have to create some object/variable and store the file names. 但对我来说,删除文件后,它应该列出并显示已删除的文件名。我猜我们必须创建一些对象/变量并存储文件名。

is there any option to get it stored the file names and get it later? 有没有选项让它存储文件名并在以后获取?

这将列出您的只读文件。

for /f tokens^=* %i in ('robocopy /l /e /xa:R %temp% "nothing ..//" /njh /ndl /ns /nc /pf /njs')do @echo %i

Try moving everything to a seperate folder first and then 首先尝试将所有内容移动到单独的文件夹中

dir /b /path/to/folder

to get the files you are able to delete and 获取您能够删除的文件

dir /b %tmp%

to get the files you are unable to delete. 获取您无法删除的文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM