06/25/2012 3233 views

i need to over write multiple files to C:\program files\xxx in XP and C:\program files (x86)\xxx in win 7 using single script.

which works in both xp and win7

0 Comments   [ + ] Show comments


Community Chosen Answer


You can use VBScript, Batch or Powershell as well.

Have a look at this blog:


Answered 06/27/2012 by: piyushnasa
Red Belt

All Answers


Using copy in a batch file should do the trick. Type copy /? at the command line for more options

Copy /Y <source> %programfiles%\xxx
Answered 06/25/2012 by: bkelly
Red Belt


Best option would be VBScript..

You can overwrite files silently.

When you overwrite multiple files through Batch Script it takes time and shows command prompt, user can easily terminate the process simply closing the command prompt.

Answered 06/25/2012 by: jagadeish
Red Belt

  • Batch files can be run in complete silence as well. Depending on your scripting prowess they might also be easier to write. VBScript would definitely be your best option, but batch files can be an easier although sometimes messier way to get this done.
  • How do you run batch script without showing command prompt? Please explain
  • A few ideas: You can run them through AD as a log off/on script, this removes the ability of the user to cancel the script run. If you have Kace you can also run them silently using the scripting section. From what I've been told many other deployment solutions provide a way to run batch files silently, but if they don't then you package them as a silent exe. To give credit where credit is due, I didn't know about that until I asked the question here: http://www.itninja.com/question/how-to-hide-command-prompt-that-appears-during-windows-installation
  • You don't have to use any other utility/depend on deployment tool/other things to run VBScript silently. It can be used directly in the custom action. as well.

Vbscript is more versatile but lacks the simple essential xcopy syntax possibilities which are needed in this case. I would chose for simple batch script in this situation.

Answered 06/26/2012 by: Rvlieburg
Third Degree Blue Belt