"tw-7f0-87c-*****.tmp" folders  

Page 2 of 2 FirstFirst 12

  1. Posts : 308
    Win10
       #11

    margrave55 said:
    I have those folders, too. But they're all empty.
    I don't know what they're for.
    Me three...
      My Computer


  2. Posts : 1,459
    Windows 10 Pro (+ Windows 10 Home VMs for testing)
       #12

    They're the remnants of Microsoft Provisioning. I just delete them..
      My Computer


  3. Posts : 27
    Windows 10
    Thread Starter
       #13

    HeM said:
    Hi,

    There is a task, in Task Scheduler => Microsoft\Windows\Management\Provisioning => Logon, which causes OP's issue. Disabling this task, issue does not exist any more.
    I don't know if or how 'disabling' affects system.

    System deletes those empty folders, periodically.

    Also, you may read this.
    I have disabled Task Scheduler => Microsoft\Windows\Management\Provisioning => Logon and I don't get those tmp folders anymore.
      My Computer


  4. Posts : 4
    Windows 10
       #14

    S Malik said:
    I have disabled Task Scheduler => Microsoft\Windows\Management\Provisioning => Logon and I don't get those tmp folders anymore.
    It appears I can't delete them as there are no security and owner on them.
    I have lot's of them.
      My Computer


  5. Posts : 2
    Windows 10
       #15

    I know that I am late, but I just stumbled via web search over the posting. This described exactly the observation I made while controlling the content of my TEMP folder. After a little testing (I modified the LOGON task to allow run on demand, then started the task manually, waited some 90 secs and boom: there where another "tw-*****.tmp" folders in my TEMP folder) I decided to beat the system with its own tools.

    First of all, you have to launch taskschd.msc of course.
    I modified the task under Task Scheduler Library > Microsoft > Windows > Management > Provisioning > Logon a little bit further in this way:
    1. I added another action under the original line %windir%\system32\ProvTool.exe /turn 5 /source LogonIdleTask, leaving the first line and its task unmodified. The new line reads %windir%\System32\cscript.exe //nologo c:\vbscript\deleteemptyfolders.vbs %windir%\temp 10. For this you have to click on Properties of the Logon task and select the Actions tab. On this you can click on New to add a new action.
    2. In c:\vbscript (or any directory of your choice, you have to change the path above accordingly) you place the script deleteemptyfolders.vbs (see below). This means that you put the %windir%\System32\cscript.exe part of the line in then field Program/script and the //nologo c:\vbscript\deleteemptyfolders.vbs %windir%\temp 10 part in the field Add arguments (optional):.
    3. After doing so you can close the dialog with OK.

    Result: See picture (apology for only having a german version screenshot).
    "tw-7f0-87c-*****.tmp" folders-bild2.png
    Now, this is only the half way. Now you need the script, which is following here:
    Code:
    Option Explicit
    
    Dim oFso     : Set oFso     = WScript.CreateObject("Scripting.Filesystemobject") ' oFso As IWshRuntimeLibrary.FileSystemObject / Windows Script Host Object Model / C:\Windows\SysWOW64\wshom.ocx
    Dim WshShell : Set WshShell = WScript.CreateObject("Wscript.Shell") ' WshShell As IWshRuntimeLibrary.WshShell / Microsoft Scripting Runtime / C:\Windows\SysWOW64\scrrun.dll
    Dim oShell   : Set oShell   = WScript.CreateObject("Shell.Application") ' oShell As Shell32.Shell / Microsoft Shell Controls And Automation / C:\Windows\SysWOW64\shell32.dll
    Dim oArgs    : Set oArgs    = WScript.Arguments ' aArgs As IHost.IArguments_Class / Windows Script Host / C:\Windows\SysWOW64\wscript.exe
    
    Call Main
    
    ' Set WshShell = Nothing
    ' Set oFso = Nothing
    
    WScript.Quit
    
    ' -----------------------------------------------------
    
    Sub Main
    	Dim oFld
    	Dim ParamDir, ParamWait
    '	Copyright Thomas Rauner, September 2019
    '	GNU GENERAL PUBLIC LICENSE; see https://www.gnu.org/licenses/gpl-3.0
    '	Purpose:
    '	This script deletes all empty folders and subfolders in a given or current directory.
    '	Prerequisits: None. Output: None
    '	Parameters: {ThisScript} [ParamDir] [ParamWait]
    '	{ThisScript}:			This script, original name: DeleteEmptyFolders.vbs
    '	[ParamDir] (optional):	Folder, in which the script will search for and delete empty folders.
    '							A folders means to be empty, if (a) it does not contain any files and
    '							(b) contains no or only empty subfolders.
    '	[ParamWait] (optional):	Time in seconds to wait before the script starts searching and deleting.
    '							A little pause might be necessary, if you plan to hook this skript
    '							to the task "Task Scheduler Library > Microsoft > Windows >  
    '							Management > Provisioning > Logon". A reasonable waiting time (tested)
    '							should be 3 seconds.
    '	Example command line: wscript.exe //nologo DeleteEmptyFolders.vbs %windir%\temp 3
    
    	If oArgs.count > 0 Then
    		On Error Resume Next
    			ParamDir  = oArgs(0) ' First unnamed parameter should be the folder
    			ParamDir = WshShell.ExpandEnvironmentStrings(ParamDir) ' Environment variables allowed
    			If Not oFso.FolderExists(ParamDir) Then ParamDir = ""  ' If folder does not exist, empty variable
    			
    			ParamWait = oArgs(1) ' Second unnamed parameter should be a number (seconds to wait)
    			If Not IsNumeric(ParamWait) Then ParamWait = 0 Else ParamWait = CLng(ParamWait)
    		On Error GoTo 0
    	End If
    	If ParamDir = "" Then ParamDir = WshShell.CurrentDirectory ' If folder variable is empty, take the current folder
    	WScript.Sleep ParamWait * 1000  ' wait the number of seconds found above
    	Call TraverseFolders(ParamDir)  ' start searching for empty folders
    End Sub
    
    ' -----------------------------------------------------
    	
    Sub TraverseFolders(path)
    	Dim oFolder, oSubFolder 
    	Set oFolder = oFso.GetFolder(path)
    	If oFolder.Files.Count = 0 Then ' No files => candidate for erasure
    		If oFolder.SubFolders.Count = 0 Then ' still no subfolders => erase folder
    			On Error Resume Next
    '			WScript.Echo "Deleting " & oFolder.Path & " ..." ' uncomment this, if you want to see what ois happening. Hint: Only do this with cscript.exe, otherwise you might have to click numerous "OK" messages.
    			oFolder.Delete ' This is what we are after
    			On Error GoTo 0
    		Else ' has subfolders? => check subfolders
    			For Each oSubFolder in oFolder.SubFolders
    			      TraverseFolders(oSubFolder.Path)
    			Next ' oSubFolder
    		End If
    	Else ' has files? => maybe has (empty?) subfolders also => go checking
    		For Each oSubFolder in oFolder.SubFolders
    		      TraverseFolders(oSubFolder.Path)
    		Next ' oSubFolder
    	End If
    End Sub
    If you now start the modified task Logon again, and watch your TEMP folder some 90 seconds, you should notice the generation of our "tw-*****.tmp" folders in TEMP folder and – after the given 10 seconds – those "tw-*****.tmp" folders should be gone again. Proof of concept.

    Of course you can lower the waiting time back to 3 seconds as described in the script – it's cosmetics. And also you now can reset the checkbox Allow a task to be run on demand on the SETTINGS tab back to unchecked.

    With this setting the ominous "tw-*****.tmp" folders should be out of your sight. After the next Windows upgrade you very likely have to reset this task again like described above.

    I hope this to be helpful not only to me. Thank you all for your research that made this posting possible. Cheers!
      My Computer


  6. Posts : 1,459
    Windows 10 Pro (+ Windows 10 Home VMs for testing)
       #16

    Excellent script. I tried it from an elevated PowerShell prompt and it worked immediately. (I used 5 as the delay value)

    I'm not sure though about adding it as an action to that particular task. I think I'll create a seperate logon task... but thank you anyway.
      My Computer


  7. Posts : 2
    Windows 10
       #17

    RickC said:
    I'm not sure though about adding it as an action to that particular task. I think I'll create a seperate logon task... but thank you anyway.
    Your doubt is justified. This afternoon I started my computer again, and what worked "in the lab", does not work "in the field". So I guess that you are absolutrely right concerning the separate task - I will do so, too.

    Greets, Thomas
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 20:11.
Find Us




Windows 10 Forums