Results 1 to 2 of 2

Thread: How do you rename a file?

  1. #1
    Guest

    Post

    How do you rename a file?

    At present the only way I can think of doing it is to copy the file (to the same folder but with the new name) and delete the original. But what if the file where 300MB? Or a gig?

    ------------------
    Matthew Ralston
    E-Mail: [email protected]
    ICQ: 31422892
    Web Site: My Home Page
    AKA: ...::: The Fragmeinster :::... (On Quake 3 World Forums)

    Sorry about my English, but my Scouse is dead good!

  2. #2
    Hyperactive Member Al Smith's Avatar
    Join Date
    May 1999
    Location
    Marcellus, MI. USA
    Posts
    330

    Post

    Hi,

    From Help.

    Name Statement

    Renames a disk file, directory, or folder.

    Syntax

    Name oldpathname As newpathname

    The Name statement syntax has these parts:

    Part Description

    oldpathname Required. String expression that specifies the existing file name and location—may include directory or folder, and drive.
    newpathname Required. String expression that specifies the new file name and location—may include directory or folder, and drive. The file name specified by newpathname can't already exist.


    Remarks

    Both newpathname and oldpathname must be on the same drive. If the path in newpathname exists and is different from the path in oldpathname, the Name statement moves the file to the new directory or folder and renames the file, if necessary. If newpathname and oldpathname have different paths and the same file name, Name moves the file to the new location and leaves the file name unchanged. Using Name, you can move a file from one directory or folder to another, but you can't move a directory or folder.

    Using Name on an open file produces an error. You must close an open file before renaming it. Name arguments cannot include multiple-character (*) and single-character (?) wildcards.



    ------------------
    A computer is a tool, not a toy.
    <A HREF="mailto:[email protected]
    [email protected]">[email protected]
    [email protected]</A>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width