Addons: Left over files in Default User Profile

Questions about Update Pack making? Ask here.
Post Reply
Zoom7000
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

Example:

7zSBCA.tmp
7zSC1d.tmp
7zSC02.tmp
7zSC9c.tmp
7zSCA5.tmp
7zSBCC.tmp
7zSC1F.tmp
7zSC3A.tmp
7zSB04.tmp
7zSC9F.tmp
7zSC86.tmp
7zSCA8.tmp
7zSCA9.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
RyanVM
Site Admin
Posts: 5186
Joined: Tue Nov 23, 2004 6:03 pm
Location: Pennsylvania
Contact:

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!
http://www.ryanvm.net/forum/viewtopic.php?t=2357

User avatar
nomadturk
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
Next

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

dolivas
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%'")

Thanks
dolivas

User avatar
ricktendo64
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