2012-07-19 9 views
0

나는 3 개 가지 작업을위한 3 개 가지 배치 파일이 필요합니다 :세 가지 작업 배치 파일

@echo off 
echo Updating... 
call :Logit>>log.txt 2>&1 
exit /b 0 
:Logit 
hldsupdatetool.exe -command update -game "Counter-Strike Source" -dir "Source 2007 Dedicated Server" -verify_all -retry 
start notepad log.txt 

- 파일 및 폴더 목록을 가져 오기 위해이 로그를 지우십시오. 로그는 다음과 같습니다 :

Checking bootstrapper version ... 
Updating Installation 
Determining which depot(s) to install/update... 
5 depot(s) will be installed/updated 
    0:30 Checking local files and building download list for depot 242 'Counter-Strike Source Shared' version 126 
    0:30  Connecting content server session for version 126 
    0:31  [80.239.194.146:27030] Connecting... 
    0:31  [80.239.194.146:27030] Connection established; handshaking... 
    0:31  [80.239.194.146:27030] Sending login message... 
    0:31  Fetching version 126 manifest 
    0:41  Reading version 126 checksum table 
    0:54  Calculating download size and verifying checksums 
    0:54   Checking...:/
    0:54   Checking...: cstrike 
    0:54   Checking...: cstrike\bin 
    0:54   Checking...: cstrike\cfg 
    0:54   Checking...: cstrike\classes 
    0:54   Checking...: cstrike\maps 
    0:54   Checking...: cstrike\maps\graphs 
    0:54   Checking...: cstrike\maps\soundcache 
    0:57   Checking...: cstrike\materials 
    0:57   Checking...: cstrike\materials\brick 
    0:57   Checking...: cstrike\materials\buildings 
    0:57   Checking...: cstrike\materials\carpet 
    0:57   Checking...: cstrike\materials\composite 
    0:57   Checking...: cstrike\materials\concrete 
    0:58   Checking...: cstrike\materials\console 
etc... later on files do not have extensions! 

- 나열되지 않은 파일이나 폴더에서 서버 폴더를 지울 수 있습니다!

나는 ... 2 일 동안 주위를 검색하지만 난 혼자 갈 수이까지입니다

답변

0

우선, 나는 배치에 확실히 새로워졌습니다. 두 번째 질문 : - 파일 및 폴더 목록을 가져 오기 위해이 로그를 정리하십시오. 로그는 다음과 같이 표시됩니다.

for /f "tokens=3" %G in ('findstr /i /c:"checking..." log.txt')do echo %G>>_.log 

효과가 있습니다.

업데이트 :

/ cstrike cstrike\bin cstrike\cfg cstrike\classes cstrike\maps cstrike\maps\graphs cstrike\maps\soundcache cstrike\materials cstrike\materials\brick cstrike\materials\buildings cstrike\materials\carpet cstrike\materials\composite cstrike\materials\concrete cstrike\materials\console cstrike\materials\cs_assault cstrike\materials\cs_havana cstrike\materials\cs_italy cstrike\materials\cstrike cstrike\materials\de_aztec cstrike\materials\de_cbble cstrike\materials\de_chateau cstrike\materials\de_dust cstrike\materials\de_nuke cstrike\materials\de_piranesi cstrike\materials\de_prodigy cstrike\materials\de_tides cstrike\materials\de_train cstrike\materials\decals cstrike\materials\decals\concrete cstrike\materials\decals\metal cstrike\materials\decals\wood ... 

어쩌면 내가 당신의 의미를 오해 :
내가이 (파일 이름이 _.log) 결과, 즉시 log.txt에 테스트를 다운로드?

업데이트 다시

3 위의 질문에 대한

@echo off 
set /p origin=Where is the original folder?(Type absoulute path directly.) 
echo origin: %origin% 
set /p destin=Where can i put file temporarily(Type absoulute path directly.) 
echo destination :%destin% 


for /f %%G in (_.log) do (
if "%%G"=="/" (
    echo. 
) else ( 
    xcopy %origin%\%%G %destin%\%%G /H /K /R /E /D /I /Y 
)) 

rm -rf %origin% 
set /p origin=What is the name of original folder?(Type name) 
rename %destin% %origin% 

당신을 도와 드릴까요!

업데이트 세 번째 :

때문에 내 잘 능력 TI 코드의 부족에 대한 반가워요 죄송 어쩌면 약간의 혼란 첫 번째 버전. 파일은 같은 형식 C:\template\example\cstrike\materials\brick에있는 경우

@echo off 
setlocal enabledelayedexpansion 
set MAXNUM=100 

set /p origin=Where is the original folder?(Type absoulute path directly.) 
echo origin: %origin% 
set backup_origin=%origin% 

for /L %%H in (1,1,%MAXNUM%) do (
for /F "delims=\" %%G in ("!origin!") do (
set name=%%G 
set origin=!origin:%%G\=! 
)) 
set father=!backup_origin:\%name%=! 

xcopy !father!\!name! !father!\backup_!name! /H /K /R /E /D /I /Y 
::copy files 
rm -rf !father!\!name! 
::delete origin 
rename !father!\backup_!name! !name! 
::rename the new folder using the old's name 

, 당신은 단지 등 \hl2\cstrike 등이 포함 c:\template\example를 입력해야합니다. 난 당신이 not.So 난 당신이 xcopy, rm, rename은 아마도`메모장을 시작 you.T

에 대한
+0

고맙지 만 시도했지만 작동하지 않는 것 같습니다 ... – AirMax95s

+0

@ AirMax95s @ 1 질문에 출력 된 로그 파일을보실 수 있습니다 – yuan

+0

http://www.mediafire.com/?c5zhynsa974dlj0 여기에서 다운로드 할 수 있습니다 :) – AirMax95s

1

당신은

@echo off 
hldsupdatetool.exe -command update -game "Counter-Strike Source" -dir "Source 2007 Dedicated Server" -verify_all -retry >Log.txt 
start notepad Log.txt 

파일이 확장자를 표시하지의 문제에이 단축 될 수 있습니다 않은 것 실행중인 프로그램으로 내려 가면 모든 일괄 처리는 exe를 호출하고 출력을 리디렉션합니다.

+0

작업이 있는지 확인, 당신의 OS.Before 실행에 내 배치 파일을 조정 권고 할 수있다 Win7에, 작업
log.txt' 행이 끝에 추가되어야합니다. 어쨌든 파일 확장명이 표시되지 않는다면 어떻게됩니까? OP는 그들에게 어떤 이슈도 언급하지 않는다. 내가 뭘 놓치고 있니? –

+0

@AndriyM 네, 그렇게 생각합니다. 마지막 비트는 앱의 출력에 대한 OP의 코멘트입니다.나중에 파일에 확장명이 없습니다! ' –

+0

아, 어떻게 그럴 수 있니? 나는 그 라인에있는'etc.' 이후의 모든 것을 중요하지 않은 것으로 그냥 추측했다. :) 감사! –