You cannot do this from a browser. The browser does not allow access to the client in javascript. It will be a gaping security hole.
Microsoft turns this around using Active X. There are other browser plugins that can do the same thing.
Javascript, however, does not work.
source share