WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Vista

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Problem Using IniWritePvt on Vista

 Keywords: IniWritePvt IniWrite INI Vista 64 UAC VirtualStore

Question:

I’m running a WinBatch program under Vista (compiled with WinBatch 2008c). I need to be able to write to some ini files (using the IniWritePvt function). Everything works fine when the UAC is turned off but when the UAC is turned on, nothing is being written. The .ini files are under ShortCutDir( 'AppData', 0, 0 ).
The code is signed.
Requested Execution Level: asInvoker
uiAccess Flag: false
I am passing a full file path to the inifile name parameter of IniWritePvt. Any suggestions? Thanks.

Answer:

I would recommend writing a maybe 10-line script that demonstrates the problem.

Make sure there is a DebugTrace line at the top to enable the debugging output. Use the same ShortCutDir to help build the ini file name. And show the ini file name in a message box to help verify what it turns out to be.

Post results, including test script, and debugtrace of a failing script, as well as Admin status of user.

Perhaps repeat test for Admin level user, even perhaps for UAC execution levels of Administrator required and highestAvailable.

I think something in the chain of events requires that full Admin privilege required, but your explanation of the problem makes me think that should no be so.

User Reply:

I just deleted the existing ini files and created the files with UAC enabled and everything works.

Answer:

It sounds like the Vista VirtualStore is getting involved here. Anytime that an application located under "\Program Files" or "\Program Files (x86)", or "\Windows" attempts to write to a .INI file in either of the programs or windows folder hierarchies, and UAC is enabled, Vista silently redirects the write operations to the "AppData\Local\VirtualStore" subfolder under the current user's profile folder. Thus, each user gets their own per-profile private copies of all the .INI files that the application was attempting to write to in a common location.

This can lead to all sorts of "weirdness" in application behavior if the application was expecting the content of the .INI files to remain constant regardless of which user was logged on & running the application.


Article ID:   W18430
Filename:   Problem Using IniWritePvt on Vista.txt
File Created: 2008:10:06:08:23:16
Last Updated: 2008:10:06:08:23:16