I'm sorry Deana, it's my mistake. I was crazy, between the RegOpenflags(0) and RegOpenkey(@RegMachine,..), I had another RegOpenflags(32). Remove this RegOpenflags(32), everything works correctly.
What the difference between compiling my WinBatch with 32- and 64-bit? Why did you ask me that question?
I always compile my script with 32-bit Winbatch compiler.
Most of the systems in my company are 63-bit, do you think that I better compile my script using 64-bit compiler?
As usual, thanks so much for your help, Deana.