IE Cache Clean up

Hi, i can execute code from Fixlet debugger and it is clearing up IE history / cache, but it is not working from bigfix action

From Fixlet Debugger action tab:-

action uses wow64 redirection{not x64 of operating system}

delete __createfile

//CREATE FILE
createfile until END_OF_FILE

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255

END_OF_FILE

delete powershell.ps1
move __createfile powershell.ps1

wait { pathname of file ((it as string) of value “Path” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell” of native registry) } -ExecutionPolicy Bypass -File powershell.ps1

from Bigfix Action

action uses wow64 redirection{not x64 of operating system}

delete __createfile

//CREATE FILE
createfile until END_OF_FILE

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255

END_OF_FILE

delete powershell.ps1
move __createfile powershell.ps1

override wait
hidden=true
runas=currentuser

wait { pathname of file ((it as string) of value “Path” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell” of native registry) } -ExecutionPolicy Bypass -File powershell.ps1

Try this…

action uses wow64 redirection{not x64 of operating system}
delete __createfile

//CREATE FILE
createfile until END_OF_FILE

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255

END_OF_FILE

delete powershell.ps1
move __createfile powershell.ps1

override wait
hidden=true
runas=currentuser

wait powershell.exe -executionpolicy remotesigned -File "{​client folder of current site as string}​\__Download\powershell.ps1"

Best practice would be to move the file out of the __Download folder to somewhere like c:/tmp (create if it doesn’t exist) then clean it up at the end but you’re best not to run anything from the download folder as it could lock up and then break everything else if it doesn’t close commands correctly.

It’s also worth checking if there is a current user when executing :smiley:

Echoing this for clarity. By default a standard user account does not have access to the __BESData folder or anything under it, so you would have to move the PowerShell script to a place the user can read before you try to execute it

Just to add to this, you don’t necessarily have to do this with powershell either unless you just really wanted to.
It should work fine directly from a wait override or by using the old RunAsCurrentUser.exe.

This is what we have used for quite a few years
prefetch RunAsCurrentUser.exe sha1:ee47505ebfb2790b9da8a20ed70e67158e9753d0 size:342528 http://software.bigfix.com/download/bes/util/RunAsCurrentUser-2.0.3.1.exe

utility __Download\RunAsCurrentUser.exe

//Kill IE
waithidden taskkill /F /IM iexplore.exe

//Clear Browser Cache
waithidden __Download\RunAsCurrentUser.exe --q RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351
//Wait 15 sec for clear process to finish before setting settings…
dos ping 127.0.0.1 -n 15 > nul

i tried with this code as well but it does not remove the history details , however i think runas=currentuser keyword does the same thing as download utility