Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got a piece of software that includes its own backup utility, but it generates folder names with the current date and time appended. I'd like to write batch script that will remove the date/time part of the folder name

essentially I'd like to rename c:\my folder\backup12345\ to c:\my folder\backup\

I've tried the obvious:

ren "c:\my folder\backup*" "backup"

which returns "The syntax of the command is incorrect."

This feels like it should be so simple, but I can't work out why it won't work

share|improve this question

Turns out the answer was very simple:

move "c:\my folder\backup*" "c:\my folder\backup"

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.