Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1470
  • Last Modified:

BrowseForFolder() raising Permission denied error in XP Internet Explorer

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.
1 Solution
Permission is denied for 2 reasons, licensing and security.
lwordAuthor Commented:
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now