• Rename a File (VB 2008 Express Edition)

    Home » Forums » Developers, developers, developers » DevOps Lounge » Rename a File (VB 2008 Express Edition)

    Author
    Topic
    #453360

    I use the methods of the File class to perform utility functions on existing files. I notice, however, that there is no Rename method. How does one do a simple file rename in VB?

    Thank you

    John Littell

    Viewing 2 reply threads
    Author
    Replies
    • #1122536

      Please post your questions in the appropriate forum. This is a .Net question, not classic VB, just like post 721,406 some weeks ago.
      I’ll move the thread sigh

    • #1122578

      I think you just use MoveTo with the new name.

    • #1122579

      I refer you to the msdn article and the snippet

      My.Computer.FileSystem.RenameFile(“C:Test.txt”, “SecondTest.txt”)

      • #1122622

        My thanks go to all responders. It is so simple when you know.

        John

        PS. What determines this a .net question, not a VB question?

        • #1122665

          After version 7 they unified their products into a group known as .NET, using core libraries from the .NET framework. (Version 8 being 2005, version 9 being 2008)

          • #1122817

            Danny D.
            Sorry for the delayed response. The Lounge seemed to be down yesterday.

            Does your answer mean that the VB/VBA category now applies only to version 6 and earlier?

            John

            • #1122833

              The Lounge hasn’t been down, but it’s very slow every day between 23:00 and 01:00 UTC because the daily backup is made durong that time – see for example the thread starting at post 719,531.

            • #1123125

              Yes, as the .NET section refers to the .NET package, i anticipate the VB/VBA section to mean only pre-.NET articles

        • #1124151

          Sorry, I don’t monitor the .Net forum closely, so I missed your PS.

          Danny is correct. VB5 / VB6 and (Office) VBA all use “classic” Visual Basic. Questions about those can be posted in the VB / VBA forum.
          VB.NET, VB2003, VB2005 and VB2008 all use a newer version of Visual Basic that is quite different from “classic” VB, so there’s a separate forum for everything related to these versions.

          See Visual Basic .NET on Wikipedia for an overview.

    Viewing 2 reply threads
    Reply To: Rename a File (VB 2008 Express Edition)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: