I have a script like this:
REM *** Define DUCKY drive as %duck%
STRING for /f %d in ('wmic volume get driveletter^, label ^| findstr "DUCKY"')
do set duck=%d
ENTER
with more code (which isn't important for now) saved to the USB Rubber Ducky. But when it runs, command prompt reads it as:
for /f %d in ('wmic volume get driveletter^, label ^| findstr @DUCKY@') do
set duck=%d
with @DUCKY@ instead of "DUCKY". How can I escape the double quotes ("") character?
In this case, the quotes are superfluous. The utility findstr
will accept a non-quoted string as a parameter. Thanks @Goodies