Hi, I have the following script that works but I don’t want it to copy psexec.exe to C:\Windows\SysWOW64. What’s the best way to get it to actually copy to C:\Windows\System32? Thanks for any help in advance.
If you use a 32-bit Powershell console it will always copy your files to “C:\Windows\SysWOW64” because the 32-bit console “does not see” the real syste32 directory. You should use the 64-bit console.
I had this exact same problem a couple week ago and found the solution. In order to write to the Systme32 folder from a 32-bit app, you need to use the built-in (somewhat undocumented) alias for System32 which is Sysnative.
And running the Powershell script on a 64-bit system with a 64-bit Powershell console wouldn’t have worked? Why do you use a 32-bit Powershell console on a 64-bit system at all?
In my case we have over 4,000 systems and all but about a dozen are 64-bit. The apps I’m working on are written on a 32-bit system which are stored and accessed from a file server.