Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
Credits 12 Posts 2 Joined 2006-05-28 00:13 20-year member UID 56120
Status Offline
When running the command `for /r "C:\Documents and Settings\enc\My Documents" %%1 in (*.log *.tmp) do del %%1`, an error occurs: The system cannot find the specified path. In addition, files with spaces in the file name cannot be deleted either (clever XP recognizes it as n parts). why
Credits 5,310 Posts 2,044 Joined 2005-09-26 12:00 20-year member UID 42843 Gender Male From 四川南充
Status Offline
In the non-command line input:
for /r "C:\Documents and Settings\enc\My Documents" %1 in (*.log *.tmp) do del "%1"
In the batch file input:
for /r "C:\Documents and Settings\fff\My Documents" %%1 in (*.log *.tmp) do del “%%1”
Credits 247 Posts 83 Joined 2005-09-12 12:06 20-year member UID 42446 Gender Male
Status Offline
6th floor is correct!
Another question:
I want to find a certain file among the searched files instead of performing a delete operation!
For example, search for files larger than 20kb in the C:\Documents and Settings\Administrator\Local Settings\Temporary Internet Files\ directory, or files of a specific time!
Credits 1,144 Posts 425 Joined 2005-10-20 00:00 20-year member UID 43784 From 北京
Status Offline
You can try this upstairs to judge the file size
@echo off
setlocal enabledelayedexpansion
set a=
for /r "C:\Documents and Settings\Administrator\Local Settings\Temporary Internet Files" %%i in (*.*) do if %%~zi GTR 20480 set a=%%i !a!
echo The files larger than 20K are %a%
And for time, only the modification time of the file can be obtained