Si utiliza las extensiones de procesador de comandos (que es por defecto en Windows 2000 y versiones posteriores), puede utilizar la siguiente sintaxis opcional:
%~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
los modificadores se pueden combinar para obtener compo Resultados und:
%~dp1 - expands %1 to a drive letter and path only
%~nx1 - expands %1 to a file name and extension only
Así que su comando sería algo como esto:
if exist %2\%~nx1 ren %2\%~nx1 %~n1_standby%~x1
y repito: DOS no es CMD, y '[procesamiento por lotes] neq [lotes = Archivo]' – SteveFest