Prev Previous Post   Next Post Next

How to open a file for read/write access in Program Files directory

Posted: 02-26-2007, 05:40 PM
Hi,

How should I open a file in the Program Files directory for read/write
access?

In Vista Business 32-bit as administrator with UAC turned on, the OpenFile
API call fails when trying to open a file for read/write in the Program
Files directory. The call is

OpenFile(FileName, &OpenBuff, OF_READWRITE);

returning HFILE_ERROR.

When accessing the file with Explorer, I can do anything I want with the
file.

Should I be using CreateFile with certain parameters instead of OpenFile?


Reply With Quote

Responses to "How to open a file for read/write access in Program Files directory"

 
LinkBack Thread Tools Display Modes
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying files to Program Files directory Parrot Windows Vista File Management 13 08-23-2007 07:14 AM
File permissions in the Program Files directory kevincc Windows Vista Administration 3 05-02-2007 06:36 PM
Write file is access denied. hsphuah@usa.com Windows Vista File Management 1 07-04-2006 03:14 AM
TD Fails to open SLX files with an '&' in a directory name Tim Houle Windows XP Embedded 3 09-13-2004 07:38 PM
Program File Directory Windows XP Games 0 08-19-2003 06:51 PM