DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 8 of 8

Thread: rename files

  1. #1
    Ahmed Guest

    rename files


    Can anybody help me to rename 1200 files since I do it manually which is time
    consumption
    Thanks

  2. #2
    Christopher Thomas McGinlay Guest

    Re: rename files

    Ahmed wrote:

    > Can anybody help me to rename 1200 files since I do it manually which is time
    > consumption
    > Thanks


    Check the following thread for a very similar discussion along the lines
    of your query:

    "How can I rename mp3 files to BIG letters in C++"

    Chris

    --
    Ascent Software Limited Registered in Scotland: SC201671
    www.ascent.zetnet.co.uk Bank Of Scotland Buildings
    Lerwick, Shetland, ZE1 0EB


  3. #3
    www.exontrol.com Guest

    Re: rename files


    "Ahmed" <ahmed@coastal.t.u-tokyo.ac.jp> wrote:
    >
    >Can anybody help me to rename 1200 files since I do it manually which is

    time
    >consumption
    >Thanks


    Private Sub Form_Load()
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set fo = fso.GetFolder("c:\temp")
    For Each fi In fo.Files
    fso.CopyFile fi.Path, "c:\temp\renamed\" & UCase(fi.Name)
    Next
    End Sub

    Mike
    www.exontrol.com

  4. #4
    Mighty Guest

    Re: rename files


    Does someone knows how to DO IT IN C++??????

  5. #5
    Ralph Guest

    Re: rename files


    "Mighty" <mighty911@yahoo.com> wrote:
    >
    >Does someone knows how to DO IT IN C++??????


    I think all the C++ guys are over on the C# newsgroup. <g>

    Anyone interested in a Perl script?

  6. #6
    Danny Kalev Guest

    Re: rename files

    As I said in a previous post, there is a way to do that in C++ but it's
    platform dependent. Under Unix/Linux for example, you use the <dirent.h>
    library to iterate a directory's files sequentially. You can then use
    the rename() function to change each file's name. Windows has a similar
    set of APIs for iterating directories and changing their names.

    Danny

    Mighty wrote:
    >
    > Does someone knows how to DO IT IN C++??????


  7. #7
    Mighty Guest

    Re: rename files


    So, can you help me about how to do it in windows or dos?


    Danny Kalev <dannykk@inter.net.il> wrote:
    >As I said in a previous post, there is a way to do that in C++ but it's
    >platform dependent. Under Unix/Linux for example, you use the <dirent.h>
    >library to iterate a directory's files sequentially. You can then use
    >the rename() function to change each file's name. Windows has a similar
    >set of APIs for iterating directories and changing their names.
    >
    >Danny
    >
    >Mighty wrote:
    >>
    >> Does someone knows how to DO IT IN C++??????



  8. #8
    Danny Kalev Guest

    Re: rename files

    in dos, you #include <dir.h> and <stdio.h>. The former defines routines
    for iterating a directory. stdio.h defines the standard function
    rename(), which does exactly what your expect it to do:) Look at the
    findfirst() and findnext() functions. The use a struct called ffblk
    which represents a directory file. The member ffname contains the file
    name, which you can pass as an argument to rename().

    Danny

    Mighty wrote:
    >
    > So, can you help me about how to do it in windows or dos?
    >
    > Danny Kalev <dannykk@inter.net.il> wrote:
    > >As I said in a previous post, there is a way to do that in C++ but it's
    > >platform dependent. Under Unix/Linux for example, you use the <dirent.h>
    > >library to iterate a directory's files sequentially. You can then use
    > >the rename() function to change each file's name. Windows has a similar
    > >set of APIs for iterating directories and changing their names.
    > >
    > >Danny
    > >
    > >Mighty wrote:
    > >>
    > >> Does someone knows how to DO IT IN C++??????


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links