Copy htm and its supported files and directory to other directory using CMD

D P

I have few html files with .htm extension and its supported files in another directory.

For example : html file name is 41debcd7-75f2-469a-8833-8bda79995009.htm and its supported directory name is 41debcd7-75f2-469a-8833-8bda79995009_files, which contains styles/images/etc used in html file.

this html file is created using MS word Save as Type-> "Web Page(.htm;.html)"

I want to copy HTML file with its supported files to some other directory using CMD. I am able to copy HTML files(have multiple html in directory) and supported directory with below command but all support files are not getting copied(only html copied) xcopy " *.htm" "f:\TestCMD" /s /e

Can anyone please help in copying html and all supported files of html using cmd?

lit

The XCOPY command is good for copying subdirectory structures.

SETLOCAL ENABLEDELAYEDEXPANSION

SET "FILENAME=41debcd7-75f2-469a-8833-8bda79995009.html"
SET "TARGET_DIR=C:\src\t\htest"

FOR %%f IN ("%FILENAME%") DO (
    SET "SUBDIR=%%~nf_files"
    IF NOT EXIST "%TARGET_DIR%\!SUBDIR!" (MKDIR "%TARGET_DIR%\!SUBDIR!")

    COPY "%FILENAME%" "%TARGET_DIR%"
    XCOPY /V /S /E /I "!SUBDIR!" "%TARGET_DIR%\!SUBDIR!"
)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Cannot copy files of directory into other directory

From Dev

Cannot copy files of directory into other directory

From Java

Copy directory to other directory at Docker using ADD command

From Dev

Copy files in a directory to another directory

From Dev

Copy files in a directory to another directory

From Dev

Loop through all files in a directory and its sub directory using Unix

From Java

Copy files to output directory using csproj dotnetcore

From Dev

Copy the file directory and files using Gulp

From Dev

Copy the file directory and files using Gulp

From Dev

How to copy all files from a directory to a remote directory using scp?

From Dev

Programmatically Copy Files from 'Temporary Internet Files' into other directory

From Dev

Copy files to the newest Directory

From Dev

copy files with the base directory

From Dev

Copy file from directory to another using cmd command

From Dev

Copy multiple files from one directory to multiple other directories

From Dev

puppet copy directory but not its content

From Dev

Copy a directory and all its files from the master branch into a new branch with a different directory structure

From Dev

Edit multiple cmd files in a directory

From Dev

Compile all .c files in a directory using GCC compiler in CMD

From Dev

Display content of all .txt files in a directory using CMD

From Dev

delete all files in a directory that are not in a copy of a directory

From Dev

Copy versioned file to other directory

From Dev

how to zip a directory with its files using Terminal on Mac

From Dev

Gulp copy directory over and files

From Dev

Copy directory with all files and folders

From Dev

Bash - Copy files from directory

From Dev

Copy a web directory and files for updates?

From Dev

Copy directory tree with empty files

From Dev

How to copy random files to a directory

Related Related

  1. 1

    Cannot copy files of directory into other directory

  2. 2

    Cannot copy files of directory into other directory

  3. 3

    Copy directory to other directory at Docker using ADD command

  4. 4

    Copy files in a directory to another directory

  5. 5

    Copy files in a directory to another directory

  6. 6

    Loop through all files in a directory and its sub directory using Unix

  7. 7

    Copy files to output directory using csproj dotnetcore

  8. 8

    Copy the file directory and files using Gulp

  9. 9

    Copy the file directory and files using Gulp

  10. 10

    How to copy all files from a directory to a remote directory using scp?

  11. 11

    Programmatically Copy Files from 'Temporary Internet Files' into other directory

  12. 12

    Copy files to the newest Directory

  13. 13

    copy files with the base directory

  14. 14

    Copy file from directory to another using cmd command

  15. 15

    Copy multiple files from one directory to multiple other directories

  16. 16

    puppet copy directory but not its content

  17. 17

    Copy a directory and all its files from the master branch into a new branch with a different directory structure

  18. 18

    Edit multiple cmd files in a directory

  19. 19

    Compile all .c files in a directory using GCC compiler in CMD

  20. 20

    Display content of all .txt files in a directory using CMD

  21. 21

    delete all files in a directory that are not in a copy of a directory

  22. 22

    Copy versioned file to other directory

  23. 23

    how to zip a directory with its files using Terminal on Mac

  24. 24

    Gulp copy directory over and files

  25. 25

    Copy directory with all files and folders

  26. 26

    Bash - Copy files from directory

  27. 27

    Copy a web directory and files for updates?

  28. 28

    Copy directory tree with empty files

  29. 29

    How to copy random files to a directory

HotTag

Archive