none
I need to copy only all excel files xlsx , xls, xlsm,xlsb in my documents path as below RRS feed

  • Question

  • I need to copy only  all excel files xlsx , xls, xlsm,xlsb in my documents path as below

    C:\Users\user\Documents

    to  path C:\Users\user\backupoffice    keeping the folder structure including subdirectories.

      Can this be done with robocopy I used both windows 8.1 and windows 7.

    looking a code to do this

    Can anyone assist

    thanks

    Friday, November 3, 2017 1:54 PM

Answers

  • Do some reading here:

    https://ss64.com/nt/robocopy.html

    https://technet.microsoft.com/en-us/library/cc733145(v=ws.11).aspx


    S.Sengupta,Microsoft MVP Windows and Devices for IT, Windows Insider MVP

    • Marked as answer by Jean_7 Thursday, February 1, 2018 2:17 PM
    Saturday, November 4, 2017 11:28 PM
  • Hi,

    I did a test to copy all .txt and .lnk file from C:\users\d to C:\users\u by using xcopy  /e  Source\*.file type [Destination] command as following screenshot shows. And it will also copy the folder structure including subdirectories.

    C:\users\d screenshot:

    C:\users\u screenshot:

    Please try to use following commands in Command Prompt.

    xcopy /e C:\Users\user\Documents \*. xlsx  C:\Users\user\backupoffice    (press Enter)

    xcopy /e C:\Users\user\Documents \*. xls  C:\Users\user\backupoffice      (press Enter)

    xcopy /e C:\Users\user\Documents \*. xlsm  C:\Users\user\backupoffice   (press Enter)

    xcopy /e C:\Users\user\Documents \*. xlsb C:\Users\user\backupoffice    (press Enter)


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Proposed as answer by Vera Hu Tuesday, November 7, 2017 1:22 AM
    • Marked as answer by Jean_7 Thursday, February 1, 2018 2:16 PM
    Monday, November 6, 2017 5:55 AM
  • Hi, 

    Hows everything going? Please feel free to give me any update.


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marked as answer by Jean_7 Thursday, February 1, 2018 2:17 PM
    Wednesday, November 8, 2017 7:23 AM
  • Hi, 

    Just checking in to see if the information was helpful. Please let us know if you would like further assistance. 


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marked as answer by Jean_7 Sunday, January 28, 2018 7:15 PM
    • Unmarked as answer by Jean_7 Monday, March 12, 2018 5:38 PM
    • Marked as answer by Jean_7 Monday, March 12, 2018 5:38 PM
    Monday, November 13, 2017 4:14 PM

All replies

  • Do some reading here:

    https://ss64.com/nt/robocopy.html

    https://technet.microsoft.com/en-us/library/cc733145(v=ws.11).aspx


    S.Sengupta,Microsoft MVP Windows and Devices for IT, Windows Insider MVP

    • Marked as answer by Jean_7 Thursday, February 1, 2018 2:17 PM
    Saturday, November 4, 2017 11:28 PM
  • Hi,

    I did a test to copy all .txt and .lnk file from C:\users\d to C:\users\u by using xcopy  /e  Source\*.file type [Destination] command as following screenshot shows. And it will also copy the folder structure including subdirectories.

    C:\users\d screenshot:

    C:\users\u screenshot:

    Please try to use following commands in Command Prompt.

    xcopy /e C:\Users\user\Documents \*. xlsx  C:\Users\user\backupoffice    (press Enter)

    xcopy /e C:\Users\user\Documents \*. xls  C:\Users\user\backupoffice      (press Enter)

    xcopy /e C:\Users\user\Documents \*. xlsm  C:\Users\user\backupoffice   (press Enter)

    xcopy /e C:\Users\user\Documents \*. xlsb C:\Users\user\backupoffice    (press Enter)


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Proposed as answer by Vera Hu Tuesday, November 7, 2017 1:22 AM
    • Marked as answer by Jean_7 Thursday, February 1, 2018 2:16 PM
    Monday, November 6, 2017 5:55 AM
  • Hi, 

    Hows everything going? Please feel free to give me any update.


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marked as answer by Jean_7 Thursday, February 1, 2018 2:17 PM
    Wednesday, November 8, 2017 7:23 AM
  • Hi, 

    Just checking in to see if the information was helpful. Please let us know if you would like further assistance. 


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marked as answer by Jean_7 Sunday, January 28, 2018 7:15 PM
    • Unmarked as answer by Jean_7 Monday, March 12, 2018 5:38 PM
    • Marked as answer by Jean_7 Monday, March 12, 2018 5:38 PM
    Monday, November 13, 2017 4:14 PM