中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-12 11:42
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » Run an IE cache file cleanup script every Monday (via Group Policy)
Printable Version  1,098 / 2
Floor1 luweionline Posted 2009-09-14 04:51
新手上路 Posts 14 Credits 14
I want to make a script:
run an IE cache file cleanup script every Monday (via Group Policy)

I'd like to ask everyone: how should this code be written so it can run under power users (it works with administrator privileges, but all the PCs in our workplace are set to power user privileges)?

Also, can the AT command create a task name? (Otherwise, if the user creates one named AT1 himself, the startup script will delete it.)

The code is as follows:
@echo off
echo
schtasks /delete /tn "At1" /f (first delete the auto-created task with the AT name (AT1))
at 8:40AM /Every:Monday cmd /c del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" (create the task named AT1)
echo
Floor2 Hanyeguxing Posted 2009-09-14 05:55
银牌会员 Posts 897 Credits 1,039 From 在地狱中仰望天堂
Just use schtasks to create the task, and specify the user while creating it
/ru {[Domain\]User | "System"}
Runs the task with the permissions of the specified user account. By default, it runs with the permissions of the user logged on to the computer where SchTasks is run.
Floor3 luweionline Posted 2009-09-15 02:45
新手上路 Posts 14 Credits 14
I haven't really used the schtasks command much. After writing it, I found it didn't take effect.
Also, when using schtasks to create a task, it seems you can only add a path or executable file.
Is adding this command not okay? del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\


@echo off
echo
schtasks /delete /tn "Del_ie_temp" /f first delete the task name
schtasks /create /tn "Del_ie_temp" /sc /WEEKLY /MON /st 08:30 /tr cmd /c del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" /ru administrator /rp password11111 delete every Monday at 8:30
echo
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023