marsu2
Goto Top

If else mit sprungmarke

HI ich hatte hier schon mal wegen der Berechnung eines Wochentages nachgefragt: Wochentag.bat

nun würde ich gerne für ein anderes Script herausfinden ob Tag1 oder Tag 2 ist.

Mein Versuch ist:
if %dow% neq 3 (goto sonntag) Else goto download     

:sonntag 
if %dow% neq 7 (goto :eof) Else goto download   

:download
wget 

Wahrscheinlich bin ich einfach zu doof aber ich verstehe nicht wirklich warum das nicht funktioniert?

Content-Key: 174303

Url: https://administrator.de/contentid/174303

Printed on: April 16, 2024 at 17:04 o'clock

Member: bastla
bastla Oct 07, 2011 at 14:50:23 (UTC)
Goto Top
Hallo marsu2!

Abgesehen von der Variante
if %dow% neq 3 (goto sonntag) Else (goto download)
ließe sich das auch ohne "else" lösen:
if %dow% equ 3 goto download     

:sonntag 
if %dow% neq 7 goto :eof   

:download
wget
oder noch kürzer:
if %dow% neq 3 if %dow% neq 7 goto :eof  

:download
wget
Grüße
bastla