When a program is executed by an administrator in Windows Vista or later, it might not be executed with administrator account. That is because User Account Control (UAC) system is incorporated. For details about UAC, refer to the following.
https://msdn.microsoft.com/en-us/library/aa480152
Action
To execute a program with administrator account, set the followings in manifest property page of modules.
Creating an application manifest
"2: External Files" or "3: Insert"
Specifying an execution authority
"3: Administrator"
Some operations have to be done with an administrator account. For example, if an application is built under the status that the "0: Create" or "1: Not Create" selected, files are output to neither under "C:\Windows" nor "C:\Program Files". The files are output to the following folder.
In this case, the program ends normally.
In case that output destination is specified under "C:\Windows".
"C:\USERS\(User name)\AppData\Local\VirtualStore\Windows"
In case that output destination is specified under "C:\Program Files".
C:\USERS\(User name)\AppData\Local\VirtualStore\Program Files
To create a file under "C:\Windows" or "C:\Program Files", execute the program with administrator account.