Löschen alter Elemente in Windows Ordner per BatchJanuar 9, 2019/in Basisforfiles -p “C:\ExporteCognos\DonBoscoMission” -s -m *.pdf -d -30 -c “cmd /c del @PATH” Anschließend per Xstream oder TM1 ausführen https://az-con.de/wp-content/uploads/2018/05/az2-300x78.png 0 0 Annett Zausch https://az-con.de/wp-content/uploads/2018/05/az2-300x78.png Annett Zausch2019-01-09 12:40:242019-01-09 12:40:24Löschen alter Elemente in Windows Ordner per Batch
AZConAdmin sagte: November 10, 2021 um 10:37 am Beispiel mit Copy und Rename und Delete del D:\Bursting\FAIP_Standortleiter_BWA\*.pdf xcopy /s \\srv-bicognos-an.towergroup.local\Cognos-Export\FAIP\*.pdf D:\Bursting\FAIP_Standortleiter_BWA @echo off Setlocal enabledelayedexpansion Set “Pattern=_2F” Set “Replace=-” For %%# in (“D:\Bursting\FAIP_Standortleiter_BWA\*.pdf”) Do ( Set “File=%%~nx#” Ren “%%#” “!File:%Pattern%=%Replace%!” ) @echo off Setlocal enabledelayedexpansion Set “Pattern=_7C” Set “Replace=-” For %%# in (“D:\Bursting\FAIP_Standortleiter_BWA\*.pdf”) Do ( Set “File=%%~nx#” Ren “%%#” “!File:%Pattern%=%Replace%!” ) @echo off Setlocal enabledelayedexpansion Set “Pattern=-de-” Set “Replace=-” For %%# in (“D:\Bursting\FAIP_Standortleiter_BWA\*.pdf”) Do ( Set “File=%%~nx#” Ren “%%#” “!File:%Pattern%=%Replace%!” ) del \\srv-bicognos-an.towergroup.local\Cognos-Export\FAIP\*.pdf del \\srv-bicognos-an.towergroup.local\Cognos-Export\FAIP\*.xml EXIT Zum Antworten anmelden
Beispiel mit Copy und Rename und Delete
del D:\Bursting\FAIP_Standortleiter_BWA\*.pdf
xcopy /s \\srv-bicognos-an.towergroup.local\Cognos-Export\FAIP\*.pdf D:\Bursting\FAIP_Standortleiter_BWA
@echo off
Setlocal enabledelayedexpansion
Set “Pattern=_2F”
Set “Replace=-”
For %%# in (“D:\Bursting\FAIP_Standortleiter_BWA\*.pdf”) Do (
Set “File=%%~nx#”
Ren “%%#” “!File:%Pattern%=%Replace%!”
)
@echo off
Setlocal enabledelayedexpansion
Set “Pattern=_7C”
Set “Replace=-”
For %%# in (“D:\Bursting\FAIP_Standortleiter_BWA\*.pdf”) Do (
Set “File=%%~nx#”
Ren “%%#” “!File:%Pattern%=%Replace%!”
)
@echo off
Setlocal enabledelayedexpansion
Set “Pattern=-de-”
Set “Replace=-”
For %%# in (“D:\Bursting\FAIP_Standortleiter_BWA\*.pdf”) Do (
Set “File=%%~nx#”
Ren “%%#” “!File:%Pattern%=%Replace%!”
)
del \\srv-bicognos-an.towergroup.local\Cognos-Export\FAIP\*.pdf
del \\srv-bicognos-an.towergroup.local\Cognos-Export\FAIP\*.xml
EXIT