Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rem http://prohardver.hu/tema/total_commander/hsz_1952-1955.html
- rem Toolbar:
- rem http://prohardver.hu/dl/upc/2013-10/52551_total_commander_button_bar_srt-atnevezo_batch-prog.png
- @echo OFF
- echo === SRT-atnevezes ===
- echo.
- if [%1]==[] (
- echo Hianyzik a parameter!
- goto :exit
- )
- set first_argument=%1
- rem Removing double quotes from the variable:
- rem http://stackoverflow.com/questions/1964192/removing-double-quotes-from-variables-in-batch-file-creates-problems-with-cmd-en/5181182#5181182
- set first_argument=%first_argument:"=%
- set first_srt_filename=""
- set first_srt_filename_without_extension=""
- for %%F in (*.srt) do (
- set first_srt_filename=%%F
- set first_srt_filename_without_extension=%%~nF
- goto :rename_srt
- )
- if %first_srt_filename%=="" (
- echo Ebben a konyvtarban nincs srt-fajl!
- goto :exit
- )
- :rename_srt
- echo "%first_srt_filename%" fajlt at fogom nevezni a kovetkezore: "%first_argument%.srt"
- ren "%first_srt_filename%" "%first_argument%.srt"
- if not %errorlevel%==0 (
- echo Hiba tortent a fajl atnevezesekor!
- goto :exit
- )
- echo Megtortent.
- echo.
- echo Az srt-fajlok listaja jelenleg:
- dir *.srt /B
- :exit
- echo.
- echo === Vegeztem, csa! ===
- rem Tavolitsd el egy sorral lejjebb a "rem" szocskat a pause elol, ha latni akarsz minden uzenetet (ugy a batch-program rem felhasznaloi interakciora var, es nem tunik el azonnal a command prompt).
- rem pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement