Windows Vista not allowed to write file on C:\Users folder
-
Hi , I have created one ATL COM add ons for IE which write file on C:\users\sample.txt path. When i run application on my machine(Vista) then it writes files as correctly, but when I run application of another vista machine ,file is not written. Is there any setting in Vista which allow to write file on C:\users folders. Thanks ABM
-
Hi , I have created one ATL COM add ons for IE which write file on C:\users\sample.txt path. When i run application on my machine(Vista) then it writes files as correctly, but when I run application of another vista machine ,file is not written. Is there any setting in Vista which allow to write file on C:\users folders. Thanks ABM
It sounds to me as if the second machine has Internet Explorer running in protected mode. If this is the case then you will need to instead write your files into the FOLDERID_LocalAppDataLow special folder.
PWSTR pszPath[1]; HRESULT hr = SHGetKnownFolderPath(FOLDERID_LocalAppDataLow,KF_FLAG_NO_ALIAS | KF_FLAG_DONT_VERIFY,NULL,pszPath); //Do something with path CoTaskMemFree(*pszPath);
Understanding and Working in Protected Mode Internet Explorer[^] Best Wishes, -David Delaune -
It sounds to me as if the second machine has Internet Explorer running in protected mode. If this is the case then you will need to instead write your files into the FOLDERID_LocalAppDataLow special folder.
PWSTR pszPath[1]; HRESULT hr = SHGetKnownFolderPath(FOLDERID_LocalAppDataLow,KF_FLAG_NO_ALIAS | KF_FLAG_DONT_VERIFY,NULL,pszPath); //Do something with path CoTaskMemFree(*pszPath);
Understanding and Working in Protected Mode Internet Explorer[^] Best Wishes, -David Delaune -
Both machin have protected mode ON. But on other machin File is not written. Is there any other reason behind this? abm
am 2009 wrote:
Is there any other reason behind this?
If the GetLastError Function[^] is telling you Error 5 (Access Denied) then I would suggest redesigning your application so it can operate in a least-privilege environment. Why do you need to write to the C:\Users folder? In my opinion applications should not be attempting to write into this folder. Best Wishes, -David Delaune
-
am 2009 wrote:
Is there any other reason behind this?
If the GetLastError Function[^] is telling you Error 5 (Access Denied) then I would suggest redesigning your application so it can operate in a least-privilege environment. Why do you need to write to the C:\Users folder? In my opinion applications should not be attempting to write into this folder. Best Wishes, -David Delaune