好的,这是给你的。我正在尝试使用批处理文件重命名一堆文件,但它们都不与批处理文件本身在同一文件夹中。命令提示符告诉我无法找到该目录。我想我可以重命名与文件名匹配的所有文件夹中的所有文件,但我也不想这样做; 我只想改变某些。
我的批处理文件是:
@echo off
ren "engine/info.txt" "disabled.txt"
ren "gravplating/info.txt" "disabled.txt"
ren "HAWX content/info.txt" "disabled.txt"
ren "laserz/info.txt" "disabled.txt"
ren "NeuroNaval/info.txt" "disabled.txt"
ren "NeuroPlanes/info.txt" "disabled.txt"
ren "NeuroTanks/info.txt" "disabled.txt"
ren "NeuroWeapons/info.txt" "disabled.txt"
ren "WAC Base/info.txt" "disabled.txt"
ren "WAC DamageSystem/info.txt" "disabled.txt"
ren "WAC GravityController/info.txt" "disabled.txt"
ren "WAC Helicopters/info.txt" "disabled.txt"
ren "WAC Sweps/info.txt" "disabled.txt"
ren "weapons/info.txt" "disabled.txt"
ren "AFF_ships/info.txt" "disabled.txt"
ren "AntiTakeRifle/info.txt" "disabled.txt"
ren "Catmull-Rom Cameras/info.txt" "disabled.txt"
ren "Displacer Cannon/info.txt" "disabled.txt"
ren "Drumdevil's Trains/info.txt" "disabled.txt"
ren "EVEOnline/info.txt" "disabled.txt"
ren "gm_botmap_v3/info.txt" "disabled.txt"
ren "gm_construct_flatgrass_v5-2/info.txt" "disabled.txt"
ren "gm_mobenix_v3_final/info.txt" "disabled.txt"
ren "gm_mobenix_v3_highquality_Water/info.txt" "disabled.txt"
ren "gm_snabbansairfield_b1/info.txt" "disabled.txt"
ren "gm_XhS_construct/info.txt" "disabled.txt"
ren "linedraw/info.txt" "disabled.txt"
ren "ModelManipulator/info.txt" "disabled.txt"
ren "NeuroCars/info.txt" "disabled.txt"
ren "Propeller Engine/info.txt" "disabled.txt"
ren "VanDookie and Predaaator's pack/info.txt" "disabled.txt"
ren "WAC ECM/info.txt" "disabled.txt"
ren "WAC Extra Helicopters/info.txt" "disabled.txt"
echo Done!
pause
CD
事实上,至少有一个“批处理文件”可以运行的操作系统在路径名中明确支持它 - 你正在使用该命令假设的操作系统。由于命令参数都是引用而不是绝对路径名,因此不必担心它可能会与命令选项混淆。