how to rename a file ???
:rolleyes: :rolleyes: :rolleyes:
:p :p :p
:D :D :D
:cool: :cool: :cool:
;) ;) ;)
greetz
m€
Printable View
how to rename a file ???
:rolleyes: :rolleyes: :rolleyes:
:p :p :p
:D :D :D
:cool: :cool: :cool:
;) ;) ;)
greetz
m€
Try this:
Code:FileCopy "thefile.txt", "thefile2.txt"
cyber castens example creates another copy of the original file!
Name srcfile as destfile
actually renames the file
BE SURE TO INCLUDE FILE EXTENSIONS
Dim OldName, NewName
OldName = "OLDFILE": NewName = "NEWFILE" ' Define file names.
Name OldName As NewName ' Rename file.
OldName = "C:\MYDIR\OLDFILE": NewName = "C:\YOURDIR\NEWFILE"
Name OldName As NewName ' Move and rename file.
Oops! :D
The Name statement is much better to use than FileCopy statement. Takes up less time because if you use the Name statement, you don't have to go back and delete the old file :).
The Name statement can also be used to move files.
Code:Name "MyFile" As "MyNewFile"