(imported comment written by SystemAdmin)
I’ve been working on a fixlet that does this just as a test.
In the fixlet action, though, it fails to delete or create any directory in C:\Windows\System32\config\systemprofile\AppData\LocalLow
Here’s the bit of fixlet logic
dos rmdir /Q /S
"C:\Windows\SysWOW64\config\systemprofile\AppData\LocalLow\Sun" dos rmdir /Q /S
"C:\Windows\system32\config\systemprofile\AppData\LocalLow\Sun" dos mkdir
"C:\Windows\System32\config\systemprofile\AppData\LocalLow\Sun\Java" dos mkdir
"C:\Windows\SysWOW64\config\systemprofile\AppData\LocalLow\Sun" dos mklink /J
"{pathname of windows folder & "\SysWOW64\config\systemprofile\AppData\LocalLow\Sun\Java
"}"
"{pathname of windows folder & "\System32\config\systemprofile\AppData\LocalLow\Sun\Java
"}"
I even made the path completely explicit rather than relying on relevance or an environment variable to locate the windows directory. I’ve done this many different ways, and always the same problem - can remove / create directories in syswow64, but not in system32.
I’ve done this:
createfile until _end_ @ECHO OFF rmdir /s /q
"%windir%\SysWOW64\config\systemprofile\AppData\LocalLow\Sun" > NUL 2>NUL rmdir /s /q
"%windir%\system32\config\systemprofile\AppData\LocalLow\Sun" > NUL 2>NUL mkdir
"%windir%\system32\config\systemprofile\AppData\LocalLow\Sun\Java" > NUL 2>NUL mkdir
"%windir%\SysWOW64\config\systemprofile\AppData\LocalLow\Sun" > NUL 2>NUL mklink /J
"%windir%\SysWOW64\config\systemprofile\AppData\LocalLow\Sun\Java"
"%windir%\System32\config\systemprofile\AppData\LocalLow\Sun\Java" > NUL 2>NUL _end_ move __createfile
"__Download\x32JavaOnX64SymLink.bat" waithidden
"{pathname of system folder & "\cmd.exe
"}" /C
"{(pathname of client folder of current site) & "\__Download\x32JavaOnX64SymLink.bat
"}"
which didn’t work (looks like for the same reasons)
and this, which is probably the least error prone and most correct way - just like the top way. It doesn’t work. This is just to show that I know not to hardcode the windows directory 
dos rmdir /Q /S
"{pathname of windows folder & "\SysWOW64\config\systemprofile\AppData\LocalLow\Sun
"}" dos rmdir /Q /S
"{pathname of windows folder & "\system32\config\systemprofile\AppData\LocalLow\Sun
"}" dos mkdir /Q /S
"{pathname of windows folder & "\system32\config\systemprofile\AppData\LocalLow\Sun\Java
"}" dos mkdir /Q /S
"{pathname of windows folder & "\SysWOW64\config\systemprofile\AppData\LocalLow\Sun
"}" dos mklink /J
"{pathname of windows folder & "\SysWOW64\config\systemprofile\AppData\LocalLow\Sun\Java
"}"
"{pathname of windows folder & "\System32\config\systemprofile\AppData\LocalLow\Sun\Java
"}"
For the life of me, I can’t figure out why it won’t do any directory operations in the System32\config\systemprofile\AppData\LocalLow directory, but it will do those operations in the SysWOW64\config\systemprofile\AppData\LocalLow\ directory.
There are other issues with even the default fixlet in general, though. Big problems I would say, if I’m right.
If the java installer executable fails to complete successfully – that is it executes, extracts the msi to the wrong place, it can’t call msiexec with the right path and quits – the line in the fixlet that says this
regset
"[HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\JavaInstallation]"
"InstallingJava7_32"=dword:00000001
is all that is necessary for the applicability relevance to show the machine as ‘fixed’ - leading someone to believe that java was successfully installed. That bit of relevance looks like this:
if (exists key
"HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\JavaInstallation" of registry) then (not exists value
"InstallingJava7_32" whose (it = 1) of key
"HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\JavaInstallation" of registry)
else
true
The registry key InstallingJava7_32 is only deleted when the following condition is met
continue
if
{((exists value
"DisplayVersion" whose ((it >=
"7.0.0") of (it as string as version)) of keys whose (value
"DisplayName" of it as string as lowercase contains
"j2se runtime environment" OR value
"DisplayName" of it as string as lowercase starts with
"java(tm)") of it) AND (exists key whose (((it contains
"java" OR it contains
"j2se") AND (it contains
"runtime environment" OR it contains
"update")) of (value
"DisplayName" of it as string as lowercase)) of it)) of key
"HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of x32 registry
}
and so it’s never deleted, and the machine is shown as fixed. In order for the fixlet to become relevant again, I simply manually delete that registry key.
I’ve been plugging away at this for a long, long time now and getting nowhere - I’m pretty new at all this stuff.