Answer the question
In order to leave comments, you need to log in
I'm trying to clean up a folder on a schedule. What's wrong?
It is necessary to clean all the contents - both files and folders. Therefore del all the same does not roll.
I did this:
pushd "d:\folder" && (rmdir /s /q "d:\folder" & popd) 2>nul
and it works.
BUT! Only if you drive it into cmd manually. From the clean.cmd file - no way.
It is launched by the standard schedule on behalf of the administrator. Win Server 2000
===
Let's go the other way? What other ways are there to clean a folder on a schedule?
Answer the question
In order to leave comments, you need to log in
In short... it works like this. And without dancing with tambourines.
@echo off
1>nul chcp 1251
2>nul pushd "d:\folder" && rmdir /s /q "d:\folder\"
popd
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question