Saturday, October 9, 2021

That what DIR shows, XCOPY copies



$ dir /s *.ppt*

Volume in drive F has no label.
Volume Serial Number is 6137-6435

Directory of ~\Artificial Intelligence\AI and disciplines it borrows ideas from (20210304)

04/27/2021  01:39 PM           178,384 AI and disciplines it borrows from (20210304).pptx
                1 File(s)        178,384 bytes

Directory of ~\Artificial Intelligence\Career Road Map for Artificial Intelligence & Data Science [20210725]

07/24/2021  12:02 PM           521,685 Career Road-Map for Artificial Intelligence & Data Science.pptx
                1 File(s)        521,685 bytes

Directory of ~\Machine Learning\Classification\Naive Bayes Classifier for Spam Filtering

07/27/2021  07:47 PM         9,358,328 Naive Bayes Classifier for Spam Filtering.pptx
                1 File(s)      9,358,328 bytes

Directory of ~\Machine Learning\Regression\Linear Regression (Theory 20210715)

07/15/2021  12:32 PM         4,869,791 Linear Regression.pptx
                1 File(s)      4,869,791 bytes

Directory of ~\Machine Learning\Regression\Improvements over OLS (Forward Stepwise, Ridge, Lasso, LARS)

07/17/2021  05:12 PM           723,056 Improvements over OLS (Forward Stepwise, Ridge, Lasso, LARS).pptx
                1 File(s)        723,056 bytes

Directory of ~\Natural Language Processing\Session 1 on `Understanding, Analyzing and Generating Text'

07/20/2021  05:16 PM         1,503,410 Session 1 on `Understanding, Analyzing and Generating Text'.pptx
                1 File(s)      1,503,410 bytes

Directory of ~\Natural Language Processing\Sentiment Analysis\VADER - Rule Based Approach to Sentiment Analysis

