Probleme bei Leerzeichen im Pfad

Diskutiere Probleme bei Leerzeichen im Pfad im Windows 10 Forum im Bereich Microsoft Community; dSource muss ein Pfad mit einem Abstand sein -> G:\Meine Ablage\git-backup Geht nicht: @echo on setlocal ENABLEDELAYEDEXPANSION set...
M

MS-User

Threadstarter
Dabei seit
20.09.2016
Beiträge
94.184
dSource muss ein Pfad mit einem Abstand sein -> G:\Meine Ablage\git-backup


Geht nicht:





@echo on
setlocal ENABLEDELAYEDEXPANSION
set day=86400
set /a year=day*365
set /a strip=day*7
set dSource=G:\Meine Ablage\git-backup

call :epoch %date%
set /a slice=epoch-strip

for /f "delims=" %%f in ('dir /a-d-h-s /b /s %dSource%') do (
call :epoch %%~tf
rem if !epoch! LEQ %slice% (echo DELETE %%f ^(%%~tf^)) ELSE echo keep %%f ^(%%~tf^)
if !epoch! LEQ %slice% del /f %%f
)
exit /b 0

rem Args[1]: Year-Month-Day
:epoch
setlocal ENABLEDELAYEDEXPANSION
for /f "tokens=1,2,3 delims=-" %%d in ('echo %1') do set Years=%%d& set Months=%%e& set Days=%%f
if "!Months:~0,1!"=="0" set Months=!Months:~1,1!
if "!Days:~0,1!"=="0" set Days=!Days:~1,1!
set /a Days=Days*day
set /a _months=0
set i=1&& for %%m in (31 28 31 30 31 30 31 31 30 31 30 31) do if !i! LSS !Months! (set /a _months=!_months! + %%m*day&& set /a i+=1)
set /a Months=!_months!
set /a Years=(Years-1970)*year
set /a Epoch=Years+Months+Days
endlocal& set Epoch=%Epoch%
exit /b 0



Ebenfalls nicht:


@echo on

setlocal ENABLEDELAYEDEXPANSION

set day=86400

set /a year=day*365

set /a strip=day*7

set dSource="G:\Meine Ablage\git-backup"



call :epoch %date%

set /a slice=epoch-strip



for /f "delims=" %%f in ('dir /a-d-h-s /b /s %dSource%') do (

call :epoch %%~tf

rem if !epoch! LEQ %slice% (echo DELETE %%f ^(%%~tf^)) ELSE echo keep %%f ^(%%~tf^)

if !epoch! LEQ %slice% del /f %%f

)

exit /b 0



rem Args[1]: Year-Month-Day

:epoch

setlocal ENABLEDELAYEDEXPANSION

for /f "tokens=1,2,3 delims=-" %%d in ('echo %1') do set Years=%%d& set Months=%%e& set Days=%%f

if "!Months:~0,1!"=="0" set Months=!Months:~1,1!

if "!Days:~0,1!"=="0" set Days=!Days:~1,1!

set /a Days=Days*day

set /a _months=0

set i=1&& for %%m in (31 28 31 30 31 30 31 31 30 31 30 31) do if !i! LSS !Months! (set /a _months=!_months! + %%m*day&& set /a i+=1)

set /a Months=!_months!

set /a Years=(Years-1970)*year

set /a Epoch=Years+Months+Days

endlocal& set Epoch=%Epoch%

exit /b 0



Auch nicht:


@echo on

setlocal ENABLEDELAYEDEXPANSION

set day=86400

set /a year=day*365

set /a strip=day*7

set dSource=G:\Meine Ablage\git-backup



call :epoch %date%

set /a slice=epoch-strip



for /f "delims=" %%f in ('dir /a-d-h-s /b /s "%dSource%"') do (

call :epoch %%~tf

rem if !epoch! LEQ %slice% (echo DELETE %%f ^(%%~tf^)) ELSE echo keep %%f ^(%%~tf^)

if !epoch! LEQ %slice% del /f %%f

)

exit /b 0



rem Args[1]: Year-Month-Day

:epoch

setlocal ENABLEDELAYEDEXPANSION

for /f "tokens=1,2,3 delims=-" %%d in ('echo %1') do set Years=%%d& set Months=%%e& set Days=%%f

if "!Months:~0,1!"=="0" set Months=!Months:~1,1!

if "!Days:~0,1!"=="0" set Days=!Days:~1,1!

set /a Days=Days*day

set /a _months=0

set i=1&& for %%m in (31 28 31 30 31 30 31 31 30 31 30 31) do if !i! LSS !Months! (set /a _months=!_months! + %%m*day&& set /a i+=1)

set /a Months=!_months!

set /a Years=(Years-1970)*year

set /a Epoch=Years+Months+Days

endlocal& set Epoch=%Epoch%

exit /b 0


Ist denn das wirklich soooooooooooooooooooooooooooooo kompliziert??


Danke für die Feedbacks! ;-)
 
Thema:

Probleme bei Leerzeichen im Pfad

Probleme bei Leerzeichen im Pfad - Ähnliche Themen

BSOD KMODE_EXCEPTION_NOT_HANDLED in PpmPerfSelectProcessorState: Hi everyone! I was asked to investigate a KMODE_EXCEPTION_NOT_HANDLED BSOD on a Windows 10 system. Its current (minimal) configuration is...
BoD (DPC_WATCHDOG_VIOLATION / VIDEO_TDR_FAILURE) due to graphics driver or faulty hardware?: Since quite some time I regularly get BoDs with a DPC_WATCHDOG_VIOLATION (133) and after some driver changes VIDEO_TDR_FAILURE (116)...
Dolby Atmos for Home Theater: So I just had a very nice converastion with one of the MS Support guys again Whats the problem? Well as the Title says: Dolby Atmos for Home...
Error opening ADO Recordset with MSDataShape provider: Since Windows Update 1809 was public for some days, some of our users haved already installed this Windows version. These users are now reporting...
Windows 10 Update 1809 auf 1903 schlägt fehl und System wird zurückgesetzt FM: 0x8007042B - 0x2000D: Hallo, bitte um Mithilfe, leider kann kann ich kein erfolgreiches Systemupadte von Windows 10 1808 auf 1903 durchführen. Fehlermeldung ...

Sucheingaben

free casino slots games

,

buffalo thunder casoino

,

how do you play 3 card poker

,
seattle casinos
, poker for beginners, po4ker for beginners, rich ca7sino, full house casino, full house casifno, video poker trainer, unibet pokger, unibet poker, wyandotte casino, seminole hard rock poker, big fish cIasino facebook, poqker runs, caYsino las vegas, poker face meaning, pokepr face meaning, casino free slots, cawsino free slots, poEker bankroll management, video pokewr trainer
Oben