I am writing following program :
***import os
filepath=r\'C:\\TestData\\openfolder.html\'
abc=open(filepath,\'w\')
abc.writelines(\'&
Alain's answer works.
<'a href="FOLDER_PATH" target="_explorer.exe">Link Text<'/a>
I removed the tick marks at the beginning and end, and found that it works in
Internet Explorer - opens a Windows Explorer window
Firefox (Windows and Linux), but opens a new tab - same as target="_blank"
Chrome - opens a new tab like Firefox
I also noticed that / and \ (forward and backward slashes) are equal in html links - they can even be mixed.
You can't. Clicking a link to a file in a browser will not launch the application associated with that file type on the OS. You can apparently do some funky stuff with JavaScript to launch particular filetypes with particular applications (see here: http://forums.devshed.com/asp-programming-51/launching-ms-word-to-open-file-from-a-hyperlink-55714.html) but apart from that the web browser is not the file browser.
Try to use URI with file:
scheme like file:///C:/TestData/openfolder.html
in your html:
<a href="file:///C:/TestData/openfolder.html">Link to test data</a>
Here is article on using file URIs in Windows.
UPD (extraction from comments): Each browser has its own way to handle such urls. At least Internet Explorer 8 under Windows 7 opens links in Windows Explorer as was required by jags.
Finally, for dynamic pages the web server is required. If one is needed take a look at discussion on creating simple web services using python.
<a href="FOLDER_PATH" target="_explorer.exe">Link Text</a>
Replace FOLDER_PATH
with the path of the folder you want to open in explorer.