batch file - Rename network folder with spaces in it -
i have folder on remote server named backup job [hostname].[date] located in \\xxx\backup\hostname want rename backup. since [hostname] , [date] added later on don't know exact filename in advance.
when try rename folder remote computer following line
for /d %f in (\\xxx\backup\hostame\backup*) rename %f backup
it gets translated into
rename \\xxx\backup\hostame\backup job hostname.date backup
and throws a
syntax incorrect
i pretty sure due spaces in folder name, how past this?
the skript missing needed quotation marks explained in comments of question. line should have been:
for /d %f in (\\xxx\backup\hostame\backup*) rename "%f" backup
Comments
Post a Comment