BrowseForFolder() raising Permission denied error in XP Internet Explorer

Posted on 2006-05-26
Last Modified: 2008-01-09
function fnGetMyPathJ(formObj)
      var oShell = new ActiveXObject("Shell.Application");
      var oFolder = new Object;                        
      oFolder = oShell.BrowseForFolder(0, "Choose a folder", 0);
      if(oFolder!= null)
            var oFolderItem = new Object;          
            oFolderItem = oFolder.Items().Item();
            pathValue =oFolderItem.Path;
            folder_remotePath  =pathValue;

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

                  var WshNetwork = new ActiveXObject("WScript.Network");
                  var oDrives =new Object;
                  oDrives = WshNetwork.EnumNetworkDrives();

                        if (oDrives.Item(i) == fso.GetDriveName(fso.GetAbsolutePathName(pathValue)))
                              remotePath= oDrives.Item(i+1);
                              drivePath= oDrives.Item(i);
My OS is XP. The above code is working in visual interdev but not in IE . It is raising PERMISSION DENIED error. In 2000 it is working fine.
Question by:lword
    LVL 10

    Accepted Solution

    Permission is denied for 2 reasons, licensing and security.

    Author Comment

    Its because of security.

    To over come this please do the following
    Go to Internet options->security Tab->Custom level->Initialise and script activeX control not marked as safe: Enable


    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    I had to do a bit of research to find the answer to this question so I thought I'd share my results.  Due to our outdated mainframe systems, we need to downgrade IE9 to IE8 in order to stay compatible.  We also needed to downgrade Java.  In order to…
    Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
    This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
    This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now