Jump to content

Recommended Posts

Posted

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?

 

Posted

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

Posted
  On 4/3/2023 at 3:51 PM, 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

 

Expand  

The temporary folder has been deleted in the above way. thank you

Posted (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

  1. start a CMD box using "run as administrator"
  2. Get the sysinternals tool PSEXEC
  3. 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 by rudi

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...