Код:
У ограниченного пользователя разве есть права на очистку временных папок в системных каталогах?
нет конечно, но я для этого использую reg файл
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment]
"TEMP"=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,64,00,72,00,69,00,76,\
00,65,00,25,00,5c,00,74,00,65,00,6d,00,70,00,00,00
"TMP"=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,64,00,72,00,69,00,76,00,\
65,00,25,00,5c,00,74,00,65,00,6d,00,70,00,00,00
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment]
"TEMP"=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,64,00,72,00,69,00,76,\
00,65,00,25,00,5c,00,74,00,65,00,6d,00,70,00,00,00
"TMP"=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,64,00,72,00,69,00,76,00,\
65,00,25,00,5c,00,74,00,65,00,6d,00,70,00,00,00
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Control\Session Manager\Environment]
"TEMP"=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,64,00,72,00,69,00,76,\
00,65,00,25,00,5c,00,74,00,65,00,6d,00,70,00,00,00
"TMP"=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,64,00,72,00,69,00,76,00,\
65,00,25,00,5c,00,74,00,65,00,6d,00,70,00,00,00
[HKEY_CURRENT_USER\Environment]
"TEMP"=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,64,00,72,00,69,00,76,\
00,65,00,25,00,5c,00,74,00,65,00,6d,00,70,00,00,00
"TMP"=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,64,00,72,00,69,00,76,00,\
65,00,25,00,5c,00,74,00,65,00,6d,00,70,00,00,00
в купе с cmd
subinacl.exe /file=directoriesonly "%SYSTEMDRIVE%\TEMP" /grant="все"=f /noverbose /display
subinacl.exe /subdirec "%SYSTEMDRIVE%\TEMP\*.*" /grant="все"=f /noverbose /display