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 Problem

Empfohlene Antworten

Veröffentlicht

Hi,

Ich habe ein kleines Problem mit ein paar Dateien, sie sehen so aus :

protel.log.06-03-20-12

und sollen nacher so ausehen

protel_log_06_03_20_12

allerdings macht er nach meinem batch Datei aus der Datei diese:

protel_log_.log.06_03_23_06.txt

rename C:\Temp\Logs_log\protel.log.??-??-??-?? protel.log.??_??_??_??.txt

rename C:\Temp\Logs_log\protel.log.*.txt protel_log_*.txt

Weis einer warum er dieses .log. einfach nicht überschreiben will?

Habe auch schon andere Varianten versucht, es läuft immer aufs selbe hinaus.

Ich hoffe einer kann mir helfen :-)

Angenommen du hast die Dateinamen in einer Variable in deiner Batch:


set Logdatei=protel.log.06-03-20-12

Dann kannst du mal folgendes probieren:

for /f %i in (%TEMP%\umbennen.tmp) do set var1=%i && echo %var1:.=_% >%TEMP%\umbennen.tmp


for /f %i in (%TEMP%\umbennen.tmp) do ren %LOGDATEI% %i

Da hab ich gestern was verbockt.

Richtig heisst es so:


set Logdatei=protel.log.06-03-20-12

echo %LOGDATEI% >%TEMP%\umbennen.tmp

for /f %i in (%TEMP%\umbennen.tmp) do set var1=%i && echo %var1:.=_% >%TEMP%\umbennen.tmp


for /f %i in (%TEMP%\umbennen.tmp) do ren %LOGDATEI% %i


Ich weiß nicht wie fit du im "batchen" bist.... falls es so nicht geht melde dich nochmal. dann schauen wir uns das mal genauer an :)

Moin, danke erstmal.

So fit bin ich eben nicht :-)

aber ich habe nun was anderes gefunden, was zumindest mir mal die punkte entfernt.

@echo off & setlocal EnableDelayedExpansion

For %%z in (.) do (

   For /f "delims=" %%i in ('dir /b /A:-d ')  do (

     (echo %%~ni|findstr [%%z]>nul) && Set "oldname=%%~ni" && ren "%%~nxi" "!oldname:%%z=!%%~xi"

))

also ich denke ich bekomms nun hin, mit linux wäre das kein problem gewesen :-)

gruss unimx

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.