Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-18-2004, 12:45 PM
jecardam jecardam is online now
Registered User
 
Join Date: 11-10-2004
Location: Philly
Posts: 5
Question Rename file

Is there a way to rename a file through Visual Build Pro?
Reply With Quote
  #2  
Old 11-18-2004, 12:59 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Use a Run Program step with a command of

%DOSCMD% rename "c:\path\to\file.ext" "new name.ext"
Reply With Quote
  #3  
Old 11-18-2004, 03:27 PM
pjaquiery pjaquiery is online now
Registered User
 
Join Date: 01-20-2003
Location: Dunedin, New Zealand
Posts: 114
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.
Reply With Quote
  #4  
Old 11-23-2004, 11:10 AM
DHearn DHearn is online now
Registered User
 
Join Date: 06-02-2001
Posts: 8
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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 01:53 AM.


Copyright © 1999-2023 Kinook Software, Inc.