PowerShell error: Start-Process : A positional parameter cannot be found that accepts argument

  Kiến thức lập trình

very new to PS. I have tried RTFM but I go off in so many tangents. I’m grateful for ideas, pointers etc.

I have four desktop shortcuts, each closely related. I thought I know i’d run a DoS batch file to do them one after the other; that led me to loading up the PS ISE(x86).
Now I have a batch file that calls the PS1. but the script fails.

the code is: Start-Process -FilePath "C:Program FilesFldigi-4.2.05fldigi.exe" --config-dir "C:Usersskthofldigi-configsfldigiIC7300"

This results in the following [is it perhaps the double dash –config ]

Start-Process : A positional parameter cannot be found that accepts argument 'C:Usersskthofldigi-configsfldigiIC7300'.
At line:1 char:2
+  Start-Process -FilePath "C:Program FilesFldigi-4.2.05fldigi.exe"  ...
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Start-Process], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.StartProcessCommand

I found this and others

FullyQualifiedErrorId : PositionalParameterNotFound,Add-DistributionGroupMember
text

but to be honest I don't understand, I have tried many permutations of  quote '   ' "  " and
dashes
 The Desktop Shortcut lnk works fine with 
Target: `"C:Program FilesFldigi-4.2.05fldigi.exe" --config-dir "C:Usersskthofldigi-configsfldigiIC7300"`
Start in: `"C:Program FilesFldigi-4.2.05"`

1

LEAVE A COMMENT