NOTE: I am on a 64-bit system.
I am having trouble finding articles regarding my current situation. I using PowerShell to test if a certain path exists:
"C:\Windows\SysWOW64\config\systemprofile\Desktop"
and it returns true even though the Desktop folder does not exist in SysWOW64. I know it is related to the fact that I do have the path:
"C:\Windows\System32\config\systemprofile\Desktop"
but I do not know why. In context, I am automating some stuff in Excel (yes, I know it is unsupported, but with the Desktop folders everything works just fine), and I want to test if both paths exist before trying to continue with automation.
My question is, is it necessary to test both paths? Will Excel automation work if I have the Desktop folder in just one of the paths because they seem to be connected somehow?
I have seen this and this article, and that leads me to believe yes, but as a programmer I am hesitant to couple these things so tightly together in case they change in the future. Is there a more elegant solution?
Assuming:
exists, but:
does not.
64bit PowerShell:
32bit PowerShell:
The second test in the 32bit PowerShell is redirected from
system32
tosyswow64
. Checks forsyswow64
are usually not redirected.You claim
Test-Path C:\Windows\SysWOW64\config\systemprofile\Desktop
returns true even though that folder does not exist. Are you sure?Also what's the bitness of your Excel components, if it is 32bit you only need to concern yourself with the SysWOW64 path.