My knowledge of vbs scripting is very limited and i have searched a bit for some code to rename a file and found some code but when i run it within an msi it errors it works when jsut simply running .vbs file but not when i place code with in a custom action in an msi.

Dim oFSO
Dim sSourceFile
Dim sDestinationFile

Set oFSO = CreateObject("Scripting.FileSystemObject")

sSourceFile = "C:\Program Files\Caddsman\Architect 2003\Library\Openings\Windowbuilder.txt"
sDestinationFile = "C:\Program Files\Caddsman\Architect 2003\Library\Openings\Windowbuilder.ini"

oFSO.MoveFile sSourceFile, sDestinationFile

Set oFso = Nothing

Was wondering if anyone would know of better way to rename a file?
0 Comments   [ - ] Hide Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity


Hi Ryath,

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.MoveFile "C:\FSO\ScriptLog.txt" , "C:\FSO\BackupLog.txt"

Got this from

TechNet Home > Script Center > Script Repository > Storage > Files

Hope this helps.

Answered 09/26/2005 by: MSI_repackager
Orange Belt

Please log in to comment
Hey MSI_repackager

The one place I didn't remember to look in! Hah! That code worked! So simple!
Thx for the help.

Answered 09/26/2005 by: ryath
Orange Belt

Please log in to comment