Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-18-2004, 11:45 AM
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, 11:59 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,003
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, 02:27 PM
pjaquiery pjaquiery is online now
Registered User
 
Join Date: 01-19-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, 10: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

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 12:50 PM.


Copyright © 1999-2023 Kinook Software, Inc.