07/22/2021  12:48 PM           340,528 Session 2 on `Understanding, Analyzing and Generating Text'.pptx
                1 File(s)        340,528 bytes

Directory of ~\Natural Language Processing\Word Embeddings\Document Parsing, Document based Embeddings and Word Embeddings

08/15/2021  10:19 PM           849,022 Document Parsing, Document based Embeddings and Word Embeddings.pptx
                1 File(s)        849,022 bytes

Directory of ~\Web Development\JavaScript\JavaScript Intro (Dev Console, Data Types and Operators)

07/26/2021  07:03 PM           231,542 JavaScript.pptx
                1 File(s)        231,542 bytes

    Total Files Listed:
                9 File(s)     18,575,746 bytes
                0 Dir(s)  587,115,003,904 bytes free 

$ dir /s /b *.ppt*

~\Artificial Intelligence\AI and disciplines it borrows ideas from (20210304)\AI and disciplines it borrows from (20210304).pptx
~\Artificial Intelligence\Career Road Map for Artificial Intelligence & Data Science [20210725]\Career Road-Map for Artificial Intelligence & Data Science.pptx
~\Machine Learning\Classification\Naive Bayes Classifier for Spam Filtering\Naive Bayes Classifier for Spam Filtering.pptx
~\Machine Learning\Regression\Linear Regression (Theory 20210715)\Linear Regression.pptx
~\Machine Learning\Regression\Improvements over OLS (Forward Stepwise, Ridge, Lasso, LARS)\Improvements over OLS (Forward Stepwise, Ridge, Lasso, LARS).pptx
~\Natural Language Processing\Session 1 on `Understanding, Analyzing and Generating Text'\Session 1 on `Understanding, Analyzing and Generating Text'.pptx
~\Natural Language Processing\Sentiment Analysis\VADER - Rule Based Approach to Sentiment Analysis\Session 2 on `Understanding, Analyzing and Generating Text'.pptx
~\Natural Language Processing\Word Embeddings\Document Parsing, Document based Embeddings and Word Embeddings\Document Parsing, Document based Embeddings and Word Embeddings.pptx
~\Web Development\JavaScript\JavaScript Intro (Dev Console, Data Types and Operators)\JavaScript.pptx 

~\vscode>xcopy /s *.ppt* F:\xcopy

~\Artificial Intelligence\AI and disciplines it borrows ideas from (20210304)\AI and disciplines it borrows from (20210304).pptx
~\Artificial Intelligence\Career Road Map for Artificial Intelligence & Data Science [20210725]\Career Road-Map for Artificial Intelligence & Data Science.pptx
~\Machine Learning\Classification\Naive Bayes Classifier for Spam Filtering\Naive Bayes Classifier for Spam Filtering.pptx
~\Machine Learning\Regression\Linear Regression (Theory 20210715)\Linear Regression.pptx
~\Machine Learning\Regression\Improvements over OLS (Forward Stepwise, Ridge, Lasso, LARS)\Improvements over OLS (Forward Stepwise, Ridge, Lasso, LARS).pptx
~\Natural Language Processing\Session 1 on `Understanding, Analyzing and Generating Text'\Session 1 on `Understanding, Analyzing and Generating Text'.pptx
~\Natural Language Processing\Sentiment Analysis\VADER - Rule Based Approach to Sentiment Analysis\Session 2 on `Understanding, Analyzing and Generating Text'.pptx
~\Natural Language Processing\Word Embeddings\Document Parsing, Document based Embeddings and Word Embeddings\Document Parsing, Document based Embeddings and Word Embeddings.pptx
~\Web Development\JavaScript\JavaScript Intro (Dev Console, Data Types and Operators)\JavaScript.pptx 
9 File(s) copied 
    

Xcopy Help

~\vscode>xcopy /? Copies files and directory trees. XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W] [/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U] [/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z] [/B] [/J] [/EXCLUDE:file1[+file2][+file3]...] [/COMPRESS] source Specifies the file(s) to copy. destination Specifies the location and/or name of new files. /A Copies only files with the archive attribute set, doesn't change the attribute. /M Copies only files with the archive attribute set, turns off the archive attribute. /D:m-d-y Copies files changed on or after the specified date. If no date is given, copies only those files whose source time is newer than the destination time. /EXCLUDE:file1[+file2][+file3]... Specifies a list of files containing strings. Each string should be in a separate line in the files. When any of the strings match any part of the absolute path of the file to be copied, that file will be excluded from being copied. For example, specifying a string like \obj\ or .obj will exclude all files underneath the directory obj or all files with the .obj extension respectively. /P Prompts you before creating each destination file. /S Copies directories and subdirectories except empty ones. /E Copies directories and subdirectories, including empty ones. Same as /S /E. May be used to modify /T. /V Verifies the size of each new file. /W Prompts you to press a key before copying. /C Continues copying even if errors occur. /I If destination does not exist and copying more than one file, assumes that destination must be a directory. /Q Does not display file names while copying. /F Displays full source and destination file names while copying. /L Displays files that would be copied. /G Allows the copying of encrypted files to destination that does not support encryption. /H Copies hidden and system files also. /R Overwrites read-only files. /T Creates directory structure, but does not copy files. Does not include empty directories or subdirectories. /T /E includes empty directories and subdirectories. /U Copies only files that already exist in destination. /K Copies attributes. Normal Xcopy will reset read-only attributes. /N Copies using the generated short names. /O Copies file ownership and ACL information. /X Copies file audit settings (implies /O). /Y Suppresses prompting to confirm you want to overwrite an existing destination file. /-Y Causes prompting to confirm you want to overwrite an existing destination file. /Z Copies networked files in restartable mode. /B Copies the Symbolic Link itself versus the target of the link. /J Copies using unbuffered I/O. Recommended for very large files. /COMPRESS Request network compression during file transfer where applicable. The switch /Y may be preset in the COPYCMD environment variable. This may be overridden with /-Y on the command line.

Application of "for" with "xcopy" to discard folder structure but keep the files

~\vscode>for /r %i in (*.ppt*) do xcopy /Y "%i" f:\someplace ~\vscode>xcopy /Y "~\vscode\Lessons in Technology\Artificial Intelligence\AI and disciplines it borrows ideas from (20210304)\AI and disciplines it borrows from (20210304).pptx" f:\someplace Does F:\someplace specify a file name or directory name on the target (F = file, D = directory)? D ~\vscode\Lessons in Technology\Artificial Intelligence\AI and disciplines it borrows ideas from (20210304)\AI and disciplines it borrows from (20210304).pptx 1 File(s) copied ~\vscode>xcopy /Y "~\vscode\Lessons in Technology\Artificial Intelligence\Career Road Map for Artificial Intelligence & Data Science [20210725]\Career Road-Map for Artificial Intelligence & Data Science.pptx" f:\someplace ~\vscode\Lessons in Technology\Artificial Intelligence\Career Road Map for Artificial Intelligence & Data Science [20210725]\Career Road-Map for Artificial Intelligence & Data Science.pptx 1 File(s) copied ~\vscode>xcopy /Y "~\vscode\Lessons in Technology\Machine Learning\Classification\Naïve Bayes Classifier for Spam Filtering\Naïve Bayes Classifier for Spam Filtering.pptx" f:\someplace ~\vscode\Lessons in Technology\Machine Learning\Classification\Naïve Bayes Classifier for Spam Filtering\Naïve Bayes Classifier for Spam Filtering.pptx 1 File(s) copied ~\vscode>xcopy /Y "~\vscode\Lessons in Technology\Machine Learning\Regression\Linear Regression (Theory 20210715)\Linear Regression.pptx" f:\someplace ~\vscode\Lessons in Technology\Machine Learning\Regression\Linear Regression (Theory 20210715)\Linear Regression.pptx 1 File(s) copied ~\vscode>xcopy /Y "~\vscode\Lessons in Technology\Machine Learning\Regression\Improvements over OLS (Forward Stepwise, Ridge, Lasso, LARS)\Improvements over OLS (Forward Stepwise, Ridge, Lasso, LARS).pptx" f:\someplace ~\vscode\Lessons in Technology\Machine Learning\Regression\Improvements over OLS (Forward Stepwise, Ridge, Lasso, LARS)\Improvements over OLS (Forward Stepwise, Ridge, Lasso, LARS).pptx 1 File(s) copied ~\vscode>xcopy /Y "~\vscode\Lessons in Technology\Natural Language Processing\Session 1 on ‘Understanding, Analyzing and Generating Text'\Session 1 on ‘Understanding, Analyzing and Generating Text'.pptx" f:\someplace ~\vscode\Lessons in Technology\Natural Language Processing\Session 1 on ‘Understanding, Analyzing and Generating Text'\Session 1 on ‘Understanding, Analyzing and Generating Text'.pptx 1 File(s) copied ~\vscode>xcopy /Y "~\vscode\Lessons in Technology\Natural Language Processing\Sentiment Analysis\VADER - Rule Based Approach to Sentiment Analysis\Session 2 on ‘Understanding, Analyzing and Generating Text'.pptx" f:\someplace ~\vscode\Lessons in Technology\Natural Language Processing\Sentiment Analysis\VADER - Rule Based Approach to Sentiment Analysis\Session 2 on ‘Understanding, Analyzing and Generating Text'.pptx 1 File(s) copied ~\vscode>xcopy /Y "~\vscode\Lessons in Technology\Natural Language Processing\Word Embeddings\Document Parsing, Document based Embeddings and Word Embeddings\Document Parsing, Document based Embeddings and Word Embeddings.pptx" f:\someplace ~\vscode\Lessons in Technology\Natural Language Processing\Word Embeddings\Document Parsing, Document based Embeddings and Word Embeddings\Document Parsing, Document based Embeddings and Word Embeddings.pptx 1 File(s) copied ~\vscode>xcopy /Y "~\vscode\Lessons in Technology\Web Development\JavaScript\JavaScript Intro (Dev Console, Data Types and Operators)\JavaScript.pptx" f:\someplace ~\vscode\Lessons in Technology\Web Development\JavaScript\JavaScript Intro (Dev Console, Data Types and Operators)\JavaScript.pptx 1 File(s) copied ~\vscode>

When writing code in .BAT file

If you are using this in a batchfile, you should double the % like this: for /r %%i in (*.txt) do xcopy /Y "%%i" g:\someplace
Tags: Technology,Windows CMD,

No comments:

Post a Comment