PDA

Показать полную графическую версию : Проверка на наличие папок в директории


feAre
16-11-2013, 16:09
Есть папка "A" (представлена как переменная %sFolder%), нужно чтобы батник искал в папке "A", папки: "B" , "C", "D", "E" и определенные файлы.
Если папка какая-та не найдена, чтобы в батнике (echo) было написано:
ПАПКА B НЕ НАЙДЕНА.

а если допустим Б не найдено, а следующая папка С найдена, писалось (echo):
ПАПКА С НАЙДЕНА.

Коротко говоря, требуется батник который будет искать определенные папки, и определенные файлы в каждых из этих папок.
При удачном нахождении и при неудаче будет писаться в батнике информация что найдено, или же не найден, тобишь.
echo ПАПКА НАЙДЕНА...
echo Проверка файлов в ней....
echo В ПАПКЕ "B" ОТСУТСТВУЕТ ФАЙЛ "settings.dff" , "develop.ini"
echo Проверка папки C...
echo В ПАПКЕ "C" ВСЁ НА МЕСТЕ.

Буду очень благодарен, заранее спасибо.

Iska
16-11-2013, 16:20
Правьте по своему разумению:
@echo off
setlocal enableextensions enabledelayedexpansion

set sRootFolder=E:\Песочница\0331

if exist "%sRootFolder%\." (
for %%i in ("B" "C" "D" "E") do (
if exist "%sRootFolder%\%%~i\." (
echo Folder [%%~i] exists.

for %%j in ("settings.dff" "develop.ini") do (
if exist "%sRootFolder%\%%~i\%%~j" (
echo File [%%~j] found in folder [%%~i].
) else (
echo File [%%~j] not found in folder [%%~i].
)
)
) else (
echo Folder [%%~i] not found.
)
)
) else (
echo Can't find root folder [%sRootFolder%].
)

endlocal
exit /b 0


echo В ПАПКЕ "C" ВСЁ НА МЕСТЕ. »
Вместо этого я бы просто не выводил имена файлов и папок, которые «на месте». Это проще.

feAre
16-11-2013, 16:29
Кстати да, так лучше.
Лучше просто писать echo при нахождении ошибки какой-то.

feAre
16-11-2013, 17:02
Спасибо большое.
Решено.

Ой, тфу, забыл дополнить, извините.

Как переделать чтобы "settings.dff" , "develop.ini" искалось только в папке "B"
а ещё "1.txt" , "2.txt" искалось только в папке C

Iska
16-11-2013, 18:45
feAre, огласите весь список файлов.

feAre
16-11-2013, 19:20
Папка B
Файлы: "settings.dff" , "develop.ini"

Папка C:
Файлы: "1.txt" , "2.txt"

Папка D:
Файлы: "2.png", "2.png"

Папка E:
Файлы: "5.mp3" , "6.mp3"

И в корневой папке (%sFolder%)
"crashchecker.exe" , "ccsa.ini"

Iska
16-11-2013, 19:41
feAre, тогда только последовательно:
@echo off
setlocal enableextensions enabledelayedexpansion

set sFolder=E:\Песочница\0331

call :CheckFolderAndFiles "%sFolder%" "crashchecker.exe" "ccsa.ini"
call :CheckFolderAndFiles "%sFolder%\B" "settings.dff" "develop.ini"
call :CheckFolderAndFiles "%sFolder%\C" "1.txt" "2.txt"
call :CheckFolderAndFiles "%sFolder%\D" "2.png" "2.png"
call :CheckFolderAndFiles "%sFolder%\E" "5.mp3" "6.mp3"

endlocal
exit /b 0

:CheckFolderAndFiles
setlocal enableextensions enabledelayedexpansion

set sFolder=%~1
if not exist "%sFolder%\." echo Folder [%sFolder%] not found.& goto :eof
:Repeat
set sFile=%~2

if not defined sFile goto :eof
if not exist "%sFolder%\%sFile%" echo File [%sFile%] not found in folder [%sFolder%].

shift /2
goto :Repeat

endlocal
exit /b 0


Папка D:
Файлы: "2.png", "2.png" »
Это как понимать?

feAre
16-11-2013, 19:44
опечатка.
хотел на три нажать, нажал на два.

Спасибо большое.

feAre
18-11-2013, 19:25
Каким-то образом появилась проблема.

call :CheckFolderAndFiles "%sFolderName%\models\txd\" "intro1.txd" "intro2.txd"

ищет только %sFolderName%, а не директорию в целом.

Iska
19-11-2013, 00:15
ищет только %sFolderName%, а не директорию в целом. »
Вопрос не понятен. Поясните.

feAre
19-11-2013, 01:51
call :CheckFolderAndFiles "%sFolderName%\models\txd\" "intro1.txd" "intro2.txd"

Ищет только в корневой папке. (%sFolderName%), а не (%sFolderName%\models\txd\).

т.е. он не ищет в папке "\models\txd\", он ищет просто в корневой папке %sFolderName%

