Hello, I had an idea that's goes like this:
Say I have a USB connected to my PC and on the windows explorer it's identified as G: SanDisk
I want to have a measure that checks the name of the drive G and match it with a set string. So if I have a variable access=SanDisk and then a measure like
[MeasureString]
Measure=Plugin
Plugin=Sysinfo
(Insert code that gets the name of the drive G here)
OnupdateAction=[!SetVariable connected [MeasureString] ]
[MeasureCheck]
Measure=String
String=#connected#
IfMatch=#access#
IfMatchAction=[!DoSomething]
IfNotMatchAction=[!DoSomethingElse]
Now this obviously doesn't work for the main reason being that I don't know the syntax to get the name of the connected USB. How could I do that, if possible?
-Thabks in advance and I hope I'm being understandable.
Last edited by kyriakos876 on April 16th, 2018, 1:05 am, edited 1 time in total.
and I see your solution. It just happens that FreeRaider's solution better fits my case as it works with any drive letter... so if I have my usb at the E: port for example, it will still work. (I didn't mention I wanted that because I didn't know I did until I needed it that ^_^ ) as this is going to be used like a "Lock USB" that when remove locks the PC and when inserted unlocks it, you can't always know it's going to be in the G letter.