Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: renamiing multiple files  (Read 2339 times)

0 Members and 1 Guest are viewing this topic.

Bushmills1

  • Guest
renamiing multiple files
« on: March 24, 2008, 04:45:11 PM »
I have about 1000 .bmp files that all have the prefix 'Copy of' in front of them.
What is the DOS command line to rename them deleting only the 'Copy of' element?
Hope you can help

kv79



    Rookie

    Re: renamiing multiple files
    « Reply #1 on: March 25, 2008, 03:59:45 AM »
    Post this message to a programing  language C forum . That would be easy for them .

    Dias de verano

    • Guest
    Re: renamiing multiple files
    « Reply #2 on: March 25, 2008, 05:48:10 AM »
    It's a batch problem pure and simple. Is the part after 'copy of' unique in each case?


    ghostdog74



      Specialist

      Thanked: 27
      Re: renamiing multiple files
      « Reply #3 on: March 25, 2008, 08:38:48 AM »
      provided you only have all "copy of" files and not their originals, here's a vbscript
      Code: [Select]
      Set objFSO= CreateObject("Scripting.FileSystemObject")
      Set colFolders = objFSO.GetFolder("C:\test")

      For Each oFile In colFolders.Files   
          If InStr(1,oFile.Name,"Copy of",1) > 0 Then
          newName = Replace(oFile.Name, "Copy of ","")
          oFile.Name= newName
          WScript.Echo oFile.Name
          End If
      Next