Addons: Left over files in Default User Profile

Questions about Update Pack making? Ask here.
Post Reply
Posts: 98
Joined: Fri Jan 26, 2007 7:11 pm

Addons: Left over files in Default User Profile

Post by Zoom7000 » Sat Dec 20, 2008 3:33 am

I mainly use addons in my RIS installations and have been finding that there have been loads of folders with addon installations files left over in the "Default User" profile that is causing delayed logon times when users log on after a PC has been rebuilt.

On investigating, I find that the folders left over all start 7z with a random 4 character string after it and ends in .tmp



Is there anyway I can delete these files before logon? I tried a script, but the 4 character string after 7z changes all the time.

User avatar
Site Admin
Posts: 5190
Joined: Tue Nov 23, 2004 6:03 pm
Location: Pennsylvania

Post by RyanVM » Sat Dec 20, 2008 9:43 am

use 7z* in your rmdir command?
Get up to $200 off on hosting from the same people who host this website!

User avatar
Posts: 67
Joined: Fri Jan 04, 2008 8:53 am

Post by nomadturk » Sat Dec 20, 2008 9:55 am

As i said, (Again, me! hehe) This way you can delete folders. But this is as much i could do it. This script below deletes files any folders starting with "7z" from within your default users directory.
BUT, if there are any files in that directories, you may need to run the script twice. It first deletes the inner contents of directories. Second run deletes the folders themselves. (Sometimes... 3-4 runs needed.)

I don't know if you can run this at installation stage. But if you can, you can do it by the code below.

Code: Select all

wscript DeleteFolders.vbs

Name this as DeleteFolders.vbs and try.

Code: Select all

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
	& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colFolders = objWMIService.ExecQuery _
	("Select * from Win32_Directory where Name Like '%C:\\Documents and Settings\\Default User\\7z%'")
Set colFiles = objWMIService.ExecQuery _
	("Select * from Win32_Directory where Name Like '%C:\\Documents and Settings\\Default User\\7z%\\'")

	For Each objFolder in colFolders
	errResults = objFolder.Delete

Well, give it a try. Hope it might help you.
I sure learnt something while searching for this. (:
You may improve it yourself.

Posts: 183
Joined: Sun Feb 04, 2007 1:29 am
Location: Livonia, MI

Post by dolivas » Sat Dec 20, 2008 2:25 pm

nomadturk ok that worked how would I add the Administrator directory to the script?

("Select * from Win32_Directory where Name Like '%C:\\Documents and Settings\\Administrator\\7z%'")


User avatar
Posts: 3213
Joined: Mon May 22, 2006 12:27 am
Location: Honduras

Post by ricktendo64 » Sat Dec 20, 2008 2:56 pm

Code: Select all

FOR /F %%I IN ('DIR /B "%SYSTEMDRIVE%\Documents and Settings\Default User\7z*.tmp"') DO RD /S /Q "%SYSTEMDRIVE%\Documents and Settings\Default User\%%I"

Post Reply