Computer Hope

Microsoft => Microsoft DOS => Topic started by: fabricius on November 04, 2012, 04:41:07 AM

Title: xcopy and Windows 7
Post by: fabricius on November 04, 2012, 04:41:07 AM
I just bought a Samsung Ultrabook with Windows 7 Home Premium. I use Dos batch files to backup my data but these files do not seem to work. I went into the Dos command prompt and tried to use the xcopy command, but I get a reply: xcopy is not a recognized internal or external command... The same goes with robocopy, though both of them should be available in Windows 7. The copy command works, but I need a command that would allow me to copy also subdirectories (switch D) and leave unchanged files alone (switch S).
What can I do?
Title: Re: xcopy and Windows 7
Post by: foxidrive on November 04, 2012, 04:45:44 AM
Does it have "c:\Windows\System32\xcopy.exe"

If so then maybe the path is screwed
Title: Re: xcopy and Windows 7
Post by: Salmon Trout on November 04, 2012, 05:32:58 AM
Your prompt session may not have the necessary Administrator permissions. In Windows 7 If xcopy/robocopy don't work from an elevated command prompt then maybe the account you are using does not have the needed NTFS permisssions for the folder you are copying to or from.

http://www.sevenforums.com/tutorials/783-elevated-command-prompt.html

Title: Re: xcopy and Windows 7
Post by: foxidrive on November 04, 2012, 06:47:34 AM
Salmon Trout: surely the error would be different if it was a permissions issue.

Title: Re: xcopy and Windows 7
Post by: Salmon Trout on November 04, 2012, 09:32:57 AM
Salmon Trout: surely the error would be different if it was a permissions issue.

A good point; the OP said he "just bought" the ultrabook; if it is brand new you would expect the PATH system variable to be still set to the default and therefore find xcopy and robocopy. Maybe Fabricious should type PATH at a prompt and tell us what he or she gets? If a new variable, carelessly called %path% is in existence, that will screw things up. Or a rogue program installer could have mangled it.


Title: Re: xcopy and Windows 7
Post by: patio on November 04, 2012, 09:39:41 AM
Fabricious are you sure that isn't Win7 Starter ?/ ? ?
Title: Re: xcopy and Windows 7
Post by: rogerk8 on November 25, 2012, 03:00:25 PM
Hi Fabricius!

I am a newbie at this and do not know much. But I would like to try and help.

Maybe you get this strange comment "xcopy is not a recognized internal or external command" because you haven't used it correctly (I imagine and hope MS-DOS is properly emulated even in Windows 7)

I really don't know (runs XP) but I think you should be able to, in the command prompt, run:

xcopy c: e: /d /s

if you want to copy all new files (with respect to the residing files in the destination drive, here called e:) from c: to the destination drive, e:

Using the /d-switch will thus enable copying of new files only

and

Using the /s-switch will enable copying of all subdirectories.

Actually I think I will use this command the next time I want to back-up my music. Because I do not want to wait another two hours for all my 5GB music to be copied and Windows actually sucks at this kind of synchronization.

MS-DOS rules!  :D

Best regards, Roger
Title: Re: xcopy and Windows 7
Post by: BC_Programmer on November 25, 2012, 03:04:20 PM
Fabricious are you sure that isn't Win7 Starter ?/ ? ?

+1, I'm not 100% sure but it would make sense that Win7 Starter doesn't have Xcopy or RoboCopy installed, and netbooks almost always come with the Starter Edition.
Title: Re: xcopy and Windows 7
Post by: rogerk8 on November 27, 2012, 04:44:59 PM
Hi!

I would like to refrase my command to:

xcopy c:\path_S e:\folder_D /d /s

where

path_S is the path to your folder which you want to copy

folder_D is the folder you want to create and/or copy to (I think you will be prompted if the folder does not excist)

/d is the switch that makes all the files that are newer than the files in the destination folder (folder_D) being copied

/s is the switch that makes all the subdirectories in the source folder (path_S) being copied

The above destiction is neccesary due to the fact that xcopy cannot copy itself (yields a so called sharing violation).

Good luck!

Best regards, Roger
PS
If you want to copy to a simple USB-stick, destination drive might differ from e:

Title: Re: xcopy and Windows 7
Post by: BC_Programmer on November 27, 2012, 04:47:58 PM
Personally I ignored your post since it doesn't even come close to addressing the Original Poster's problem.