Windows Server System32\drivers Folder Reached 33GB: 36,927 SET*.tmp Files

The C: drive on a Windows Server 2022 machine was using about 97 GB. Of that, roughly 62.5 GB was under C:\Windows.

I initially expected the usual disk-space consumers, such as WinSxS or Windows Update files. Instead, most of the unexpected System32 drivers disk space was in the drivers folder.

The investigation led to 36,927 SET*.tmp files in that directory. I checked their metadata and the associated kernel driver before taking any action. A reboot cleared the files, and they haven’t come back so far, but I never identified what caused them to accumulate.

Caution: Don’t delete files from C:\Windows\System32\drivers just because they have a .tmp extension. That folder holds kernel-mode Windows and third-party drivers, and a careless delete can break booting, networking, storage, security software or applications. Everything below is about identifying the files first.

Environment and Symptoms

  • OS: Windows Server 2022
  • C: used space: about 97 GB
  • C:\Windows: about 62.5 GB
  • C:\Windows\System32: about 39 GB

The last reboot on this server had been on the day a new EDR agent was installed on it. The files described below were created five days later.

Finding Where the Space Went

Instead of reaching for a WinSxS cleanup, I measured each directory under System32:

Get-ChildItem C:\Windows\System32 -Directory -Force | ForEach-Object {
    $size = (Get-ChildItem $_.FullName -File -Recurse -Force -ErrorAction SilentlyContinue |
        Measure-Object Length -Sum).Sum
    [PSCustomObject]@{
        Folder = $_.FullName
        SizeGB = [math]::Round($size / 1GB, 2)
    }
} | Sort-Object SizeGB -Descending
FolderSize
C:\Windows\System32\drivers33.8 GB
C:\Windows\System32\config1.86 GB
C:\Windows\System32\winevt0.59 GB
C:\Windows\System32\DriverStore0.27 GB

Everything else was small. Two caveats on this command: -ErrorAction SilentlyContinue hides any file it can’t read, so the totals can come out lower than the real figures, and on a large System32 it can take a while to finish.

36,927 SET*.tmp Files

Inside C:\Windows\System32\drivers was a very long list of files named like this:

SET736A.tmp
SET736B.tmp
SET736C.tmp
SET736D.tmp
...

Selecting them and opening Properties showed:

  • File count: 36,927
  • Size: about 33.5 GB (about 33.6 GB on disk)
  • Individual files: roughly 954 KB to 976 KB

Almost the whole abnormal size of the folder was these files. They had all been created on the same day, at a rate of several per second.

Why I Didn’t Delete Them Right Away

With 36,927 files taking up more than 33 GB, deleting them in bulk might seem like the quickest fix. I held off because they were in the drivers directory, and I hadn’t identified their contents or checked the associated driver state.

What the Metadata Said

I checked the file’s VersionInfo rather than relying on its .tmp extension:

Get-Item C:\Windows\System32\drivers\SET736A.tmp | Format-List

The metadata pointed to a driver module:

InternalName:     TmKmSnsr.sys
OriginalFilename: TmKmSnsr.sys
FileVersion:      1.0.0.1174
FileDescription:  TrendAI LWE Sensor driver Module
Product:          LWE

The file’s length was 976,432 bytes.

So the accumulated SET*.tmp files carry metadata associated with the TrendAI LWE Sensor driver, a security product that was already installed on the server. That is as far as this goes. VersionInfo is what a file declares about itself; it doesn’t verify that the file is a genuine driver binary, and I haven’t included a signature or hash check here. It also doesn’t explain why 36,927 copies ended up in the folder.

Checking the Kernel Driver Status

Next I looked at the actual service:

sc query TmKmSnsr

SERVICE_NAME: TmKmSnsr
TYPE: 1  KERNEL_DRIVER
STATE: 3  STOP_PENDING
WIN32_EXIT_CODE: 0
SERVICE_EXIT_CODE: 0
sc qc TmKmSnsr

TYPE: 1  KERNEL_DRIVER
START_TYPE: 4  DISABLED
ERROR_CONTROL: 1  NORMAL
BINARY_PATH_NAME: \SystemRoot\system32\DRIVERS\TmKmSnsr.sys
LOAD_ORDER_GROUP: Extended Base
TAG: 73

The driver was configured as DISABLED, but Windows still reported its runtime state as STOP_PENDING. I couldn’t establish whether that had any direct connection to the SET*.tmp files. Given that uncertainty and the number of files involved, I decided not to remove them while the server was running.

Comparing Driver Versions

