Home » Questions » Computers [ Ask a new question ]

Give the path to the inserted USB key to a script

Give the path to the inserted USB key to a script

I'd like to run a given Perl script whenever I connect my camera to my PC, so that this script will download all the photos on it. But as the drive letter for the camera may change depending on what's already connected, I need to pass this drive letter as an argument to the script.

Asked by: Guest | Views: 36
Total answers/comments: 1
Guest [Entry]

"As I wrote in your other question for this problem also USBDLM could be the solution. E.g. it could start your photo sync tool on connect or any script you like.

You can use the %DriveLetter% variable to be passed to your script. Here is an example configuration section:

[OnArrival1]
open=your_script.bat %DriveLetter%

See the documentation for details (the included Windows documentation is much more readable)."