I'm trying to run a batch file to map the printers for users based on the IP address of their machine.
Here's the code and the "Else wasn't expected" error.
for %a in (50,51) do ( IPConfig|FindStr/IRC:"IPv4.*: 10\.0\.%a\.*">Nul 2>&1 && call \\domain\netlogon\sydprintmap.bat
More? ) else (
else was unexpected at this time.
goto Mel )
:Mel
for %a in (0,5,1) do ( IPConfig|FindStr/IRC:"IPv4.*: 10\.0\.%a\.*">Nul 2>&1 && call \\domain\netlogon\melprintmap.bat
More? ) else (
else was unexpected at this time.
goto Wyn )
:Wyn
for %a in (60) do ( IPConfig|FindStr/IRC:"IPv4.*: 10\.0\.%a\.*">Nul 2>&1 && call \\domain\netlogon\wynprintmap.bat
More? ) else (
else was unexpected at this time.
goto Adl )
:Adl
for %a in (100) do ( IPConfig|FindStr/IRC:"IPv4.*: 10\.0\.%a\.*">Nul 2>&1 && call \\domain\netlogon\adlprintmap.bat
More? ) pause Press any key to continue . . .
Why Else is not expected ? I don't see anything wrong.
Thanks
Aucun commentaire:
Enregistrer un commentaire