I have failed in execute initdb in "c:\Windows\Temp\dir" folder as reproduce logs below. The OS's messages "The current directory is invalid." was returned.
Is that directory or any parent of it a junction point?
Also, why would you possibly run the installer from there? You should be using %TEMP% which should generally resolve to C:\Users\{Username}\AppData\Local\Temp or similar.
creating template1 database in c:/testdb/base/1 ... The current directory is invalid.
It looks like somehow the current working directory is unmapped or cannot be found.
Is there any chance you have mapped network drives in use?