Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Rechnen im Batchscript (mit set /a) folgender Fehler erscheint->

Empfohlene Antworten

Hallo,

in den Zeilen die mit @set beginnen, kommt folgender Fehler:

Invalid number. Numeric constants are either decimal (17), hexadecimal (0x11), or octal (021).

Ich hab jetzt schon mit google gesucht, allerdings nichts gefunden an was das liegen könnte. auch set /? hat mir nicht geholfen... in myjahr steht 2006 in mymonat 08 und in mytag 29.

@echo off

REM Datum auslesen

@for /F "tokens=1,2,3 delims=." %%a in ('date /T' ) do @set MYMONAT=%%b

@for /F "tokens=1,2,3 delims=." %%a in ('date /T' ) do @set MYJAHR=%%c

@for /F "tokens=1,2,3 delims=." %%a in ('date /T' ) do @set MYTAG=%%a

@for /F "tokens=1,2,3 " %%a in ('@echo %MYJAHR%') do @set MYJAHR=%%a

echo %myjahr%%mymonat%%mytag%

IF MYMONAT LEQ 3 (

@set /a MYMONAT = %MYMONAT% + 9

@set /a MYJAHR = %MYJAHR% - 1

) else (

@set /a MYMONAT = %MYMONAT% - 3

)

heyho...

also, das Problem ist die führende 0 bei der Variablen MYMONAT hab ich mittlerweile rausgefunden. Die 0 hab ich mitlerweile entfernt, brauche sie aber später wieder für ein anderes script, da dies das Datum als YYYYMMDD formatiert haben will. hat jemand eine Idee wie ich die führende 0 wieder bekomme?! :)

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.