Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer 1

Turns out the answer was very simple:

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

share|improve this answer
add comment

Your Answer

 
discard

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.