I need help understanding this command syntax error

I have no experience with powershell. This command is issued by a python script. It gives an error I don’t understand. Can someone help?

> "C:\Users\mark\.platformio\packages\tool-mklittlefs\mklittlefs" -b 8192 -p 256 --unpack "unpacked_fs" "C:\Users\mark\apps\tiny\downloaded_fs_0x300000_0xfa000.bin"

At line:1 char:65
+ ... sers\mark\.platformio\packages\tool-mklittlefs\mklittlefs" 
-b 8192 -p ...

Mark,
Welcome to the forum. :wave:t4:

I actually wonder why you’re using PowerShell in this case. There is no PowerShell code at all. It’s obviously an external executable with its command line arguments.

It tells you PowerShell cannot parse it. And that’s logic because it is not PowerShell code. You could try to tell PowerShell to stop parsing by adding the stop parsing operator --% right in front of all command line arguments.

I don’t understand what you mean by powershell code. I’m just trying to enter a command line that executes mklittlefs with some params. Isn’t this like a bash command line?

PowerShell is one of the available shells on Windows. It might be easier in your case to use CMD instead.

I’m getting the exact same error in a cmd window. So there is some parsing error in both powershell and cmd. I need help to understand it. Here is the command and result again (some was missing earlier) …/

"C:\Users\mark\.platformio\packages\tool-mklittlefs\mklittlefs" -b 8192 -p 256 --unpack "unpacked_fs" "C:\Users\mark\apps\tiny\downloaded_fs_0x300000_0xfa000.bin"
'-b' is not recognized as an internal or external command,
operable program or batch file.

Are you sure that this is the complete path to the executable you want to run?

BTW: That’s not a PowerShell issue. You may be better off in a Python related forum with “Windows awareness”. :wink:

Yes, I checked the path, it is correct. If I type

"C:\Users\mark\.platformio\packages\tool-mklittlefs\mklittlefs"

I get a help menu from the program mklittlefs so I know it exists and runs. The problem command line is choking on the -b param. Is that not how windows handles params?

That’s not a PowerShell issue

I didn’t claim there was a problem with powershell. I fully understand the command has some syntax problem which is my fault. I ammanually entering this command in powershell, python is not running at all. The command was originally issued by python but I copied it.

Please tell me why it chokes on -b. Thanks in advance.

Usually executables for Windows have an extension. You could try to include that. :wink:

Windows does not handle params at all. CMD does. PowerShell does. Or any other shell you’re using. :wink:

OK. But this is a PowerShell forum. Here we’re focused on helping with PowerShell code. :wink:

I cannot because I don’t know. :man_shrugging:t4:

You could try to use the full parameter names instead … or reorder the parameters …

"C:\Users\mark\.platformio\packages\tool-mklittlefs\mklittlefs" --unpack "unpacked_fs" --block 8192 --page 256 "C:\Users\mark\apps\tiny\downloaded_fs_0x300000_0xfa000.bin"

Thank you ver much for your fast replies. I have tried everything I can think of including your suggestion.

Does anyone else understand windows shell command-line syntax well enough to explain my problem?

You may try StackOverflow and add the CMD tag for your question.

Thx, I’ll do that.

(extra chars to get rid of obnoxios char min)