0

I am trying to use a windows utility flash tool St-flash_CLI.exe. This tool needs to be called from a script. St-flash_CLI.exe has multiple input params. One of the params is file path. I want to use a wild card as there are many files to be flashed. The wild card for file name does not work.

St-flash_CLI.exe -c SN=48FF7 -P c:\testing.tes\xyz- * -123.hex

St-flash_CLI.exe -c SN=48FF7 -P "c:\testing.tes\xyz- * -123.hex"

St-flash_CLI.exe -c SN=48FF7 -P 'c:\testing.tes\xyz- * -123.hex'

St-flash_CLI.exe -c SN=48FF7 -P c:\testing.tes\xyz- " * " -123.hex

St-flash_CLI.exe -c SN=48FF7 -P c:\testing.tes\xyz-'*'-123.hex

St-flash_CLI.exe "-c SN=48FF7 -P c:\testing.tes\xyz- * -123.hex"

I have tried above options on CMD and PowerShell. It always says

File not found.

If I give the exact file name like C:\testing.tes\xyz-789-123.hex it always works.

I have already tried with double quotes " and single quotes ' around * in CMD and PS, but none of them worked.

Any clue or what could be done to ensure wildcard works for file path parameter to exe?

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
yk28
  • 25
  • 1
  • 1
  • 7
  • 1
    I can imagine that `St-flash_CLI.exe` won't accept a filename with wildcard. Why not iterate through the files? https://stackoverflow.com/questions/138497/iterate-all-files-in-a-directory-using-a-for-loop – MatSnow Oct 27 '17 at 14:45
  • thanks @MatSnow for the reply. I cannot iterate because these hex files are generated by gitlab CI and from which the numbers generated for these hex files dynamically change. So I require something with * so that I do not bother about these changing numbers everytime. – yk28 Oct 27 '17 at 15:33
  • I think that MatSnow means to iterate over the file names, not the file contents. See `FOR /?` and `FORFILES /?`. – lit Oct 27 '17 at 17:56
  • Yes, i meant to iterate over the file names. Like @lit wrote. – MatSnow Oct 27 '17 at 18:37
  • What does the `"
    ` at the end of each line mean? Is that just some leftover HTML garbage that should not be there? Likewise, the number at the beginning of each line.
    – lit Oct 27 '17 at 19:06
  • Yes
    is leftover HTML garbage. I pasted the lines as a code and not a block.Sorry. Let me see how I can iterate. Thanks.
    – yk28 Oct 27 '17 at 19:23

0 Answers0