forked from kmeps4/psfree900a
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakeCache.bat
More file actions
35 lines (28 loc) · 794 Bytes
/
MakeCache.bat
File metadata and controls
35 lines (28 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
@echo off
echo CACHE MANIFEST > test0.txt
echo # v2.5.5 Self-Host >> test0.txt
echo. >> test0.txt
set LOC=%~dp0
dir /B /S /A:-D >> test0.txt
findstr /v "media .bat .exe .mp4 offlinexmb.cache test0.txt" test0.txt > test.txt
del test0.txt
@echo off
setlocal enableextensions disabledelayedexpansion
set "search=%LOC%"
set "replace="
set "textFile=test.txt"
for /f "delims=" %%i in ('type "%textFile%" ^& break ^> "%textFile%" ') do (
set "line=%%i"
setlocal enabledelayedexpansion
>>"%textFile%" echo(!line:%search%=%replace%!
endlocal)
setlocal DisableDelayedExpansion
set "firstLineReady="
(for /F "eol=$ delims=" %%a in (test.txt) DO (
if defined firstLineReady (echo()
set "firstLineReady=1"
<nul set /p "=%%a")
) > offlinexmb.cache
del test.txt
echo offlinexmb.cache created!!
sleep 2