none
Copy Paste Batch file command fails

    Question

  • Hi,

    I have created a batch file for copying all the dll files from a folder into the c:\windows folder. Below is my batch file.

     

    @ECHO OFF

    ECHO. THE FOLLOWING BATCH FILE WILL COPY ALL DLL FILES FROM A FOLDER TO WINDOWS FOLDER

    PAUSE

    XCOPY C:\A1 Folder\*.* "C:\Windows\*.*" /s /y

    ECHO COMPLETED 

    PAUSE

     

    But it is NOT copying the dll files. My operating system is Windows 7. What is wrong in it ?

    Thanks in advance.


    • Edited by uksoftengg Tuesday, August 16, 2011 2:09 PM modified
    Tuesday, August 16, 2011 2:08 PM

All replies

  • Run this file with ADMIN RIGHTS
    Tuesday, August 16, 2011 2:30 PM
  • Hi,

    Thanks for the reply. I run this as admin. but no use. it says invalid parameters.

    Any idea ??/

     

    Tuesday, August 16, 2011 2:42 PM
  • TRY to use following with ADMIN RIGHTS
    @ECHO OFF
    ECHO. THE FOLLOWING BATCH FILE WILL COPY ALL DLL FILES FROM A FOLDER TO WINDOWS FOLDER
    PAUSE
    XCOPY "C:\A1 Folder\*.*" "C:\Windows\*.*" /s /y
    ECHO COMPLETED 
    PAUSE
    Its working


    Tuesday, August 16, 2011 3:02 PM
  • uksoftengg wrote:
    >
    >I have created a batch file for copying all the dll files from a folder
    >into the c:\windows folder. Below is my batch file.
     
    Don't do that.  This is an incredibly bad idea that will cause you pain in
    the future.  The Windows folder is protected for a very good reason.  Leave
    the DLLs in your program's directory.
     
    Have you looked at a Windows system recently?  The Windows folder is not
    used to hold DLLs.  System DLLs belong in System32; user DLLs belong in the
    same directory as the program that is using them.
     
    Please -- the standards were created for a reason.  FOLLOW THEM.
     
    Is this a 64-bit system?  If so, then there are even more rules to
    consider.
     
    >@ECHO OFF
    >ECHO. THE FOLLOWING BATCH FILE WILL COPY ALL DLL FILES FROM A FOLDER TO WINDOWS FOLDER
    >PAUSE
    >XCOPY C:\A1 Folder\*.* "C:\Windows\*.*" /s /y
    >ECHO COMPLETED 
    >PAUSE
    >
    >
    >But it is NOT copying the dll files.
     
    Of course not, because you are missing quote marks around the name "A1
    Folder".  The correct command would be:
        xcopy /s /y "c:\A1 Folder\*.*" C:\Windows
     
    But again, I caution you not to do this.  This It is not good programming
    practice.
    --
    Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc.
     

    Tim Roberts, DDK MVP Providenza & Boekelheide, Inc.
    Tuesday, August 16, 2011 10:09 PM