/bundles/itninjaweb/img/Breadcrumb_cap_w.png
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   [ - ] Hide Comments

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

Answers

0
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
0
Hi TOBES_UK,

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,
knight
Answered 09/18/2006 by: knight
Orange Senior Belt

Please log in to comment
0
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
0
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
0
Have you considered using the MoveFiles Table for this?
Answered 09/21/2006 by: looeee
Senior Yellow Belt

Please log in to comment
0
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