.bat 文件重命名文件(非批量)

.bat 文件重命名文件(非批量)

我拍摄飞机的照片。

当我把它们放到电脑上时,它们被命名为 DCS_5678(或另一个数字:p)我对图片进行分类的方式是通过重命名它们,如下所示:number_Airline_Typeofaircraft_Tailnumber_date_airport,因此它看起来像这样:3968_UnitedAirlines_Boeing777-222_N778UA_15-08-2014_EBBR,因此另一张图片将被称为:5460_BrusselsAirlines_AvroRJ100_OO-DWL_16-08-2014_EBBR

我记得的关于 .bats 的内容不多,我找不到我想要的东西。这是我找到的:代码:

@echo Filerenamer
@echo Airportcodes: EBBR = Brussels Airport, EBMB = Melsbroek Military Airport, EHAM = Amsterdam Schiphol, EGGL = London Heathrow, EBAW = Antwerp International Airport, EBOS = Ostend Airport, more on http://en.wikipedia.org/wiki/List_of_airports_in_Belgium
@echo _____________________________________________________________________________
@echo
@echo
@echo Enter filename to rename
???????????????????????????????????
@echo Enter new name
???????????????????????????????????
@echo File renamed. Rename other file? y/n
???????????????????????????????????

不记得在????的位置放什么,以及如何用 y 或 n 来回答问题(如果是 y,那么它应该回到询问输入文件名的问题,...,如果是 n,它应该作为确认来关闭命令屏幕

有人可以帮忙吗?

谢谢

对于 y/n 问题,我找到了如何解决

 @echo off
:start
cls
echo Filerenamer
echo Airportcodes: EBBR = Brussels Airport, EBMB = Melsbroek Military Airport, EHAM = Amsterdam Schiphol, 
echo EGGL = London Heathrow, EBAW = Antwerp International Airport, EBOS = Ostend Airport
echo More codes on http://en.wikipedia.org/wiki/List_of_airports_in_Belgium
pause
echo Rename aother file? y/n
set /p choose=
if %choose%==y goto :start
echo Press any key to exit.
Pause
:exit

现在仍然需要弄清楚如何提供文件名和新文件名

答案1

看起来这就是我想要的 :D

 @echo off
:start
cls
echo ****************************************************************************************
echo *                                    FILERENAMER                                       *
echo *                                                                                      *
echo *                           Belgian Airport ICAO codes                                 *
echo *     -Bevekom EBBE          -Bierset EBLG              -Deurne EBAW                   *
echo *     -Charleroi EBCI        -Grimbergen EBGB           -Hasselt EBZH                  *
echo *     -Koksijde EBFN         -Kortrijk/Wevelgem EBKT    -Leopoldsburg/Beverlo EBLE     *
echo *     -Melsbroek EBMB        -Moorsele EBMO             -Oostende EBOS                 *
echo *     -Saint-Ghislain EBSG   -Namen EBNM                -Zaventem EBBR                 *
echo *     -Florennes EBFS        -Genk EBZW                 -Kleine-Brogel EBKB            *
echo *     -Malle/Zoersel EBZR    -Zuienkerke EBZU                                          *
echo ****************************************************************************************
pause
echo What file do you like to rename?
set /p name1=
echo How would you like to name it? (number_Airline_Type_Tailnumber_date_ICAO)
set /p name2=
rename %name1% %name2%.JPG
echo Rename another file? y/n
set /p choose=
if %choose%==y goto :start
echo Press any key to exit.
Pause
:exit

相关内容