Hi all,

Basically, I need to copy a file to replace a file that already exist on the pc.

What is the best way to go about this? As currently I am using a Custom Command to call a batch file which using Xcopy. But for some reason I can not get it to work.

Any suggestings will be great.

Thanks

Damian
0 Comments   [ + ] Show 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.

Answers

0
You seem to be going about this the hard way.. How come you aren't just installing the file as part of your MSI?!

If you must do it as a custom action then it would be better done in VBScript or Wise Script.

Cheers,
Rob.
Answered 09/06/2005 by: MSIPackager
Third Degree Black Belt

Please log in to comment
0
Hi Rob,

In the past when I have put the file in the MSI it doesnt always seem to overwrite the file there.

Thats why I have been using xcopy.

What will the VBscript be to overwrite files?

Cheers

Damian
Answered 09/06/2005 by: Thegunner
Second Degree Green Belt

Please log in to comment
0
Hi gunner:

As MSI Packager said you could probably write a wise script that is going to do the trick personally it's a good option since it provide more flexibility than vbscript and is more easy to use.
Answered 09/06/2005 by: wiseapp
Second Degree Green Belt

Please log in to comment
0
Hi
If you want to use VBScript, past this code in custome action "Embeded VBScript" and the chage the source and distinatio. In below code Platform.ini is source and the second one is destination.
-------------------------------------------------------------------------
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile "C:\Platform.ini", "C:\Test\"
----------------------------------------------------------------------------

Please let me know if this solves ur problem.
Answered 09/06/2005 by: The_Repacker
Senior Yellow Belt

Please log in to comment
0
ORIGINAL: The_Repacker

Hi
If you want to use VBScript, past this code in custome action "Embeded VBScript" and the chage the source and distinatio. In below code Platform.ini is source and the second one is destination.
-------------------------------------------------------------------------
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile "C:\Platform.ini", "C:\Test\"
----------------------------------------------------------------------------

Please let me know if this solves ur problem.

Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile "C:\Platform.ini", "C:\Test\"


Will this replace a file that already exist?

What I want to do is to copy a file from a UNC path and overwrite it in C:\WINNT\SYSTEM32\DRIVERS
The file is fastfat.sys.
Answered 09/06/2005 by: Thegunner
Second Degree Green Belt

Please log in to comment
0
Yes This will overwrite.
Answered 09/06/2005 by: The_Repacker
Senior Yellow Belt

Please log in to comment
0
If you dont want to ovewrite use this

fso.CopyFile "C:\Platform.ini", "C:\Test\" ,False
Answered 09/06/2005 by: The_Repacker
Senior Yellow Belt

Please log in to comment
0
Yep it all worked, cheers mate nice one! [:D]
Answered 09/06/2005 by: Thegunner
Second Degree Green Belt

Please log in to comment
0
ORIGINAL: Thegunner

Hi Rob,

In the past when I have put the file in the MSI it doesnt always seem to overwrite the file there.

Thats why I have been using xcopy.

What will the VBscript be to overwrite files?

Cheers

Damian


Thegunner,
you can edit the Files table & set the version # on the file - this should fix your "no overwrite" issue.
Answered 09/06/2005 by: revizor
Third Degree Blue Belt

Please log in to comment
0
I have got it working from running the MSI manually, but once I put it in GPO and assign it to the PC. The Pc finds it starts to download it and I log on and the file hasnt been copied over. It still has the 2004 version instead of the 2003 version i want.
Strange, as I said it works if I run the MSI manually.
Answered 09/06/2005 by: Thegunner
Second Degree Green Belt

Please log in to comment
0
Did you put CA into Deferred sequence?
Answered 09/06/2005 by: revizor
Third Degree Blue Belt

Please log in to comment
0
ORIGINAL: revizor

Did you put CA into Deferred sequence?


Sorted now, I had to put it in the Execute Deferred section.

Cheers for the help lads.
Answered 09/06/2005 by: Thegunner
Second Degree Green Belt

Please log in to comment
0
I believe you were running the script in user interface or execute immedite.
Answered 09/06/2005 by: wiseapp
Second Degree Green Belt

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