Deleting files and directories

nnCron and nnCron LITE discussion

Deleting files and directories

Postby Frank » Mon, 15 May 2006, 02:09

Hello,
I am using nnCron V1.91.
I would like to delete 'Temporary Internet Files' older than 30 days. I used:
PURGE-OLD: "D:\Temp\Temporary Internet Files\*.*" 30
This is where I store them. It doesn't work. Even if I use the FILE-DELETE:.

Can someone let me know how to delete Temp Internet files.

Also, how do I delete empty folders under a system folder. ie. the folders under C:\Documents and Settings\Administrator\Local Settings\Temp.

Thank you
Frank
Frank
 
Posts: 30
Joined: Sun, 02 Apr 2006, 09:18

Postby Valery_Kondakoff » Mon, 15 May 2006, 08:49

try to authorize the task and load the user profile (AsLoggedUser LoadProfile). Does this solves the problem?
CU
VK
User avatar
Valery_Kondakoff
Site Admin
 
Posts: 769
Joined: Thu, 01 Jul 2004, 20:49
Location: Moscow, Russia

Postby Frank » Mon, 15 May 2006, 10:47

The delete operation now works.
Thanks a lot for that.

Can you suggest a way to delete empty folders under a system folder?

Thanks
Frank
Frank
 
Posts: 30
Joined: Sun, 02 Apr 2006, 09:18

Postby Valery_Kondakoff » Mon, 15 May 2006, 11:00

Please, be more specific: what is the problem with deleting the empty folders?

Use FOR-FILES: to loop the folders and DIR-EMPTY: "path" to see if the dir is empty.
CU
VK
User avatar
Valery_Kondakoff
Site Admin
 
Posts: 769
Joined: Thu, 01 Jul 2004, 20:49
Location: Moscow, Russia

Postby Frank » Mon, 15 May 2006, 12:39

I wanted to delete all files and folders under "C:\Documents and Settings\Administrator\Local Settings\Temp\" with:

DIR-DELETE: "C:\Documents and Settings\Administrator\Local Settings\Temp\*.*"
DIR-CREATE: C:\Documents and Settings\Administrator\Local Settings\Temp"

This doesn't work because the 'Temp' folder is a system folder and XP will not allow it to be deleted. So I tried:
FILE-DELETE: "C:\Documents and Settings\Administrator\Local Settings\Temp\*.*"

This is o/k, but the unused and empty folders are all left behind. So wanted to find out how to remove these.
Now, with your question, I found out how to do this:

RECURSIVE FILE-DELETE: "C:\Documents and Settings\Administrator\Local Settings\Temp\*.*"
FOR-FILES: "C:\Documents and Settings\Administrator\Local Settings\Temp\*.*"
IS-DIR?
IF
DIR-DELETE: "%FOUND-FULLPATH%"
THEN
;FOR-FILES

Thank you very much for your help.
Frank
Frank
 
Posts: 30
Joined: Sun, 02 Apr 2006, 09:18


Return to nnCron forum (English)

Who is online

Users browsing this forum: No registered users and 1 guest

cron