View Full Version : Rename file
jecardam
11-18-2004, 12:45 PM
Is there a way to rename a file through Visual Build Pro?
kinook
11-18-2004, 12:59 PM
Use a Run Program step with a command of
%DOSCMD% rename "c:\path\to\file.ext" "new name.ext"
pjaquiery
11-18-2004, 03: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, 11: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
vBulletin® v3.8.11, Copyright ©2000-2024, vBulletin Solutions Inc.