Iska
19-11-2013, 12:52
feAre, приведите весь используемый Вами код. Ибо в моём коде (http://forum.oszone.net/post-2256021.html#post2256021) нет переменной окружения «sFolderName», а есть только переменная окружения «sFolder».

feAre
19-11-2013, 15:21
for /f "tokens=2 delims=:" %%i in ('chcp') do (
set sPrevCP=%%i
chcp 1251 >nul
)

for /f "usebackq delims=" %%i in (
`@"%systemroot%\system32\mshta.exe" "javascript:var objShellApp = new ActiveXObject('Shell.Application');var Folder = objShellApp.BrowseForFolder(0, 'Укажите корневую папку игры (где лежит gta_sa.exe)',1, '::{20D04FE0-3AEA-1069-A2D8-08002B30309D}');try {new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).Write(Folder.Self.Path)};catch (e){};close();" ^
1^|more`
) do set sFolderName=%%i

chcp %sPrevCP% >nul

if defined sFolderName (
if exist "%sFolderName%\." (
if exist "%sFolderName%\gta_sa.exe" (
Call :ColorText "ИГРА УСПЕШНО НАЙДЕНА В УКАЗАННОЙ ДИРЕКТОРИИ!" "0a" "center"
Call :ColorText "Подождите... Идет проверка на наличие ошибок..." "0f" "center"
Call :ColorText "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" "0e" "center"
Call :ColorText "Этап 1 Проверка на наличие папок и файлов." "0f" "left"
) else (
Call :ColorText "ОШИБКА! ИГРА НЕ НАЙДЕНА В УКАЗАННОЙ ДИРЕКТОРИИ!" "ec" "center"
)
) else (
echo Not found folder [%sFolderName%]
)
) else (
Call :ColorText "ОШИБКА! ВЫ НЕ УКАЗАЛИ ДИРЕКТОРИЮ!" "ec" "center"
)

setlocal enableextensions enabledelayedexpansion

call :CheckFolderAndFiles "%sFolderName%" "gta_sa.exe" "bass.dll" "eax.dll" "msvcr100d.dll" "ogg.dll" "vorbis.dll" "vorbisFile.dll" "vorbisHooked.dll" "mouse.png" "samp.exe" "samp.dll" "samp.saa" "samp_debug.exe" "sampaux3.ttf" "sampgui.png" "gtaweap3.ttf"
call :CheckFolderAndFiles "%sFolderName%\anim\" "anim.img" "cuts.img" "ped.ifp"
call :CheckFolderAndFiles "%sFolderName%\audio\" "SFX" "streams" "CONFIG"
call :CheckFolderAndFiles "%sFolderName%\data\" "Decision" "Icons" "maps" "Paths" "script" "animgrp.dat" "animviewer.dat" "ar_stats.dat" "carcols.dat" "cargrp.dat" "carmods.dat" "clothes.dat" "Audioevents.txt" "CN.txt" "default.dat" "default.ide" "fonts.dat" "furnitur.dat" "gridref.dat" "gta.dat" "gta_quick.dat" "handiling.cfg" "info.zon" "main.sc" "map.zon" "melee.dat" "numplate.dat" "object.dat" "ped.dat" "pedgrp.dat" "peds.ide" "pedstats.dat" "polydensity.dat" "popcycle.dat" "procobj.dat" "shopping.dat" "statdisp.dat" "surface.dat" "surfaud.dat" "surinfo.dat" "timecyc.dat" "plants.dat" "timecyc.aaaa" "timecycp.dat" "txdcut.ide" "vehicles.ide" "water.dat" "water1.dat" "weapon"
call :CheckFolderAndFiles "%sFolderName%\data\script\" "main.scm" "script.img"
call :CheckFolderAndFiles "%sFolderName%\data\icons\" "bin.ico" "saicon2.ICN" "saicon3.ICN" "saicon.ICN"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\" "carrec.img" "NODES0.dat" "NODES1.dat" "NODES2.dat" "NODES3.dat" "NODES4.dat" "NODES5.dat" "NODES6.dat" "NODES7.dat" "NODES8.dat" "NODES9.dat" "NODES10.dat" "NODES11.dat" "NODES12.dat" "NODES13.dat" "NODES14.dat" "NODES15.dat" "NODES16.dat" "NODES17.dat" "NODES18.dat" "NODES19.dat" "NODES20.dat" "NODES21.dat" "NODES22.dat" NODES23.dat" "NODES24.dat" "NODES25.dat" "NODES26.dat" "NODES27.dat" "NODES28.dat" "NODES29.dat" "NODES30.dat" "NODES31.dat" "NODES32.dat" "NODES33.dat" "NODES34.dat" "NODES35.dat" "NODES36.dat" "NODES37.dat" "NODES38.dat" "NODES39.dat" "NODES40.dat" "NODES41.dat" "NODES42.dat" "NODES43.dat" "NODES44.dat" "NODES45.dat" "NODES46.dat" "NODES47.dat" "NODES48.dat" "NODES49.dat" "NODES50.dat" "NODES51.dat" "NODES52.dat" "NODES53.dat" "NODES54.dat" "NODES55.dat" "NODES56.dat" "NODES57.dat" "NODES58.dat" "NODES59.dat" "NODES60.dat" "NODES61.dat" "NODES62.dat" "NODES63.dat" "ROADBLOX.dat" "spath0.dat" "tracks.dat" "tracks2.dat" "tracks3.dat" "tracks4.dat" "train.dat" "train2.dat"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\Decision\" "BLANK.ped" "Cop.ped" "FLAT.ped" "GangMbr.ped" "GROVE.ped" "Indoors.ped" "m_empty.ped" "m_infrm.ped" "m_norm.ped" "m_std.ped" "m_tough.ped" "m_weak.ped" "MISSION.ped" "PedEvent.txt"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\Decision\Allowed\" "Cop.ped" "Fireman.oped" "GangMbr.ped" "Indoors.ped" "m_empty.ped" "m_norm.ped" "m_plyr.ped" "m_steal.ped" "m_tough.ped" "m_weak.ped" "R_Norm.ped" R_TOugh.ped" "R_Weak.ped" "RANDOM.ped"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\Decision\andyd\" "ADtemp.ped"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\Decision\chris\" "maf6.ped" "ryder3.ped"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\Decision\ChrisM\" "CMblnk.ped" "m_std.cm.ped"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\Decision\Craig\" "crack1.ped"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\Decision\david\" "dam_sec.ped" "hei2_sc.ped"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\Decision\Imran\" "sci1_is.ped" "std1_is.ped" "std2_is.ped"
call :CheckFolderAndFiles "%sFolderName%\data\maps\" "Audiozon.ipl" "cull.ipl" "occlu.ipl" "occluint.ipl" "occluLA.ipl" "occlusf.ipl" "occluveg.ipl" "paths2.ipl" "paths3.ipl" "paths4.ipl" "paths5.ipl" "paths.ipl" "tunnels.ipl" "txd.ide"
call :CheckFolderAndFiles "%sFolderName%\data\maps\country\" "countn2.ide" "countn2.ipl" "countrye.ide" "countrye.ipl" "countryN.ide" "countryN.ipl" "countryS.ide" "countryS.ipl" "countryW.ide" "countryw.ipl" "counxref.ide"
call :CheckFolderAndFiles "%sFolderName%\data\maps\generic\" "barriers.ie" "dynamic2.ide" "dynamic.ide" "multiobj.ide" "procobj.ide" "vegepart.ide"
call :CheckFolderAndFiles "%sFolderName%\data\maps\interior\" "gen_int1.ide" "gen_int1.ipl" "gen_int2.ide" "gen_int2.ipl" "gen_int3.ide" "gein_int3.ipl" "gen_int4.ide" "gen_int4.ipl" "gen_int5.ide" "gen_int5.ipl" "gen_intb.ide" "gen_intb.ipl" "int_cont.ide" "int_cont.ipl" "int_LA.ide" "int_LA.ipl" "int_SF.ide" "int_SF.ipl" "int_veg.ide" "int_veg.ipl" "propext.ide" "props2.ide" "props.ide" "savehous.ide" "savehous.ipl" "stadint.ide" "stadint.ipl"
call :CheckFolderAndFiles "%sFolderName%\data\maps\LA\" "LAe2.ide" "LAe2.ipl" "LAe.ide" "LAe.ipl" "LAhills.ide" "LAhills.ipl" "LAn2.ide" "LAn2.ipl" "LAn.ide" "LAn.ipl" "LAS2.ide" "LAs2.ipl" "LAs.ide" "LAs.ipl" "LAw2.ide" "LAw2.ipl" "LAw.ide" "LAw.ipl" "LAWn.ide" "LAWn.ipl" "LAxref.ide"
call :CheckFolderAndFiles "%sFolderName%\data\maps\leveldes\" "leveldes.ide" "leveldes.ipl" "levelmap.ide" "levelmap.ipl" "levelxre.ide" "seabed.ide" "seabed.ipl"
call :CheckFolderAndFiles "%sFolderName%\data\maps\SF\" "SFe.ide" "SFe.ipl" "SFn.ide" "SFn.ipl" "SFs.ide" "SFs.ipl" "SFSe.ide" "SFSe.ipl" "SFw.ide" "SFw.ipl" "SFxref.ide"
call :CheckFolderAndFiles "%sFolderName%\data\maps\vegas\" "vegasE.ide" "vegasE.ipl" "VegasN.ide" "vegasN.ipl" "VegasS.ide" "vegasS.ipl" "VegasW.ide" "vegasW.ipl" "vegaxref.ide" "vegaxred.ipl"
call :CheckFolderAndFiles "%sFolderName%\data\maps\veh_mods\" "veh_mods.ide"
call :CheckFolderAndFiles "%sFolderName%\models" "coll" "generic" "grass" "txd" "cutscene.img" "effects.fxp" "effectsPC.txd" "fonts.txd" "fronten1.txd" "fronten2.txd" "fronten3.txd' "frontec_pc.txd" "gta3.mg" "gta_int.img "hud.txd" "misc.txd" "particle.txd" "pcbtns.txd" "player.img"
call :CheckFolderAndFiles "%sFolderName%\models\coll\" "peds.col" "vehicles.col" "weapons.col"
call :CheckFolderAndFiles "%sFolderName%\models\generic\" "air_vlo.DFF" "arrow.DFF" "hoop.dff" "vehicle.txd" "wheels.DFF" "wheels.txd" "zonecylb.DFF"
call :CheckFolderAndFiles "%sFolderName%\models\grass\" "grass0_1.dff" "grass0_2.dff" "grass0_3.dff" "grass0_4.dff" "grass1_1.dff" "grass1_2.dff" "grass1_3.dff" "grass1_4.dff" "grass2_1.dff" "grass2_2.dff" "grass2_3.dff" "grass2_4.dff" "grass3_1.dff" "grass3_2.dff" "grass3_3.dff" "grass3_4.dff" "plant1.dff" "plant1.txd"
call :CheckFolderAndFiles "%sFolderName%\models\txd\" "intro1.txd" "intro2.txd" "INTRO3.TXD" "intro4.txd" "LD_BEAT.txd" "LD_BUM.txd" "LD_CARD.txd" "LD_CHAT.txd" "LD_DRV.txd" "LD_DUAD.txd" "ld_grav.txd" "LD_NONE.txd" "LD_OTB2.txd" "LD_OTB.txd" "LD_PLAN.txd" "LD_POKE.txd" "LD_POOL.txd" "LD_RACE.txd" "LD_RCE1.txd" "LD_RCE2.txd" "LD_RCE3.txd" "LD_RCE4.txd" "LD_RCE5.txd" "LD_ROUL.txd" "ld_shtr.txd" "LD_SLOT.txd" "LD_SPAC.txd" "LD_TATT.txd" "load0uk.txd" "loadsc0.txd" "loadsc1.txd" loadsc2.txd" "loadsc3.txd" "loadsc4.txd" "loadsc5.txd" "loadsc6.txd" "loadsc7.txd" "loadsc8.txd" "loadsc9.txd" "loadsc10.txd" "loadsc11.txd" "loadsc12.txd" "loadsc13.txd" "loadsc14.txd" "LOADSCS.txd" "LOADSUK.txd" "outro.txd" "splash1.txd" "splash2.txd" "splash3.txd"
call :CheckFolderAndFiles "%sFolderName%\movies\" "GTAtitles.mpeg" "Logo.mpeg"
call :CheckFolderAndFiles "%sFolderName%\text\" "american.gxt" "russian.gxt"
call :CheckFolderAndFiles "%sFolderName%\SAMP\" "blanktex.txd" "CUSTOM.ide" "custom.img" "samaps.txd" "SAMP.ide" "SAMP.img" "SAMPCOL.img"

endlocal


:CheckFolderAndFiles
setlocal enableextensions enabledelayedexpansion

set %sFolderName%=%~1
if not exist "%sFolderName%\." echo Folder [%sFolderName%] not found.& goto :eof
:Repeat
set sFile=%~2

if not defined sFile goto :eof
if not exist "%sFolderName%\%sFile%" echo File [%sFile%] not found in folder [%sFolderName%].

shift /2
goto :Repeat

endlocal

Iska
19-11-2013, 15:53
feAre, ключевым словом в моём предыдущем посте было слово «весь». Приведённый Вами код неработоспособен.

feAre
19-11-2013, 16:02
@echo off
@title CrashCheckerSA (v.1.0)
@color 0e
@chcp 1251 >nul
@SetLocal
@mode con: cols=90 lines=100
::left, right, center
Set Alignment=right
Set Center=center
setlocal

Call :ColorText "Здравствуй %username% , ты запустил CrashCheckerSA (v.1.0) " "0e" "center"
Call :ColorText "Пожалуйста, укажите корневую директорию с игрой." "0f"
Call :ColorText "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" "0e" "center"
Call :ColorText "Разработчик программы" "0e" "right"
Call :ColorText "staRR" "0f" "right"

Call :ColorText "Пожалуйста... Подождите" "0f" "center"

for /f "tokens=2 delims=:" %%i in ('chcp') do (
set sPrevCP=%%i
chcp 1251 >nul
)

for /f "usebackq delims=" %%i in (
`@"%systemroot%\system32\mshta.exe" "javascript:var objShellApp = new ActiveXObject('Shell.Application');var Folder = objShellApp.BrowseForFolder(0, 'Укажите корневую папку игры (где лежит gta_sa.exe)',1, '::{20D04FE0-3AEA-1069-A2D8-08002B30309D}');try {new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).Write(Folder.Self.Path)};catch (e){};close();" ^
1^|more`
) do set sFolderName=%%i

chcp %sPrevCP% >nul

if defined sFolderName (
if exist "%sFolderName%\." (
if exist "%sFolderName%\gta_sa.exe" (
Call :ColorText "ИГРА УСПЕШНО НАЙДЕНА В УКАЗАННОЙ ДИРЕКТОРИИ!" "0a" "center"
Call :ColorText "Подождите... Идет проверка на наличие ошибок..." "0f" "center"
Call :ColorText "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" "0e" "center"
Call :ColorText "Этап 1 Проверка на наличие папок и файлов." "0f" "left"
) else (
Call :ColorText "ОШИБКА! ИГРА НЕ НАЙДЕНА В УКАЗАННОЙ ДИРЕКТОРИИ!" "ec" "center"
)
) else (
echo Not found folder [%sFolderName%]
)
) else (
Call :ColorText "ОШИБКА! ВЫ НЕ УКАЗАЛИ ДИРЕКТОРИЮ!" "ec" "center"
)

setlocal enableextensions enabledelayedexpansion

call :CheckFolderAndFiles "%sFolderName%" "gta_sa.exe" "bass.dll" "eax.dll" "msvcr100d.dll" "ogg.dll" "vorbis.dll" "vorbisFile.dll" "vorbisHooked.dll" "mouse.png" "samp.exe" "samp.dll" "samp.saa" "samp_debug.exe" "sampaux3.ttf" "sampgui.png" "gtaweap3.ttf"
call :CheckFolderAndFiles "%sFolderName%\anim\" "anim.img" "cuts.img" "ped.ifp"
call :CheckFolderAndFiles "%sFolderName%\audio\" "SFX" "streams" "CONFIG"
call :CheckFolderAndFiles "%sFolderName%\data\" "Decision" "Icons" "maps" "Paths" "script" "animgrp.dat" "animviewer.dat" "ar_stats.dat" "carcols.dat" "cargrp.dat" "carmods.dat" "clothes.dat" "Audioevents.txt" "CN.txt" "default.dat" "default.ide" "fonts.dat" "furnitur.dat" "gridref.dat" "gta.dat" "gta_quick.dat" "handiling.cfg" "info.zon" "main.sc" "map.zon" "melee.dat" "numplate.dat" "object.dat" "ped.dat" "pedgrp.dat" "peds.ide" "pedstats.dat" "polydensity.dat" "popcycle.dat" "procobj.dat" "shopping.dat" "statdisp.dat" "surface.dat" "surfaud.dat" "surinfo.dat" "timecyc.dat" "plants.dat" "timecyc.aaaa" "timecycp.dat" "txdcut.ide" "vehicles.ide" "water.dat" "water1.dat" "weapon"
call :CheckFolderAndFiles "%sFolderName%\data\script\" "main.scm" "script.img"
call :CheckFolderAndFiles "%sFolderName%\data\icons\" "bin.ico" "saicon2.ICN" "saicon3.ICN" "saicon.ICN"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\" "carrec.img" "NODES0.dat" "NODES1.dat" "NODES2.dat" "NODES3.dat" "NODES4.dat" "NODES5.dat" "NODES6.dat" "NODES7.dat" "NODES8.dat" "NODES9.dat" "NODES10.dat" "NODES11.dat" "NODES12.dat" "NODES13.dat" "NODES14.dat" "NODES15.dat" "NODES16.dat" "NODES17.dat" "NODES18.dat" "NODES19.dat" "NODES20.dat" "NODES21.dat" "NODES22.dat" NODES23.dat" "NODES24.dat" "NODES25.dat" "NODES26.dat" "NODES27.dat" "NODES28.dat" "NODES29.dat" "NODES30.dat" "NODES31.dat" "NODES32.dat" "NODES33.dat" "NODES34.dat" "NODES35.dat" "NODES36.dat" "NODES37.dat" "NODES38.dat" "NODES39.dat" "NODES40.dat" "NODES41.dat" "NODES42.dat" "NODES43.dat" "NODES44.dat" "NODES45.dat" "NODES46.dat" "NODES47.dat" "NODES48.dat" "NODES49.dat" "NODES50.dat" "NODES51.dat" "NODES52.dat" "NODES53.dat" "NODES54.dat" "NODES55.dat" "NODES56.dat" "NODES57.dat" "NODES58.dat" "NODES59.dat" "NODES60.dat" "NODES61.dat" "NODES62.dat" "NODES63.dat" "ROADBLOX.dat" "spath0.dat" "tracks.dat" "tracks2.dat" "tracks3.dat" "tracks4.dat" "train.dat" "train2.dat"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\Decision\" "BLANK.ped" "Cop.ped" "FLAT.ped" "GangMbr.ped" "GROVE.ped" "Indoors.ped" "m_empty.ped" "m_infrm.ped" "m_norm.ped" "m_std.ped" "m_tough.ped" "m_weak.ped" "MISSION.ped" "PedEvent.txt"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\Decision\Allowed\" "Cop.ped" "Fireman.oped" "GangMbr.ped" "Indoors.ped" "m_empty.ped" "m_norm.ped" "m_plyr.ped" "m_steal.ped" "m_tough.ped" "m_weak.ped" "R_Norm.ped" R_TOugh.ped" "R_Weak.ped" "RANDOM.ped"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\Decision\andyd\" "ADtemp.ped"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\Decision\chris\" "maf6.ped" "ryder3.ped"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\Decision\ChrisM\" "CMblnk.ped" "m_std.cm.ped"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\Decision\Craig\" "crack1.ped"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\Decision\david\" "dam_sec.ped" "hei2_sc.ped"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\Decision\Imran\" "sci1_is.ped" "std1_is.ped" "std2_is.ped"
call :CheckFolderAndFiles "%sFolderName%\data\maps\" "Audiozon.ipl" "cull.ipl" "occlu.ipl" "occluint.ipl" "occluLA.ipl" "occlusf.ipl" "occluveg.ipl" "paths2.ipl" "paths3.ipl" "paths4.ipl" "paths5.ipl" "paths.ipl" "tunnels.ipl" "txd.ide"
call :CheckFolderAndFiles "%sFolderName%\data\maps\country\" "countn2.ide" "countn2.ipl" "countrye.ide" "countrye.ipl" "countryN.ide" "countryN.ipl" "countryS.ide" "countryS.ipl" "countryW.ide" "countryw.ipl" "counxref.ide"
call :CheckFolderAndFiles "%sFolderName%\data\maps\generic\" "barriers.ie" "dynamic2.ide" "dynamic.ide" "multiobj.ide" "procobj.ide" "vegepart.ide"
call :CheckFolderAndFiles "%sFolderName%\data\maps\interior\" "gen_int1.ide" "gen_int1.ipl" "gen_int2.ide" "gen_int2.ipl" "gen_int3.ide" "gein_int3.ipl" "gen_int4.ide" "gen_int4.ipl" "gen_int5.ide" "gen_int5.ipl" "gen_intb.ide" "gen_intb.ipl" "int_cont.ide" "int_cont.ipl" "int_LA.ide" "int_LA.ipl" "int_SF.ide" "int_SF.ipl" "int_veg.ide" "int_veg.ipl" "propext.ide" "props2.ide" "props.ide" "savehous.ide" "savehous.ipl" "stadint.ide" "stadint.ipl"
call :CheckFolderAndFiles "%sFolderName%\data\maps\LA\" "LAe2.ide" "LAe2.ipl" "LAe.ide" "LAe.ipl" "LAhills.ide" "LAhills.ipl" "LAn2.ide" "LAn2.ipl" "LAn.ide" "LAn.ipl" "LAS2.ide" "LAs2.ipl" "LAs.ide" "LAs.ipl" "LAw2.ide" "LAw2.ipl" "LAw.ide" "LAw.ipl" "LAWn.ide" "LAWn.ipl" "LAxref.ide"
call :CheckFolderAndFiles "%sFolderName%\data\maps\leveldes\" "leveldes.ide" "leveldes.ipl" "levelmap.ide" "levelmap.ipl" "levelxre.ide" "seabed.ide" "seabed.ipl"
call :CheckFolderAndFiles "%sFolderName%\data\maps\SF\" "SFe.ide" "SFe.ipl" "SFn.ide" "SFn.ipl" "SFs.ide" "SFs.ipl" "SFSe.ide" "SFSe.ipl" "SFw.ide" "SFw.ipl" "SFxref.ide"
call :CheckFolderAndFiles "%sFolderName%\data\maps\vegas\" "vegasE.ide" "vegasE.ipl" "VegasN.ide" "vegasN.ipl" "VegasS.ide" "vegasS.ipl" "VegasW.ide" "vegasW.ipl" "vegaxref.ide" "vegaxred.ipl"
call :CheckFolderAndFiles "%sFolderName%\data\maps\veh_mods\" "veh_mods.ide"
call :CheckFolderAndFiles "%sFolderName%\models" "coll" "generic" "grass" "txd" "cutscene.img" "effects.fxp" "effectsPC.txd" "fonts.txd" "fronten1.txd" "fronten2.txd" "fronten3.txd' "frontec_pc.txd" "gta3.mg" "gta_int.img "hud.txd" "misc.txd" "particle.txd" "pcbtns.txd" "player.img"
call :CheckFolderAndFiles "%sFolderName%\models\coll\" "peds.col" "vehicles.col" "weapons.col"
call :CheckFolderAndFiles "%sFolderName%\models\generic\" "air_vlo.DFF" "arrow.DFF" "hoop.dff" "vehicle.txd" "wheels.DFF" "wheels.txd" "zonecylb.DFF"
call :CheckFolderAndFiles "%sFolderName%\models\grass\" "grass0_1.dff" "grass0_2.dff" "grass0_3.dff" "grass0_4.dff" "grass1_1.dff" "grass1_2.dff" "grass1_3.dff" "grass1_4.dff" "grass2_1.dff" "grass2_2.dff" "grass2_3.dff" "grass2_4.dff" "grass3_1.dff" "grass3_2.dff" "grass3_3.dff" "grass3_4.dff" "plant1.dff" "plant1.txd"
call :CheckFolderAndFiles "%sFolderName%\models\txd\" "intro1.txd" "intro2.txd" "INTRO3.TXD" "intro4.txd" "LD_BEAT.txd" "LD_BUM.txd" "LD_CARD.txd" "LD_CHAT.txd" "LD_DRV.txd" "LD_DUAD.txd" "ld_grav.txd" "LD_NONE.txd" "LD_OTB2.txd" "LD_OTB.txd" "LD_PLAN.txd" "LD_POKE.txd" "LD_POOL.txd" "LD_RACE.txd" "LD_RCE1.txd" "LD_RCE2.txd" "LD_RCE3.txd" "LD_RCE4.txd" "LD_RCE5.txd" "LD_ROUL.txd" "ld_shtr.txd" "LD_SLOT.txd" "LD_SPAC.txd" "LD_TATT.txd" "load0uk.txd" "loadsc0.txd" "loadsc1.txd" loadsc2.txd" "loadsc3.txd" "loadsc4.txd" "loadsc5.txd" "loadsc6.txd" "loadsc7.txd" "loadsc8.txd" "loadsc9.txd" "loadsc10.txd" "loadsc11.txd" "loadsc12.txd" "loadsc13.txd" "loadsc14.txd" "LOADSCS.txd" "LOADSUK.txd" "outro.txd" "splash1.txd" "splash2.txd" "splash3.txd"
call :CheckFolderAndFiles "%sFolderName%\movies\" "GTAtitles.mpeg" "Logo.mpeg"
call :CheckFolderAndFiles "%sFolderName%\text\" "american.gxt" "russian.gxt"
call :CheckFolderAndFiles "%sFolderName%\SAMP\" "blanktex.txd" "CUSTOM.ide" "custom.img" "samaps.txd" "SAMP.ide" "SAMP.img" "SAMPCOL.img"

endlocal


:CheckFolderAndFiles
setlocal enableextensions enabledelayedexpansion

set %sFolderName%=%~1
if not exist "%sFolderName%\." echo Folder [%sFolderName%] not found.& goto :eof
:Repeat
set sFile=%~2

if not defined sFile goto :eof
if not exist "%sFolderName%\%sFile%" echo File [%sFile%] not found in folder [%sFolderName%].

shift /2
goto :Repeat

endlocal

@pause
pause>nul
goto :eof

:ColorText %1-in.Text %2-in.Color.HEX %3-Alignment
Call :SetTextPosition "%~1" "%~3"
md "%temp%\_bin2" 2>nul
pushd "%temp%\_bin2"
echo.>"%~1"
findstr /V /a:%~2 "1" "*"
popd
rd /s /q "%temp%\_bin2"
Exit /B

:SetTextPosition %1-in.Text %2-in.Alignment
if /i "%~2" neq "left" (
call :GetConsoleWidth _ConWidth
call :var_count "%~1" _len
SetLocal EnableDelayedExpansion
if /i "%~2"=="right" (
Set /A _ind=!_ConWidth!-!_len!-1
Call :indent !_ind!
)
if /i "%~2"=="center" (
Set /A _ind=^(!_ConWidth!-!_len!^)/2
Call :indent !_ind!
)
EndLocal
)
Exit /B

:GetConsoleWidth %1-out.ConsoleWidth
For /F "skip=4 tokens=2" %%w In ('mode con') Do Set %~1=%%w& Exit /B

:var_count %1-in.Text %2.out.Len.of.Text
set _var=%~1& set _count=0
:count--
set _var=%_var:~1%
set /a _count+=1
if not defined _var (set %~2=%_count%& exit /b) else (goto :count--)

:indent %1-in.Count.of.Spaces
SetLocal EnableDelayedExpansion
::‡¤Ґбм *г¦*® §*¬Ґ*Ёвм бЁ¬ў®« *Ё¦Ґ ** BackSpace (Є®¤ 0x08) <<<<<---------
Set _BS=
Set _Spaces=
for /L %%C in (1,1,%~1) do Set "_Spaces=!_Spaces! "
<nul set /p "_Spaces=_%_BS%%_Spaces%"
EndLocal& Exit /B

Iska
19-11-2013, 16:07
Угу. Теперь лучше.

Проблема только с «…\models\txd\»?

feAre
19-11-2013, 16:10
Проблема со всеми.

Iska
19-11-2013, 17:31
feAre, тихий ужас. Это не работает задолго до «call :CheckFolderAndFiles …». «exit /b» — значимая команда, зачем Вы убрали, где она была, но не добавили туда, где она как раз нужна? Кодировка пакетных файлов — OEM/866.

@echo off
setlocal enableextensions enabledelayedexpansion

mode con: cols=90 lines=100
title CrashCheckerSA (v.1.0)
color 0e

rem left, right, center
set Alignment=right
set Center=center

call :ColorText "Здравствуй %username% , ты запустил CrashCheckerSA (v.1.0) " "0e" "center"
call :ColorText "Пожалуйста, укажите корневую директорию с игрой." "0f"
call :ColorText "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" "0e" "center"
call :ColorText "Разработчик программы" "0e" "right"
call :ColorText "staRR" "0f" "right"

call :ColorText "Пожалуйста... Подождите" "0f" "center"

set sText=Укажите корневую папку игры (где лежит gta_sa.exe)

for /f "tokens=2 delims=:" %%i in ('chcp') do (
set sPrevCP=%%i
>nul chcp 1251
)

for /f "usebackq delims=" %%i in (
`@"%systemroot%\system32\mshta.exe" "javascript:var objShellApp = new ActiveXObject('Shell.Application');var Folder = objShellApp.BrowseForFolder(0, '%sText%',1, '::{20D04FE0-3AEA-1069-A2D8-08002B30309D}');try {new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).Write(Folder.Self.Path)};catch (e){};close();" ^
1^|more`
) do set sFolderName=%%i

>nul chcp %sPrevCP%

if defined sFolderName (
if exist "%sFolderName%\." (
if exist "%sFolderName%\gta_sa.exe" (
call :ColorText "ИГРА УСПЕШНО НАЙДЕНА В УКАЗАННОЙ ДИРЕКТОРИИ!" "0a" "center"
call :ColorText "Подождите... Идет проверка на наличие ошибок..." "0f" "center"
call :ColorText "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" "0e" "center"
call :ColorText "Этап 1 Проверка на наличие папок и файлов." "0f" "left"
) else (
call :ColorText "ОШИБКА! ИГРА НЕ НАЙДЕНА В УКАЗАННОЙ ДИРЕКТОРИИ!" "ec" "center"
exit /b 3
)
) else (
echo Not found folder [%sFolderName%]
exit /b 2
)
) else (
call :ColorText "ОШИБКА! ВЫ НЕ УКАЗАЛИ ДИРЕКТОРИЮ!" "ec" "center"
exit /b 1
)

call :CheckFolderAndFiles "%sFolderName%" "gta_sa.exe" "bass.dll" "eax.dll" "msvcr100d.dll" "ogg.dll" "vorbis.dll" "vorbisFile.dll" "vorbisHooked.dll" "mouse.png" "samp.exe" "samp.dll" "samp.saa" "samp_debug.exe" "sampaux3.ttf" "sampgui.png" "gtaweap3.ttf"
call :CheckFolderAndFiles "%sFolderName%\anim\" "anim.img" "cuts.img" "ped.ifp"
call :CheckFolderAndFiles "%sFolderName%\audio\" "SFX" "streams" "CONFIG"
call :CheckFolderAndFiles "%sFolderName%\data\" "Decision" "Icons" "maps" "Paths" "script" "animgrp.dat" "animviewer.dat" "ar_stats.dat" "carcols.dat" "cargrp.dat" "carmods.dat" "clothes.dat" "Audioevents.txt" "CN.txt" "default.dat" "default.ide" "fonts.dat" "furnitur.dat" "gridref.dat" "gta.dat" "gta_quick.dat" "handiling.cfg" "info.zon" "main.sc" "map.zon" "melee.dat" "numplate.dat" "object.dat" "ped.dat" "pedgrp.dat" "peds.ide" "pedstats.dat" "polydensity.dat" "popcycle.dat" "procobj.dat" "shopping.dat" "statdisp.dat" "surface.dat" "surfaud.dat" "surinfo.dat" "timecyc.dat" "plants.dat" "timecyc.aaaa" "timecycp.dat" "txdcut.ide" "vehicles.ide" "water.dat" "water1.dat" "weapon"
call :CheckFolderAndFiles "%sFolderName%\data\script\" "main.scm" "script.img"
call :CheckFolderAndFiles "%sFolderName%\data\icons\" "bin.ico" "saicon2.ICN" "saicon3.ICN" "saicon.ICN"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\" "carrec.img" "NODES0.dat" "NODES1.dat" "NODES2.dat" "NODES3.dat" "NODES4.dat" "NODES5.dat" "NODES6.dat" "NODES7.dat" "NODES8.dat" "NODES9.dat" "NODES10.dat" "NODES11.dat" "NODES12.dat" "NODES13.dat" "NODES14.dat" "NODES15.dat" "NODES16.dat" "NODES17.dat" "NODES18.dat" "NODES19.dat" "NODES20.dat" "NODES21.dat" "NODES22.dat" NODES23.dat" "NODES24.dat" "NODES25.dat" "NODES26.dat" "NODES27.dat" "NODES28.dat" "NODES29.dat" "NODES30.dat" "NODES31.dat" "NODES32.dat" "NODES33.dat" "NODES34.dat" "NODES35.dat" "NODES36.dat" "NODES37.dat" "NODES38.dat" "NODES39.dat" "NODES40.dat" "NODES41.dat" "NODES42.dat" "NODES43.dat" "NODES44.dat" "NODES45.dat" "NODES46.dat" "NODES47.dat" "NODES48.dat" "NODES49.dat" "NODES50.dat" "NODES51.dat" "NODES52.dat" "NODES53.dat" "NODES54.dat" "NODES55.dat" "NODES56.dat" "NODES57.dat" "NODES58.dat" "NODES59.dat" "NODES60.dat" "NODES61.dat" "NODES62.dat" "NODES63.dat" "ROADBLOX.dat" "spath0.dat" "tracks.dat" "tracks2.dat" "tracks3.dat" "tracks4.dat" "train.dat" "train2.dat"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\Decision\" "BLANK.ped" "Cop.ped" "FLAT.ped" "GangMbr.ped" "GROVE.ped" "Indoors.ped" "m_empty.ped" "m_infrm.ped" "m_norm.ped" "m_std.ped" "m_tough.ped" "m_weak.ped" "MISSION.ped" "PedEvent.txt"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\Decision\Allowed\" "Cop.ped" "Fireman.oped" "GangMbr.ped" "Indoors.ped" "m_empty.ped" "m_norm.ped" "m_plyr.ped" "m_steal.ped" "m_tough.ped" "m_weak.ped" "R_Norm.ped" R_TOugh.ped" "R_Weak.ped" "RANDOM.ped"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\Decision\andyd\" "ADtemp.ped"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\Decision\chris\" "maf6.ped" "ryder3.ped"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\Decision\ChrisM\" "CMblnk.ped" "m_std.cm.ped"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\Decision\Craig\" "crack1.ped"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\Decision\david\" "dam_sec.ped" "hei2_sc.ped"
call :CheckFolderAndFiles "%sFolderName%\data\Paths\Decision\Imran\" "sci1_is.ped" "std1_is.ped" "std2_is.ped"
call :CheckFolderAndFiles "%sFolderName%\data\maps\" "Audiozon.ipl" "cull.ipl" "occlu.ipl" "occluint.ipl" "occluLA.ipl" "occlusf.ipl" "occluveg.ipl" "paths2.ipl" "paths3.ipl" "paths4.ipl" "paths5.ipl" "paths.ipl" "tunnels.ipl" "txd.ide"
call :CheckFolderAndFiles "%sFolderName%\data\maps\country\" "countn2.ide" "countn2.ipl" "countrye.ide" "countrye.ipl" "countryN.ide" "countryN.ipl" "countryS.ide" "countryS.ipl" "countryW.ide" "countryw.ipl" "counxref.ide"
call :CheckFolderAndFiles "%sFolderName%\data\maps\generic\" "barriers.ie" "dynamic2.ide" "dynamic.ide" "multiobj.ide" "procobj.ide" "vegepart.ide"
call :CheckFolderAndFiles "%sFolderName%\data\maps\interior\" "gen_int1.ide" "gen_int1.ipl" "gen_int2.ide" "gen_int2.ipl" "gen_int3.ide" "gein_int3.ipl" "gen_int4.ide" "gen_int4.ipl" "gen_int5.ide" "gen_int5.ipl" "gen_intb.ide" "gen_intb.ipl" "int_cont.ide" "int_cont.ipl" "int_LA.ide" "int_LA.ipl" "int_SF.ide" "int_SF.ipl" "int_veg.ide" "int_veg.ipl" "propext.ide" "props2.ide" "props.ide" "savehous.ide" "savehous.ipl" "stadint.ide" "stadint.ipl"
call :CheckFolderAndFiles "%sFolderName%\data\maps\LA\" "LAe2.ide" "LAe2.ipl" "LAe.ide" "LAe.ipl" "LAhills.ide" "LAhills.ipl" "LAn2.ide" "LAn2.ipl" "LAn.ide" "LAn.ipl" "LAS2.ide" "LAs2.ipl" "LAs.ide" "LAs.ipl" "LAw2.ide" "LAw2.ipl" "LAw.ide" "LAw.ipl" "LAWn.ide" "LAWn.ipl" "LAxref.ide"
call :CheckFolderAndFiles "%sFolderName%\data\maps\leveldes\" "leveldes.ide" "leveldes.ipl" "levelmap.ide" "levelmap.ipl" "levelxre.ide" "seabed.ide" "seabed.ipl"
call :CheckFolderAndFiles "%sFolderName%\data\maps\SF\" "SFe.ide" "SFe.ipl" "SFn.ide" "SFn.ipl" "SFs.ide" "SFs.ipl" "SFSe.ide" "SFSe.ipl" "SFw.ide" "SFw.ipl" "SFxref.ide"
call :CheckFolderAndFiles "%sFolderName%\data\maps\vegas\" "vegasE.ide" "vegasE.ipl" "VegasN.ide" "vegasN.ipl" "VegasS.ide" "vegasS.ipl" "VegasW.ide" "vegasW.ipl" "vegaxref.ide" "vegaxred.ipl"
call :CheckFolderAndFiles "%sFolderName%\data\maps\veh_mods\" "veh_mods.ide"
call :CheckFolderAndFiles "%sFolderName%\models" "coll" "generic" "grass" "txd" "cutscene.img" "effects.fxp" "effectsPC.txd" "fonts.txd" "fronten1.txd" "fronten2.txd" "fronten3.txd' "frontec_pc.txd" "gta3.mg" "gta_int.img "hud.txd" "misc.txd" "particle.txd" "pcbtns.txd" "player.img"
call :CheckFolderAndFiles "%sFolderName%\models\coll\" "peds.col" "vehicles.col" "weapons.col"
call :CheckFolderAndFiles "%sFolderName%\models\generic\" "air_vlo.DFF" "arrow.DFF" "hoop.dff" "vehicle.txd" "wheels.DFF" "wheels.txd" "zonecylb.DFF"
call :CheckFolderAndFiles "%sFolderName%\models\grass\" "grass0_1.dff" "grass0_2.dff" "grass0_3.dff" "grass0_4.dff" "grass1_1.dff" "grass1_2.dff" "grass1_3.dff" "grass1_4.dff" "grass2_1.dff" "grass2_2.dff" "grass2_3.dff" "grass2_4.dff" "grass3_1.dff" "grass3_2.dff" "grass3_3.dff" "grass3_4.dff" "plant1.dff" "plant1.txd"
call :CheckFolderAndFiles "%sFolderName%\models\txd\" "intro1.txd" "intro2.txd" "INTRO3.TXD" "intro4.txd" "LD_BEAT.txd" "LD_BUM.txd" "LD_CARD.txd" "LD_CHAT.txd" "LD_DRV.txd" "LD_DUAD.txd" "ld_grav.txd" "LD_NONE.txd" "LD_OTB2.txd" "LD_OTB.txd" "LD_PLAN.txd" "LD_POKE.txd" "LD_POOL.txd" "LD_RACE.txd" "LD_RCE1.txd" "LD_RCE2.txd" "LD_RCE3.txd" "LD_RCE4.txd" "LD_RCE5.txd" "LD_ROUL.txd" "ld_shtr.txd" "LD_SLOT.txd" "LD_SPAC.txd" "LD_TATT.txd" "load0uk.txd" "loadsc0.txd" "loadsc1.txd" loadsc2.txd" "loadsc3.txd" "loadsc4.txd" "loadsc5.txd" "loadsc6.txd" "loadsc7.txd" "loadsc8.txd" "loadsc9.txd" "loadsc10.txd" "loadsc11.txd" "loadsc12.txd" "loadsc13.txd" "loadsc14.txd" "LOADSCS.txd" "LOADSUK.txd" "outro.txd" "splash1.txd" "splash2.txd" "splash3.txd"
call :CheckFolderAndFiles "%sFolderName%\movies\" "GTAtitles.mpeg" "Logo.mpeg"
call :CheckFolderAndFiles "%sFolderName%\text\" "american.gxt" "russian.gxt"
call :CheckFolderAndFiles "%sFolderName%\SAMP\" "blanktex.txd" "CUSTOM.ide" "custom.img" "samaps.txd" "SAMP.ide" "SAMP.img" "SAMPCOL.img"

endlocal
exit /b 0

:CheckFolderAndFiles
setlocal enableextensions enabledelayedexpansion

set sFolder=%~1
if not exist "%sFolder%\." echo Folder [%sFolder%] not found.& goto :eof
:Repeat
set sFile=%~2

if not defined sFile goto :eof
if not exist "%sFolder%\%sFile%" echo File [%sFile%] not found in folder [%sFolder%].

shift /2
goto :Repeat

endlocal
exit /b 0

:ColorText %1-in.Text %2-in.Color.HEX %3-Alignment
call :SetTextPosition "%~1" "%~3"
md "%temp%\_bin2" 2>nul
pushd "%temp%\_bin2"
echo.>"%~1"
findstr /V /a:%~2 "1" "*"
popd
rd /s /q "%temp%\_bin2"
Exit /B

:SetTextPosition %1-in.Text %2-in.Alignment
if /i "%~2" neq "left" (
call :GetConsoleWidth _ConWidth
call :var_count "%~1" _len
SetLocal EnableDelayedExpansion
if /i "%~2"=="right" (
Set /A _ind=!_ConWidth!-!_len!-1
call :indent !_ind!
)
if /i "%~2"=="center" (
Set /A _ind=^(!_ConWidth!-!_len!^)/2
call :indent !_ind!
)
EndLocal
)
Exit /B

:GetConsoleWidth %1-out.ConsoleWidth
For /F "skip=4 tokens=2" %%w In ('mode con') Do Set %~1=%%w& Exit /B

:var_count %1-in.Text %2.out.Len.of.Text
set _var=%~1& set _count=0
:count--
set _var=%_var:~1%
set /a _count+=1
if not defined _var (set %~2=%_count%& exit /b) else (goto :count--)

:indent %1-in.Count.of.Spaces
SetLocal EnableDelayedExpansion
::╪¤?бм *г│*R *┐?*Ёвм бЁ┐ўR< *Ё│? ** BackSpace (ЄR¤ 0x08) <<<<<---------
Set _BS=
Set _Spaces=
for /L %%C in (1,1,%~1) do Set "_Spaces=!_Spaces! "
<nul set /p "_Spaces=_%_BS%%_Spaces%"
EndLocal& Exit /B
Ниже «:CheckFolderAndFiles» не пошёл. Сами. Завершающий слэш в именах каталогов не нужен, убирайте.




© OSzone.net 2001-2012