Copy and paste the batch file or shortcut in the startup folder. Xcopy command examples, options, switches, and more. Here is an a to z list of windows cmd commands which will be beneficial to you. Once you get the hang of these commands, you can do most of your work more. Xcopy can copy all files including subdirectories recursively and can replicate the source directory structure as is. If youre trying to decide to run xcopy or xcopy32, always use. The following table describes the optional switches you can use with xcopy and xcopy32. This is a batch command that associates an extension with a file type ftype, displays existing associations, or deletes an association. I would like to see an example of writing a batch program to copy a file. In this chapter, we will look at some of the frequently used batch commands.
Xcopy32 was a command available with microsoft windows 95 and windows 98. The xcopy command is also a dos command available in msdos. Xcopy is a built in command on windows os which has advanced features than the basic copy command. The xcopy command is available from within the command prompt in all windows operating systems including windows 10, windows 8, windows 7, windows vista, windows xp, windows 98, etc. This batch command formats a disk to use windowssupported file system such as fat. On windows 10, a batch file is a special kind of text file that typically has a. Copying files in a batch file january 2008 forums cnet. Although it can be run by itself, it is executed automatically when xcopy is used on a 32bit file system like fat32. For early 16bit file systems that had both xcopy and xcopy32, the xcopy command is used.
As discussed in the previous tutorial, a batch file is an unformatted text file or script file which contains multiple batch file commands or instructions to achieve a certain task. The problem was the name xcopy,bat on my desktop, and i was running the command from there, so it was executing the xcopy. Switches that you can use with xcopy and xcopy32 commands. This switch copies hidden and system files in msdos mode. Type the following command, and click the ok button. This will not work on the new laptop with windows 7. Batch file copy command windows xp home and professional. This batch command helps in making changes to a different directory. Batch file copy command posted in windows xp home and professional. This batch command shows the version of msdos you are using. In windows millennium edition me only, an h switch is added to the xcopy and the xcopy32 commands. How to create and run a batch file on windows 10 windows. If xcopy encounters an error, the batch program reads the exit code and goes to the label indicated in the appropriate if errorlevel statement, then displays the appropriate message and exits from the batch program. A to z list of windows cmd commands command line reference.