Kenny,
I would include an IOSTAT= in the open and write. This might give some more information. Also a simple program like Wilfred's would be a useful test options.
I am finding a lot of difficult restrictions with Windows 7 to 'System' directories, like C:\ and C:\WINDOWS.
The latest I found was I could not copy a file to C:\ from a network directory, but could from c:\temp, after confirming that I want to !! From this it appears that Win7 treats network directories differently from local directories, which might give you some clue.
It gets annoying that there are all these restrictions, even when I have administrator rights.
Have you located the virtual directory for restricted files ?
\Users\<your name>\AppData\Local\VirtualStore\Windows/sdbg.ini
Work arounds appear to be there but do imply different program settings for XP and Win7
John