Home > Back-end >  C, with administrator privileges to run the program, get the current login user (not administrator)
C, with administrator privileges to run the program, get the current login user (not administrator)

Time:09-20

Under normal circumstances can use function SHGetSpecialFolderLocation direct access;

Problem is that the program needs to run with administrator account, the current login user is administrator, obtain the result of the function is directory under the administrator account,

CodePudding user response:

Results with the administrator account to run, is for the directory administrator account, plausible,

CodePudding user response:

reference 1st floor u010165006 response:
run with administrator account, get is the result of the directory under the administrator account, plausible,


Is such, can be very uncomfortable, but demand is program has a lot of places need administrator privileges to run, but need to be in the current user (directory) operating under something

CodePudding user response:

I do serial program in Windows 7 or more also encounter this problem, the perfect solution:
http://blog.csdn.net/wawj522527/article/details/7764226