/build/static/layout/Breadcrumb_cap_w.png

vb script - rename file

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   [ + ] Show comments

Answers (2)

Posted by: MSI_repackager 19 years ago
Orange Belt
0
Hi Ryath,

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

Got this from http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx

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

Hope this helps.

M
Posted by: ryath 19 years ago
Orange Belt
0
Hey MSI_repackager

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

Cheers
Ry
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