/build/static/layout/Breadcrumb_cap_w.png

Xcopy Help needed!

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

Answers (13)

Posted by: MSIPackager 18 years ago
3rd Degree Black Belt
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.
Posted by: Thegunner 18 years ago
Second Degree Green Belt
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
Posted by: wiseapp 18 years ago
Second Degree Green Belt
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.
Posted by: The_Repacker 18 years ago
Senior Yellow Belt
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.
Posted by: Thegunner 18 years ago
Second Degree Green Belt
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.
Posted by: The_Repacker 18 years ago
Senior Yellow Belt
0
Yes This will overwrite.
Posted by: The_Repacker 18 years ago
Senior Yellow Belt
0
If you dont want to ovewrite use this

fso.CopyFile "C:\Platform.ini", "C:\Test\" ,False
Posted by: Thegunner 18 years ago
Second Degree Green Belt
0
Yep it all worked, cheers mate nice one! [:D]
Posted by: revizor 18 years ago
Third Degree Blue Belt
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.
Posted by: Thegunner 18 years ago
Second Degree Green Belt
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.
Posted by: revizor 18 years ago
Third Degree Blue Belt
0
Did you put CA into Deferred sequence?
Posted by: Thegunner 18 years ago
Second Degree Green Belt
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.
Posted by: wiseapp 18 years ago
Second Degree Green Belt
0
I believe you were running the script in user interface or execute immedite.
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