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.

Batch Wort-Abfrage

Empfohlene Antworten

Veröffentlicht

Guten Tag,

ich habe folgendes Problem, ich habe eine Batch geschrieben, bin aber iwie. zu blöd eine Abfrage zuschreiben welche schaut ob mein Copyright dort enthalten ist.

wenn nicht in :Exit springt, und ansonsten weiter macht.

Wäre gut wenn man dafür keine extra Datei brauchen würde sondern einfach in die bereits vorhandene Batch mit integrieren kann.

Danke im Voraus.

@echo off

title © by Illegal (Akubis Sync-Batch)

set standort=bllllaaaaa

echo.

set User=Administrator

set Passwort=geheim

if exist f:\NUL net use f: /delete

net use f: \\xxx.xx.xx.xx\akubis /USER:%User% %Passwort%

ping -n 2 127.0.0.1 > NUL

echo.

if exist g:\NUL net use g: /delete

net use g: \\xx.xx.xx.xx\backup

ping -n 2 127.0.0.1 > NUL

echo.

set zquelle=f:\

set zkopie=g:\

set zmodus=2

set startdatum=%date%

set zeit=%time:~0,2%:%time:~3,2%:%time:~6,2%

FOR %%A in (0 1 2 9) DO IF (%%A)==(%zmodus%) set zbatch=1

if (%zbatch%)==() set zmodus=

set ztmp=

set ZJN=

set zf=0

doskey j= > NUL

doskey n= > NUL

doskey 0= > NUL

doskey 1= > NUL

doskey 2= > NUL

color F1

cls

mode con cols=120

...........

...................

___________________________

ich will das so haben, wenn also mein Name "Illegal" gelöscht oder nicht mehr vorhanden ist, das das Script abbricht ;-), und ansonsten weiterläuft

Danke

Idee: In einer FOR-Schleife die Datei öffnen (über den Basename) und dann die zweite Zeile auslesen und mittels IF-Abfrage auf deine Gültigkeit überprüfen.

P.S.: Die ganze Idee ist Quatsch. Wenn ich den Copyright-Hinweis entfernen kann, dann kann ich auch direkt die Zeilen entfernen, die den Copyright-Hinweis überprüfen. (Außer man bastelt das um mittels batch2exe-Converter.)

Bearbeitet von lupo49

Hallo,

ein Zusatz Programm will ich dafür nicht verwenden :-)

hast du vllt. ein Beispiel Code dafür?

danke

Macht 10 €.


@echo off

setlocal ENABLEDELAYEDEXPANSION

rem blablacopyright


set basename=%0


FOR /F "tokens=1,2 skip=2 delims=:" %%i IN ('findstr /n $ %basename%') DO (

	if %%i==3 (

		IF "%%j"=="rem blablacopyright" (

			goto :cont

		) ELSE (

			goto :eof

		)

	)

)


:cont

echo Weitermachen...


:eof

Klappt wunderbar, Vielen Dank

Hast was gut bei mir :D

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

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.