Hi.

I am unable to create file object from javascript in Vista platform.

ex. i am using this statement javascript

var oFso = new ActiveXObject("Scripting.FileSystemObject");

after executing this and make try catch block for this i am getting this error "Automation object can't create object".


I have enabled some options in tools-> internet options ->Security -> custom levels options.

same error i am able to solve on XP machine by above settings.

please suggest the solution for the above problem.

With regards,
Virendra

Dani AI

Generated

Short answer: this is a platform/security difference, not a bug in your script. On Vista Internet Explorer runs with User Account Control and a Protected Mode (low-integrity) sandbox that prevents web pages in higher-risk zones from instantiating COM objects that access the local file system. That is why behavior that could be changed on XP by adjusting browser security no longer works the same way on Vista.

Safe, practical options:

  • Run the logic outside the browser (an HTA or a .vbs executed by Windows Script Host) so it runs with normal desktop privileges.
  • If this must be a browser solution inside a controlled environment, deliver a signed, installable client component (ActiveX or native helper) and deploy it via Group Policy to the machines that need it.
  • For short-term testing only, running IE elevated or hosting the page in a lower-security zone will change the result, but do not leave those changes enabled for normal browsing.

Quick troubleshooting checklist:

  • Confirm Protected Mode and UAC are the limiting factor by running the same HTML as an HTA or via WSH; if it works there, the browser sandbox is the cause.
  • On 64-bit Vista, check the bitness: a 32-bit COM object will fail if IE is running 64-bit.
  • Verify the COM object is properly registered for the bitness you are testing.
  • Avoid permanently loosening Internet-zone ActiveX settings; that creates a major security risk.

This ties back to what , and observed: the fix that worked on XP (changing browser security) is ineffective on Vista because of the design changes in the browser/OS security model.

I am facing the same problem in Vista while using the ActiveXObject function.. Can you please help me

Regards
Satish

probably u need to put url into trusted sites

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.