SharePoint Blogs / SharePoint University
SharePoint Blogs and SharePoint University - all in one place!
Need SharePoint Training? Attend a SharePoint Bootcamp!

Please delete cookies related to sharepointblogs.com and sharepointu.com to resolve login issues!

Hide Open in windows Explorer options from Action menu

I was looking for JavaScript to hide this "Open in Windows Explorer" for document library. I found quite a few posts with javascript, which I tried and no success. Then I went back to my ideal JavaScript framework J query( Yes I dont like learning all script details when I got J query's accessibility functions) anyway still no luck and then I found this post about hiding "upload Single Documents" options

http://asadewa.wordpress.com/2008/02/23/removing-single-file-upload-menu-from-document-library-toolbar-moss-2007/

And I figured the problem I had with my code. I was not adding the script during the onload event. Anyway below is the modfied code to use for hiding "open in Windows Explorer" and also using spBodyOnLoadFunctionNames  to push Function for onLoad event. 

<script> 

 function GetElementByText(tagName, title)
    {
        var a = document.getElementsByTagName(tagName);

        for (var i=0; i < a.length; i++)
        {
            if (aIdea.text)
            {
                if (aIdea.text === title)
                {
                    return aIdea;
                }
            }
        }

        return null;
    }
function hideWinExp()
{
 var o = GetElementByText("ie:menuitem","Open with Windows Explorer");
            if (o)
            {
                o.disabled = true;
            }
}
_spBodyOnLoadFunctionNames.push("hideWinExp");

</script>
 

Note :

replace  

Idea =  [  i  ]  no spaces or copy it into text file


Posted 07-23-2008 7:12 PM by Bazztrap

Comments

Links (7/24/2008) « Steve Pietrek - Everything SharePoint wrote Links (7/24/2008) &laquo; Steve Pietrek - Everything SharePoint
on 07-24-2008 7:45 PM

Pingback from  Links (7/24/2008) &laquo; Steve Pietrek - Everything SharePoint

Tom.VanGaever wrote re: Hide Open in windows Explorer options from Action menu
on 07-29-2008 5:53 AM

Hi,

I know you can disable this in the schema.Maybe its better to change it there

here's a link to more info:

www.dotnetmafia.com/.../how-to-remove-the-explorer-view-from-a-document-library-template.aspx

Bazztrap wrote re: Hide Open in windows Explorer options from Action menu
on 07-30-2008 5:59 PM

nice I was thinking of creating  Actions template and remove it from there

Sam wrote re: Hide Open in windows Explorer options from Action menu
on 12-18-2008 11:46 PM

Where to put this script ????

Sam wrote re: Hide Open in windows Explorer options from Action menu
on 12-18-2008 11:47 PM

I wanna to know Where should i put this script ???? please explain

Bazztrap wrote re: Hide Open in windows Explorer options from Action menu
on 01-13-2009 10:20 AM

Use content editor web part on the view you want this to be enabled,.

Copy paster code as said above, I think you need to add it below the List View Web paert

sr wrote re: Hide Open in windows Explorer options from Action menu
on 01-16-2009 3:44 PM

awesome --- thats what am loloking for thanks bunch

Tanmay Bari wrote re: Hide Open in windows Explorer options from Action menu
on 01-29-2009 12:10 AM

Perfect Solution Bazztrap. thanks dude !

to be more precise il explain the procedure again

1)Go to the DocLib/List where you want to hide/disable the "Open With Explorer View " option from actions menu.

2)Go to Site Settings>EditPage

3)Add a Webpart.Add a Content Editor Webpart here.

4)Go to Source Editor Option in Webpart after doing "Modify shared Webpart".

5)Paste this code here

<script>

function GetElementByText(tagName, title)

   {

       var a = document.getElementsByTagName(tagName);

       for (var i=0; i < a.length; i++)

       {

           if (aIdea.text)

           {

               if (aIdea.text === title)

               {

                   return aIdea;

               }

           }

       }

       return null;

   }

function hideWinExp()

{

var o = GetElementByText("ie:menuitem","Open with Windows Explorer");

           if (o)

           {

               //o.disabled = true;

               o.hidden=true;

}

}

_spBodyOnLoadFunctionNames.push("hideWinExp");

</script>

6)Then Apply and Ok

The code will come into effect instataneously and you will no longer see the "open with Explorer view " option.

Tanmay Bari wrote re: Hide Open in windows Explorer options from Action menu
on 02-04-2009 6:43 AM

One more thing,the solutionn works for Satndard view,but when i go for "Edit in DataSheet" , the "Open In Windows Explorer" seems to reappear.Has anyone found a solution to completely hide "Open in Windows Explorer" totally?

Bazztrap wrote re: Hide Open in windows Explorer options from Action menu
on 02-26-2009 12:48 PM

Check that forum to disable web dav compeltly on a farm

social.technet.microsoft.com/.../023f4b23-3ce6-4d83-8cb0-7398b88ba6ab

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Need SharePoint Training? Attend a SharePoint Bootcamp!
Posts (c) their respective authors. Everything else (c) 2009 SharePoint Experts, Inc.