-1

So I'm working on NBIS. I was trying to use mindtct. It works when I use it for an individual image but when I was trying to run it for a dataset I get this error,

image was unexpected at this time

I've checked online and it says that it needs double % for it to work. I tried that and it still gives me the same errors. The directories are all correct. I'm using Windows 10

@echo off
Rem set the path of the photo directory
Set dirP= C:\Biometric\photos
Rem set the path for the mindtct
Set dirM= "C:\Rel_5.0.0\mindtct\bin\"mindtct.exe
Set image="*.png"
for %%A in image
do(
START dirM dirP C:\Biometric\Data
)
pasha
  • 406
  • 1
  • 4
  • 17
  • 1
    See https://stackoverflow.com/questions/41030190/command-to-run-a-bat-file/41049135#41049135 on how to use variables. – CatCat Jul 28 '18 at 08:23
  • 1
    What did you check online? Apparently a syntax for a different scripting language because I cannot find any examples of using the FOR command like that in a batch file. Open up a cmd prompt and type the command name followed by a /? to get help for any console command. – Squashman Jul 28 '18 at 13:30

1 Answers1

0

There are several flaws in your code:

  • To expand a variable you've to enclose it in % signs (or ! with DelayedExpansion)
  • see syntax of for /? or view http://ss64.com/nt/for.html
  • the start command uses the first argument in double quotes as the window title

@echo off
Rem set the path of the photo directory
Set "dirP=C:\Biometric\photos"
Rem set the path for the mindtct
Set "dirM=C:\Rel_5.0.0\mindtct\bin\mindtct.exe"
Set "image=*.png"
for %%A in (%image%) do START "" "%dirM%" "%dirP%" C:\Biometric\Data