Click here to Skip to main content
15,902,198 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I develop 32bit applications with XP. However, recently I attempted to run the application in Vista but discovered vista wouldn't allow my application to write to windows folder neither would it allow me to write to registry. I usually write to HKEY_CURRENT_USER.

Please what must I do so that my application will be able to write to windows directory and especially the registry.
Posted
Comments
Achha Insan 3-Oct-12 5:27am    
nothing is impossible. you can do it.

You need to set the manifest of your application to run with administrator privilege. Assuming you are using Visual Studio, you do this from the project's Properties by selecting Linker -> Manifest File and select requireAdministrator in the UAC Execution Level options drop-down.
 
Share this answer
 
Your application is broken, and you need to fix it. I know this, because I dealt with exactly the same issue. Since I don't know what your application does, all I can suggest is to google windows vista/7 application migration issues. However, I would point you toward:

HRESULT hResult = SHGetFolderPath(NULL, 
  CSIDL_PERSONAL|CSIDL_FLAG_CREATE,   // could also use CSIDL_APPDATA,
                                      // NEVER use CSIDL_COMMON_APPDATA
  NULL, 
  0, 
  szFolderPath);


If you search on the CSIDL flags, you'll learn what you need to do.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900