Re: Batch Rename

Tech-Archive recommends: Fix windows errors by optimizing your registry



IEric wrote:
I have a large batch file that copies pdf files from one network directory to another. It works great! Now, I was wondering if it is possible to create a batch file that copies the files and renames them? (It would be really cool if I could use a wildcard some how that would allow me to add the date on the end of the file name!)

I did some playing around with the "RENAME" command, but I could not get it to work with spaces in the file name. I need to maintain the spaces in these file names, so is there a way to make this work? As I alluded to above, I would like to add the date to the end of the file name. If a wild card can't be used, I will just get it setup manually once, open the file in Excel and use the replace command.

Thanks!

Eric


If you don't want to write a batch file yourself, one of my favorite freeware applications, Irfanview, includes a batch rename facility. Among other things, you can include a param for the system date in the name pattern. There's even a command line syntax. It's quite a powerful tool, so you should experiment a bit with dummy files before you turn it loose on your entire directory of pdfs. http://www.irfanview.net/


--
Lem -- MS-MVP - Networking

To the moon and back with 64 Kbits of RAM and 512 Kbits of ROM.
http://en.wikipedia.org/wiki/Apollo_Guidance_Computer
.



Relevant Pages

  • Re: Batch Rename
    ... it before you can run the batch file. ... word "echo" in the last line in order to activate it. ... I did some playing around with the "RENAME" command, ...
    (microsoft.public.windowsxp.general)
  • Re: Renaming multiple files
    ... PcCare used advanced batch file techniques in his reply. ... This command enumerates all .jpg files in the current ... folder and invokes the "rename" subroutine, ... This command sets the variable "filename" to the value ...
    (microsoft.public.windowsxp.general)
  • Re: Replacing a string in a filename
    ... >>>I need help in writing something that can take the filename as a string ... >>>and being able to rename that file into something else. ... >>>FOR command in them? ... Double if used WITHIN a batch file. ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Re: How do I check if a file is in use?
    ... change the program or batch file that is writing the file ... I can forsee, "rename" is an atomic operation, i.e. you'll never see ... Another possibility, very non-portable, but in Windows you can make API ...
    (comp.lang.c)
  • Re: command file help
    ... You might be better off with a script like a VB scipt. ... Then you use the File System Object and do a rename of the file while ... It is a whole lot more flexible than a batch file. ... but every time I run the cmd file I get ...
    (microsoft.public.windows.server.general)