dos commands, or file-rename

Blitz3D Forums/Blitz3D Beginners Area/dos commands, or file-rename

There are multiple ways to rename a file. Here's one way:
CreateProcess("cmd.exe /c rename file1 file2")

Of course you have to use the right command interpreter depending on the OS.

Here's another way which should work on all systems:
;.lib "msvcrt.dll"
;RenameFile%(source$, dest$):"rename"

result = RenameFile("file1", "file2")
If Not result Then Notify "Success!" Else Notify "Failure."
End


I would not recommend using the copy/temp file method.