#1
|
|||
|
|||
Rename file
Is there a way to rename a file through Visual Build Pro?
|
#2
|
|||
|
|||
Use a Run Program step with a command of
%DOSCMD% rename "c:\path\to\file.ext" "new name.ext" |
#3
|
|||
|
|||
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. |
#4
|
|||
|
|||
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 |
|
|