I need to rename a number of files after an msi is installed. I need them renaming after the install due to Radia not liking the file extension # at deployment do it fails.

I have conclusded a Custom Action to do this via a .vbs is the best option.

Can a file rename be done using vbs? if so can anyone let me know the scrit to do this, cannot fine the command for a file rename.

many thanks in advance.

Files to be renamed are as follows :

C:\PROGRAM FILES\PROPH_73\FULL_ACC\PRECOMP\BorelandWatr.01 to BorelandWatr.01
BorelandWatr.02 to BorelandWatr.02
BorelandWatrD.00 to BorelandWatrD.00
BorelandWatrD.01 to BorelandWatrD.01

Renamed to BorelandWatr.01 to BorelandWatr.#01
BorelandWatr.02 to BorelandWatr.#02
BorelandWatrD.00 to BorelandWatrD.#00
BorelandWatrD.01 to BorelandWatrD.#01

big cheers in advance.
0 Comments   [ + ] Show 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.


You can't rename a file using VBScript natively, but you can "move" the file to the new file name.

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.MoveFile "C:\temp\file1.txt", "C:\temp\file_with_new_name.doc"
Answered 09/18/2006 by: brenthunter2005
Fifth Degree Brown Belt

Please log in to comment

try this script

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.MoveFile "C:\1.txt" , "C:\2.txt"

(Move file is like renaming a file)

Hope it works,
Answered 09/18/2006 by: knight
Orange Senior Belt

Please log in to comment
If the installation requires a reboot you could use the FileRenameOperations under the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager key to do the rename operation.
Answered 09/18/2006 by: gmorgan618
Blue Belt

Please log in to comment
Cheers guys, u've given me some superb info to be cracking on with :)
Answered 09/19/2006 by: TOBES_UK
Senior Purple Belt

Please log in to comment
Have you considered using the MoveFiles Table for this?
Answered 09/21/2006 by: looeee
Senior Yellow Belt

Please log in to comment
If you do rename these make sure they are not set a the keypath for the component, if they are they will get repaired.
Answered 09/21/2006 by: AngelD
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity