dewauto Posted April 3, 2023 Share Posted April 3, 2023 I want to delete the temporary folder in the system folder. DirRemove(@WindowsDir&"\System32\config\systemprofile\AppData\tw*.tmp", 1) It won't be deleted. How can I delete it? Link to comment Share on other sites More sharing options...
ioa747 Posted April 3, 2023 Share Posted April 3, 2023 (edited) have you try with #RequireAdmin? Edited April 3, 2023 by ioa747 I know that I know nothing Link to comment Share on other sites More sharing options...
dewauto Posted April 3, 2023 Author Share Posted April 3, 2023 19 minutes ago, ioa747 said: have you try with #RequireAdmin? I included #RequireAdmin . Link to comment Share on other sites More sharing options...
Developers Jos Posted April 3, 2023 Developers Share Posted April 3, 2023 @gooddew, Please do not report your posts when they are in MOD-PREVIEW, we will get to it when around and are notified automatically. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
ioa747 Posted April 3, 2023 Share Posted April 3, 2023 hasta la vista #RequireAdmin #AutoIt3Wrapper_UseX64=y #include <FileConstants.au3> #include <File.au3> _DelAllFile() Func _DelAllFile() Local $dir = @WindowsDir & "\System32\config\systemprofile\AppData\Local\" Local $ArraySrtfiles = _FileListToArrayRec($dir, "tw-*.tmp", $FLTAR_FOLDERS) If Not IsArray($ArraySrtfiles) Then ConsoleWrite($dir & " = Invalid input path" & @CRLF) Return Else For $x = 1 To $ArraySrtfiles[0] ConsoleWrite($x & ") " & $dir & $ArraySrtfiles[$x] & " DirRemove=" & DirRemove($dir & $ArraySrtfiles[$x], 1) & @CRLF) Next EndIf EndFunc ;==>_DelAllFile I know that I know nothing Link to comment Share on other sites More sharing options...
dewauto Posted April 3, 2023 Author Share Posted April 3, 2023 7 hours ago, ioa747 said: hasta la vista #RequireAdmin #AutoIt3Wrapper_UseX64=y #include <FileConstants.au3> #include <File.au3> _DelAllFile() Func _DelAllFile() Local $dir = @WindowsDir & "\System32\config\systemprofile\AppData\Local\" Local $ArraySrtfiles = _FileListToArrayRec($dir, "tw-*.tmp", $FLTAR_FOLDERS) If Not IsArray($ArraySrtfiles) Then ConsoleWrite($dir & " = Invalid input path" & @CRLF) Return Else For $x = 1 To $ArraySrtfiles[0] ConsoleWrite($x & ") " & $dir & $ArraySrtfiles[$x] & " DirRemove=" & DirRemove($dir & $ArraySrtfiles[$x], 1) & @CRLF) Next EndIf EndFunc ;==>_DelAllFile The temporary folder has been deleted in the above way. thank you Link to comment Share on other sites More sharing options...
rudi Posted April 6, 2023 Share Posted April 6, 2023 (edited) This is the %localappdata% directory of the SYSTEM account. Why do you want to delete content in that folder? Usually there just remain empty TMP folders, that do not harm. This is visible, when you start a CMD box as SYSTEM start a CMD box using "run as administrator" Get the sysinternals tool PSEXEC open a CMD box running as SYSTEM PsExec.exe -sid cmd --> new CMD box will open Microsoft Windows [Version 10.0.19044.2006] (c) Microsoft Corporation. Alle Rechte vorbehalten. C:\WINDOWS\system32>whoami nt-autorität\system C:\WINDOWS\system32>cd %localappdata% C:\Windows\System32\config\systemprofile\AppData\Local> Edited April 6, 2023 by rudi Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now