2013-09-25 4 views
0

나는 크기 1,024킬로바이트 날이 수 있도록 도와주세요 명령 줄에서 사용 rar.exe (배치 파일) 사전을 update.rar하는 단일 파일 update.ver을 압축 해요 배치 파일압축 파일

@echo off 
REM Path to WinRAR executable in Program Files 
set path="C:\Program Files\WinRAR\Rar.exe";%path% 



echo 1. Compress files in dir individually (no subdirs) 
echo. 
echo. 
set /P 
if "%FILE%"=="1" goto indiv 


REM Compress files in directory individually (no subdirectories) 
:indiv 
echo. 
echo. 
FOR %%i IN (*.*) do (
rar a "%%~ni" "%%i" 
) 
goto eof 


:eof 


endlocal 

Erase v6.rar 
Erase update.ver 
rename update.rar update.ver 

윈도우에서 작동하지이 코드는

+0

이 코드를 작동하지를 –

+0

편집 내게 묻고 –

+1

을'set path'로보고, 경로 만 설정하십시오 :'set path = "C : \ Program Files \ WinRAR \"; % path %' – Stephan

답변

1

일부 예제 코드 VPS :

@echo off &setlocal 
REM Path to WinRAR executable in Program Files 
set "path=C:\Program Files\WinRAR;%path%" 

echo 1. Compress files in dir individually (no subdirs) 
echo(
echo(
set /P "answer=" 
if not "%answer%"=="1" goto eof 

REM Compress files in directory individually (no subdirectories) 
:indiv 
echo(
echo(
FOR %%i IN (*) do (
    rar a "%%~ni.rar" "%%~i" || echo Error building archive! 
) 

Erase v6.rar 
Erase update.ver 
rename update.rar update.ver 
+0

경로에서 "Rar.exe"를 제거하십시오 ... – Stephan

+0

OK ....................... :) – Endoro

+0

http : // stackoverflow .com/questions/18942973/update-ver-in-eset-update –