|
| |||||||||
| Tags: command line, command prompt, dos, invalid parameter, xcopy problem |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| I am not able to do xcopy in DOS
Hi friends, I am in a trouble please, help me out to fix this kind of problem with my command prompt. I am new in using DOS though i use my computer daily but never performed any kind of work in the DOS. When i was doing Xcopy using command prompt. At the c:\> prompt when I typed the following command xcopy /s/y "C:\documents and settings" "D:\documents and settings". After that i was getting Invalid Parameter i.e -"C:\documents Thanks in advance for the help. |
|
#2
| ||||
| ||||
| Re: I am not able to do xcopy in DOS
In Xcopy command, the switches go to the end of the command line, like this given below: Xcopy "C:\junk\*.*" "D:\junk\" /s /y This line will copy everything in the junk folder in C: and then to a junk folder in D drive. First you have to make a "junk" folder on D: in this issue to work properly. Every day I do back up of my entire "My Documents" folder to a folder on D drive. The way I have written it, first time I ran the batch file, it backed up all the entire directory, but next time when I ran it, it backed up only the new files or the files that havebeen updated or changed. Now i run it in my shutdown batch file and it backs up few files and takes only a few seconds to run. Here is the text for the shutdown batch file: @Echo off cls xcopy "C:\Documents and Settings\Alex\My Documents\*.*" "D:\My Documents\" /s /y /H /R /D Remember to Back up my WordPerfect files. xcopy "C:\MyFiles\*.*" "D:\MyFiles\" /s /y /H /R /D Remember to Back up all the files for My Web Page. xcopy "C:\My web page\*.*" "D:\My web page\" /s /y /H /R /D Remember to Back up my email folders and address book. xcopy "C:\Documents and Settings\Alex\Local Settings\Application Data\Identities\{CC1A6FC7-0D07-4169-865D-56EBDD76EB8B}\Microsoft\Outlook Express\*.dbx" "D:\MyEmailFiles-Backup\" /s /y /H /R /D xcopy "C:\Documents and Settings\Alex\My Documents\My Address Books\*.*" "D:\My Address Books" /s /y /H /R /D Remember when the backup is done please Shutdown! %windir%\System32\shutdown.exe -s -t 00 -f In your case, you would be copying all the files in those folders, over and over again. Which is very time consuming I suggest you to add more switches like I have done to copy only new or changed files. |
|
#3
| ||||
| ||||
| Re: I am not able to do xcopy in DOS
I'll provide you some examples about xcopy. 1. xcopy c:\temp /e The above example is the basic xcopy command to copy the files, directories, and subdirectories to the directory you're currently in. 2. xcopy "c:\documents and settings\hope" /e In the above example the xcopy command would copy all files and directories in the user "hope" directory to the directory or drive you're currently in. 3. xcopy h:\*.* /a /e /k The above command would copy everything located on the H drive to the drive you are currently on. |
|
#4
| ||||
| ||||
| Re: I am not able to do xcopy in DOS
After further examination, i was also encountered by this issue. However, i was able to copy the majority of all favorites by using the command which is given below. xcopy c:\windows\favorites\*.* /e /k /i /c I am under the impression that this issue is generated because of the way that Internet Explorer saves the URL using long file names as well as extended characters. |
|
#5
| |||
| |||
| Re: I am not able to do xcopy in DOS
Personally in this type of situation I have always used 'robocopy' which is available for free from the Microsoft website. It is command line based and I believe that this isn't subject to the issues with long filenames. |
|
#6
| ||||
| ||||
| Re: I am not able to do xcopy in DOS
If you are not able perform xcopy operation then you can create a batch program to perform xcopy operations and use the batch if command to process the exit code if an error occurs. For example, the following batch program uses replaceable parameters for the xcopy source and destination parameters: @echo off rem COPYIT.BAT transfers all files in all subdirectories of rem the source drive or directory (%1) to the destination rem drive or directory (%2) xcopy %1 %2 /s /e if errorlevel 4 goto lowmemory if errorlevel 2 goto abort if errorlevel 0 goto exit :lowmemory echo Insufficient memory to copy files or echo invalid drive or command-line syntax. goto exit :abort echo You pressed CTRL+C to end the copy operation. goto exit :exit You can use this batch program to copy all files in the C:\Prgmcode directory and its subdirectories to drive D, type: copyit c:\prgmcode D: Last edited by Lillebror : 28-01-2010 at 08:11 PM. |
|
#7
| ||||
| ||||
| Re: I am not able to do xcopy in DOS
Some more xcopy commands: 1.To copy all the files and subdirectories (including any empty subdirectories) from drive A to drive B, type: xcopy a: b: /s /e 2. To include any system or hidden files in the previous example, add the/h command-line option as follows: xcopy a: b: /s /e /h 3. To update files in the \Reports directory with the files in the \Rawdata directory that have changed since December 29, 1993, type: xcopy \rawdata \reports /d:12-29-1993 4. To update all the files that exist in \Reports in the previous example, regardless of date, type: xcopy \rawdata \reports /u 5. To obtain a list of the files to be copied by the previous command (that is, without actually copying the files), type: xcopy \rawdata \reports /d:12-29-1993 /l > xcopy.out The file Xcopy.out lists every file that is to be copied. 6. To copy the \Customer directory and all subdirectories to the directory \\Public\Address on network drive H:, retain the read-only attribute, and be prompted when a new file is created on H:, type: xcopy \customer h:\public\address /s /e /k /p 7. To issue the previous command, ensure that xcopy creates the \Address directory if it does not exist, and suppress the message that appears when you create a new directory, add the /i command-line option as follows: xcopy \customer h:\public\address /s /e /k /p /i |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "I am not able to do xcopy in DOS" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Log For xcopy batch file | Beverly Archer | Software Development | 4 | 31-03-2010 02:31 PM |
| Using XCOPY when directory has a space in name | Gavisht | Operating Systems | 4 | 31-03-2010 12:25 PM |
| what is different between xcopy and copy | Sabastiaan | Operating Systems | 4 | 23-01-2010 03:19 AM |
| How to run the Xcopy command on XP | Mansi gala | Operating Systems | 3 | 31-10-2009 07:38 PM |
| Running XCopy using AT command | Ian | Windows Server Help | 8 | 26-09-2007 11:34 PM |