VISTA*在这个系统使用renamefile对文件(夹)改名, 对于普通的文件改名成功,但如果被改的是windows/program files等系统目录的文件时,改名就会失败,movefile移动该文件(夹)也不行。 我觉得,可能是因为在vista中,更改那些文件必须要提高软件的权限吧。于是我使用了xp中关机时常用的提权函数 OpenProcessToken(
AdjustTokenPrivileges( 但是,这方法行不通。 我参考了网上的一款软件,叫“文件夹加密超级大师”,这是加密软件,加密后会把文件转移到根目录下,但我不知道他们用的是什么方式来移动文件,这软件的保护很深,api spy,exescope都搞不定他。
很疑惑,急需帮助!很疑惑,急需帮助! 谢谢大家
Admin也不是最大权限的!SYSTEM才是
UAC启用时,Admin都不能直接访问保护区,用RUN AS ADMIN或采用elevation XML manifest才可以
This is a funny thing the first time you see it. :-)It turns out that Windows actually examines the names of all executable you run, and if they contain the words "setup", "install", "update", "patch" etc then the executable is automatically elevated; e.g. MySetup001.exe will run elevated. I've heard of cases where a word such as "update" found within an executables resources also trigged elevation. I've also heard that Windows can recognize and elevate setup files created by InstallShield and Wise. I'm not sure of the exact heuristics used.So this is going to help older setups to work reliably under Vista.“Installer Detection” Policy = Automatic ElevationThis is a funny thing the first time you see it. It turns out that Windows actually examines the names of all executable you run, and if they contain the words “setup”, “install”, “update”, “patch” etc then the executable is automatically elevated; e.g. MySetup001.exe will run elevated. I’ve heard of cases where a word such as “update” found within an executables resources also trigged elevation. Do I need to all my Installer helper executables?No. Just the main setup program. All other executables downstream will run automatically as administrator.
Example: Setup.exe runs MyApplication.msi, which has a custom action to run MyHelper.exe, which inturn runs AnotherHelper.exe. Now if Setup.exe is ed it turns out that all other executables, right down the chain, also run elevated. And the nice thing is that you are only asked once for approval to run.Does UAC effect the built-in administrator?No. UAC mode has no effect if you are logged in as the built-in administrator.大意就是说:如果想在vista下边以相应权限(一般都是管理员权限)执行任何程序的时候,就使用这个manifest文件。将这个文件放在目标文件Fred.exe的同目录下边,并以Fred.exe.manifest命名即可。而且呢,vista会自动对文件名中有”setup”, “install”, “update”, “patch”这些关键词的文件提供方便——自动提供高级权限。如果是安装软件的话,只需要对主文件设置相应的manifest即可,其他相关文件会自动提升权限。这个manifest文件不光可以放在外边,而且也可以作文资源,内嵌在执行文件中。不光exe可以内嵌,DLL等也可。