
The above command copies the file to the My Documents folder of the current logged in user. Like USERPROFILE, SystemRoot, ProgramFiles, TEMP, WINDIR, APPDATA, HOMEPATH.įor example, to copy a file to a user’s documents folder Copy D:\file.pdf %HOMEPATH%\Documents\ We can use environment variables in the copy command to specify the path of the folders. To copy all files in current folder to another folder copy * D:\dir1\dir2 Use of environment variables However, we can use wildcards to identify a group of files and then copy all of them in a single command.įor example, to copy all excel files from current folder to another folder F:\backup copy *.xls F:\backup\ We can’t specify multiple file names in copy command. If the file name has white space within it, we can wrap up the name in double quotes.Įxample: To copy file, my resume.doc to another folder copy "my resume.doc" D:\data\ Copy multiple files To copy the file 1.doc loated at c:\data\documents to the directory c:\data\newdocs c\> copy c:\data\documents\1.doc c:\data\newdocs\ Copy files with white space in name C:UsersYour NameMy Scripts Copy all your python scripts into. mylogger M圜lassLogger ('TestScriptLog', level'warn') log mylogger.log log ('this is the warn message', 'warn') log ('This is an info message', 'info') And I get a log file with a only. We can assign a different name by specifying the new name in the destination path. To call python scripts directly from the anaconda console command prompt, e.g. Then I include a 'smart' log method which takes the log level (info, warn, error, debug) and creates the correct log statement.

When we specify a directory path as the destination, the files will be copied with the same name.


If the destination file exists, the above command will overwrite the same without asking the user for confirmation. C\> copy /Y c:\dir1\subdir1\file1.txt c:\dir2\subdir2\file2.txt
