Open Explorer window from Website
Asked Answered
G

1

6

My company has a shared network folder for projects. This folder contains a sub-folder for each of our clients. Each sub-folder contains all the information for the projects done for those clients. Makes sense, yea?

OK.

I have been given a task: When in our company's MS CRM and viewing a client account, allow the user to click a button that will open explorer to the project folder for that account.

Sounds easy.

Did a bit of hunting online. This looks nice: http://blogs.msdn.com/crm/archive/2007/04/18/integrating-windows-explorer-files-and-folders-into-crm-tabs.aspx

It's funky, but it goes waaay beyond the scope of the task I've actually been given. However, my company doesn't use SharePoint (though we have licenses if we need it) and I don't have the time to invest tweaking this solution until it fits our CRM. I just need to open explorer on the client machine and point it at a folder. I want a button that will open explorer. Should be easy! I just want to set up a button in CRM, execute the command to open explorer /root, //server/projects/account, and then move on to more important things.

That said, I don't think like a hacker, so I didn't realize that this was an obvious security exploit that will be blocked most (if not all) of the time. So I gave it a go, but I've been having trouble opening explorer with JavaScript, which I thought would be the quick, easy and painless solution (duh me!)

Is there an easier way to do this than the example I cited above?

Goodoh answered 16/9, 2009 at 5:29 Comment(0)
S
10

Actually if you direct Internet Explorer to a local protocol, network shared folder or ftp server it turns to a file browser. This is automatic and you dont need to do anything other than making the folder you talk about to a network shared folder (via SMB) or FTP server. Just open that address in a new window:

window.open("file://\\192.168.1.10\clients\112");

window.open("ftp://192.168.1.10/clients/112");

either one should work

Salver answered 16/9, 2009 at 5:37 Comment(3)
Damnit! From past experience with browsers, I was assuming this would just bring up an in-browser directory listing - not an explorer window. Answers my question though, so thank'ee! ^_^Goodoh
When i try that it just gives me an error Error: Access to 'file:///' from script denied in Firefox and just Access is denied. in Internet ExplorerPainterly
It was working in 2009, obviously security policies of browsers are much stricter now. You may try to reduce security context for your page in the browser for it to work. But obviously this should be done on every client. However, FTP solution should still work.Salver

© 2022 - 2024 — McMap. All rights reserved.