I also compared the installed driver with the temp files:

Get-ChildItem C:\Windows\System32\drivers\TmKm*.sys |
    Select-Object Name,Length,@{N="Version";E={$_.VersionInfo.FileVersion}}
Version
Installed TmKmSnsr.sys (975,920 bytes)1.0.0.1167
SET*.tmp metadata1.0.0.1174

The version recorded in the temp files was newer than the installed driver (1.0.0.1174 versus 1.0.0.1167). This suggests the files may have been associated with a different driver package or version, but I have no logs confirming an update attempt.

The timing is worth noting: the files appeared five days after a different EDR product was installed and the server was rebooted. The TrendAI sensor had been on the server before that. I couldn’t establish any link between the new installation and these files, so I’m treating the timing as context rather than evidence of causation.

Resolution: A Controlled Reboot

I chose a reboot instead of manually deleting the files. After the server restarted, none of the SET*.tmp files remained. The drivers directory had dropped from 33.8 GB to about 252 MB (about 253 MB on disk), with 705 files and 16 folders. Disk usage on C: went back to normal, and as of now the files haven’t reappeared.

Before vs After

BeforeAfter reboot
C:\Windows\System32\drivers~33.8 GB~252 MB
SET*.tmp files36,927 (~33.5 GB)0
Files in the directory—705
Space recovered~33.5 GB

I can say the files were removed on their own once the server restarted. I can’t say what mechanism removed them, and I didn’t find vendor documentation that explains it. That the files haven’t returned so far is an observation, not an explanation: I still don’t know what created them, so I can’t rule out a repeat.

Lessons Learned

  1. Measure before cleaning up. A large Windows directory doesn’t automatically mean WinSxS or Windows Update files are responsible. Check the actual directory sizes first.
  2. Don’t judge files by their extensions. The SET*.tmp files carried metadata associated with a kernel driver. Their names alone weren’t enough to decide whether they were safe to remove. If you catch files like these before a restart, Get-AuthenticodeSignature is another check worth adding; I didn’t capture it here.
  3. Check the driver state and version. sc query, sc qc and VersionInfo gave me useful clues, but none of them established why the files had accumulated.
  4. Avoid mass deletion until you understand what you’re removing. A reboot cleared the files without manual deletion, and they haven’t come back so far. Since the underlying cause remains unknown, it’s still worth watching the directory for recurrence.

Commands Used

# Size of each folder under System32
Get-ChildItem C:\Windows\System32 -Directory -Force | ForEach-Object {
    $size = (Get-ChildItem $_.FullName -File -Recurse -Force -ErrorAction SilentlyContinue |
        Measure-Object Length -Sum).Sum
    [PSCustomObject]@{ Folder = $_.FullName; SizeGB = [math]::Round($size / 1GB, 2) }
} | Sort-Object SizeGB -Descending

# Inspect one temp file's metadata
Get-Item C:\Windows\System32\drivers\SET736A.tmp | Format-List

# Compare with the installed driver
Get-ChildItem C:\Windows\System32\drivers\TmKm*.sys |
    Select-Object Name,Length,@{N="Version";E={$_.VersionInfo.FileVersion}}
sc query TmKmSnsr
sc qc TmKmSnsr

Final Conclusion

The 33.8 GB in System32\drivers was almost entirely 36,927 SET*.tmp files that carried the metadata of the TrendAI LWE Sensor driver. They were created on one day, several per second, five days after the last reboot. I didn’t delete them. A reboot removed them, the folder went from about 33.8 GB to 252 MB, and they haven’t reappeared so far. What made them accumulate, I don’t know.

Related reading: The Temp Folder That Kept Coming Back is another Windows Server disk-space case that a reboot cleared, though there the cause was a pending patch restart.

Frequently Asked Questions

Is it safe to delete SET.tmp files in System32\drivers?*

I wouldn’t assume so. The folder holds kernel-mode drivers, and files with a .tmp extension aren’t necessarily disposable. On our server these files carried the metadata of a security sensor driver whose service was in STOP_PENDING, so I checked the file metadata and the service state first and then rebooted. The files were removed without my deleting them. That was one server, so I can’t say the same will happen on yours.

Why is the System32\drivers folder so large on Windows Server?

On our server it was 33.8 GB because of 36,927 SET*.tmp files, and about 252 MB once they were gone. To find your own cause, measure each folder under System32 and then look at what’s inside the largest one, as in the PowerShell command above. Check a file’s VersionInfo before deciding what it is.


Jacob Ahn Avatar