0

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?

M. Simon
  • 101
  • 1
  • 2
  • 14
  • In this case, the quotes are superfluous. The utility `findstr` will accept a non-quoted string as a parameter. – Goodies Nov 15 '17 at 18:35

2 Answers2

1

while the Findstr will accept a non-quoted string, I believe you can use the \" as an escape character. It seems to work on BashBunny.

FYI I just posted on the forums a way to grab USB drive letter and assign it to %DRIVE% and use it to call something off the USB.

Acapulco
  • 3,373
  • 8
  • 38
  • 51
manta ray
  • 11
  • 1
0

In this case, the quotes are superfluous. The utility findstr will accept a non-quoted string as a parameter. Thanks @Goodies

M. Simon
  • 101
  • 1
  • 2
  • 14