/build/static/layout/Breadcrumb_cap_w.png

Can we delete user's temp internet file during system context installation?

I am trying to delete all user's temp internet files via custom action. I used vbscript to do so. But as we know, it requires logoff and login for system context installation. 

Is there any other way to delete the user's temp internet files without logoff? And silently during system context installation?


0 Comments   [ + ] Show comments

Answers (3)

Answer Summary:
Finally i used the below script in cmd file. @echo off IF NOT EXIST "%SystemDrive%\Users\" ( for /D %%x in ("%SystemDrive%\Documents and Settings\*") do ( rmdir /s /q "%%x\Local Settings\Temporary Internet Files" ) ) IF EXIST "%SystemDrive%\Users\" ( for /D %%x in ("%SystemDrive%\Users\*") do ( rmdir /s /q "%%x\AppData\Local\Microsoft\Windows\Temporary Internet Files" ) ) To call the cmd file silently in vbscript custom action, i used the below script On error resume next Set WshShell = CreateObject( "WScript.Shell" ) Set objFSO = CreateObject("Scripting.FileSystemObject") strPrgf=WshShell.ExpandEnvironmentStrings("%PROGRAMFILES%") strPrgfx86=WshShell.ExpandEnvironmentStrings("%PROGRAMFILES(X86)%") dest=strPrgf & "\cleanup.cmd" dest2=strPrgfx86 & "\cleanup.cmd" if objFSO.FolderExists(strPrgfx86) then Set WshShell = CreateObject("WScript.Shell" ) WshShell.Run chr(34) & dest2 & Chr(34), 0 Set WshShell = Nothing Else Set WshShell = CreateObject("WScript.Shell" ) WshShell.Run chr(34) & dest & Chr(34), 0 Set WshShell = Nothing End if
Posted by: jagadeish 11 years ago
Red Belt
1

You can write a VBScript which will read the userprofile's folder names under C:\Users except Default and Public folder and delete the Temp files under each users profile's folder


Comments:
  • Again vbscript won delete the user files in system context installation. It requires Logoff for active setup to run. - blask28 11 years ago
  • No.. You dont need to have Active Setup - jagadeish 11 years ago
Posted by: blask28 11 years ago
Senior Yellow Belt
0

Finally i used the below script in cmd file.

@echo off

IF NOT EXIST "%SystemDrive%\Users\" (
    for /D %%x in ("%SystemDrive%\Documents and Settings\*") do (
        rmdir /s /q "%%x\Local Settings\Temporary Internet Files"
    )
)

IF EXIST "%SystemDrive%\Users\" (
    for /D %%x in ("%SystemDrive%\Users\*") do (
        rmdir /s /q "%%x\AppData\Local\Microsoft\Windows\Temporary Internet Files"
    )
)

To call the cmd file silently in vbscript custom action, i used the below script

 

On error resume next

Set WshShell = CreateObject( "WScript.Shell" )
Set objFSO = CreateObject("Scripting.FileSystemObject")

strPrgf=WshShell.ExpandEnvironmentStrings("%PROGRAMFILES%")
strPrgfx86=WshShell.ExpandEnvironmentStrings("%PROGRAMFILES(X86)%")
dest=strPrgf & "\cleanup.cmd"
dest2=strPrgfx86 & "\cleanup.cmd"

if objFSO.FolderExists(strPrgfx86) then

Set WshShell = CreateObject("WScript.Shell" )
WshShell.Run chr(34) & dest2 & Chr(34), 0
Set WshShell = Nothing

Else

Set WshShell = CreateObject("WScript.Shell" )
WshShell.Run chr(34) & dest & Chr(34), 0
Set WshShell = Nothing

End if

 

Posted by: SMal.tmcc 11 years ago
Red Belt
0

If you are talking IE this will do it for current user

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255


Comments:
  • for others this may help
    http://www.catonmat.net/blog/clear-privacy-ie-firefox-opera-chrome-safari/

    http://ie-support.blogspot.com/2011/02/use-command-line-to-delete-ie-browsing.html - SMal.tmcc 11 years ago
  • Thanks Steve. Can this be done silently? - blask28 11 years ago
    • not that I am aware of, look at this link and one response (30Aug2012 11:41) explains why and later someone mentions some other software.
      http://www.autoitscript.com/forum/topic/143786-clearing-internet-explorer-history/ - SMal.tmcc 11 years ago
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