简体   繁体   中英

Deleting old files in Windows 10 using forfiles

I am trying to delete old files and folders in my Google Drive using a bat script on Windows 10 Home.

forfiles /M *.* /P "C:\Users\bruker\Google Drive\" /S /D -180 /C "cmd /c del /F /Q @path"

Gives the error message:

ERROR: Invalid argument/option - '/F'. Type "FORFILES /?" for usage.

Anyone have a solution for this?

The quotes aren't needed. Both forfiles ... /C cmd /c del /F /Q @path and forfiles ... /C (cmd /c del /F /Q @path) should work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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