I'm currently creating a small backup utility in JavaScript (running locally from a .js file, not in a browser) than continuously scans for removable devices and makes backups of them. It's basically finished, but I'm unsure how to scan for removable devices. How do I query for removable devices in a for-loop?
Asked
Active
Viewed 61 times
1 Answers
0
Unless you are talking about NodeJS, I do not think that this is possible. Javascript is a client-side language, not a server-side language.
Take a look at NodeJS and this library: https://github.com/nonolith/node-usb. That should put you on the right track.

camrymps
- 327
- 3
- 11
-
Thanks for the link. I'm sure that it works though, I've actually found a malicious JS worm (Proslikefan) that does so. Here's a link - https://johannesbader.ch/2016/06/proslikefan/ – Jul 26 '16 at 18:39
-
It looks like ActiveX is the key to making this work, at least in Javascript. ActiveX is how you access the local system. In this example, an Excel spreadsheet is modified and saved using Javascript's ActiveX object: https://msdn.microsoft.com/en-us/library/7sw4ddf8(v=vs.94).aspx – camrymps Jul 26 '16 at 19:14
-
This link may also be of use: http://stackoverflow.com/questions/6742848/is-it-possible-to-access-local-file-via-javascript – camrymps Jul 26 '16 at 19:16
-
I'm looking for a JS translation from the VBS code `for each drive in fso.drives`, do you know what I mean? – Jul 26 '16 at 19:57