Kinook Software Forum

Kinook Software Forum (https://www.kinook.com/Forum/index.php)
-   [VBP] General Discussion (https://www.kinook.com/Forum/forumdisplay.php?f=2)
-   -   Rename file (https://www.kinook.com/Forum/showthread.php?t=626)

jecardam 11-18-2004 11:45 AM

Rename file
 
Is there a way to rename a file through Visual Build Pro?

kinook 11-18-2004 11:59 AM

Use a Run Program step with a command of

%DOSCMD% rename "c:\path\to\file.ext" "new name.ext"

pjaquiery 11-18-2004 02:27 PM

I suspect that rename gets used often enough that it would be worth doing a VBP step for it.

If it supported a wildcard rename and rename in sub-folders as options that would make it really usefull.

DHearn 11-23-2004 10:10 AM

You can also use the following global VB script:

' ***********************************************
' Renames a file
Sub RenameFile(SourceFile, DestFile, Overwrite)
' ensure that the target file does not exist
If Overwrite And vbld_FSO.FileExists(DestFile) Then
vbld_FSO.GetFile(DestFile).Delete True
End If
' rename the file
vbld_FSO.GetFile(SourceFile).Move DestFile
End Sub


All times are GMT -5. The time now is 11:59 AM.


Copyright © 1999-2023 Kinook Software, Inc.