Nếu bạn sử dụng Extensions Processor Command (đó là mặc định trên Windows 2000 và sau này) sau đó bạn có thể sử dụng cú pháp tùy chọn sau đây:
%~1 - expands %1 removing any surrounding quotes (")
%~f1 - expands %1 to a fully qualified path name
%~d1 - expands %1 to a drive letter only
%~p1 - expands %1 to a path only
%~n1 - expands %1 to a file name only
%~x1 - expands %1 to a file extension only
%~s1 - expanded path contains short names only
%~a1 - expands %1 to file attributes
%~t1 - expands %1 to date/time of file
%~z1 - expands %1 to size of file
các bổ trợ có thể kết hợp để có được compo kết quả und:
%~dp1 - expands %1 to a drive letter and path only
%~nx1 - expands %1 to a file name and extension only
Vì vậy, lệnh của bạn sẽ trông như thế này:
if exist %2\%~nx1 ren %2\%~nx1 %~n1_standby%~x1
Và tôi nhắc lại: DOS không phải là CMD, và '[hàng loạt chế biến] NEQ [mẻ = file]' – SteveFest