Using XCOPY with Windows 7 to copy from network locations
We're trying to use XCOPY to copy files/folders from UNC paths on our network to Windows 7 workstations. In XP, we used to be able to run a command, likexcopy \\servername\share "C:\program files\program name\" /E /Ythis would successfully copy files from a network location to the workstation. I realize that the security model has changed in Windows 7 but I'd like to find a way to get this to run as a batch file for automation sake. Does anyone have any suggestions?Orange County District Attorney
February 3rd, 2010 4:29am

Try the Windows Explorer and drag and drop the files, might be a bit faster. You could use a batch file, a C++ program, script, lots of ways to automate. Windows 7 uses the CMD file extension for batch files.Vote if answered or helpful, I am running for Office (joke)! IT/Developer, Windows/Linux/Mainframe RaidMax Smilodon, 680W, Asus M2NBP-VM CSM AMD X2 4200+, 2GB DDR2-800, x600, more details on my site, need a video card for the Windows machine, the 8600 GT fried
Free Windows Admin Tool Kit Click here and download it now
February 3rd, 2010 5:05am

use robocopy... it is built into windows 7 and is very powerful... here is a example of the command that i use: robocopy x:\ d:\ /E /r:5 /W:5 /a-:rsah /XO /XD "System Volume Information" "*Recycle*"
February 3rd, 2010 7:37am

Run the batch file from an elevated command prompt.Kerry Brown MS-MVP - Windows Desktop Experience
Free Windows Admin Tool Kit Click here and download it now
February 3rd, 2010 7:48am

I can drag and drop or even copy from within Windows Explorer, that works. However, from the workstation with a cmd prompt (elevated or not) XCOPY just doesn't work. I'll give Robocopy a try and see if can copy files from a network UNC instead. Thanks for the suggestions!Orange County District Attorney
February 3rd, 2010 5:43pm

This doesn't work for me either.Orange County District Attorney
Free Windows Admin Tool Kit Click here and download it now
February 3rd, 2010 5:44pm

xcopy is an old tool from the DOS era. Are you trying to backup files? IF so then using an archive program might be more helpful. Some of those have a command line option. On my Linux box there are many choices, on Windows some such as WinRAR are command line friendly. Consult you documentation, you may need to run the program on the host rather then the client.Vote if answered or helpful, I am running for Office (joke)! IT/Developer, Windows/Linux/Mainframe RaidMax Smilodon, 680W, Asus M2NBP-VM CSM AMD X2 4200+, 2GB DDR2-800, x600, more details on my site, need a video card for the Windows machine, the 8600 GT fried
February 3rd, 2010 5:49pm

If it doesn't work from an elevated command prompt then the account you are using does not have the needed NTFS permisssions for the folder you are copying to or from. Check the permissions.Kerry Brown MS-MVP - Windows Desktop Experience
Free Windows Admin Tool Kit Click here and download it now
February 3rd, 2010 6:04pm

The funny thing is, I'm logged in with an account that has Domain Admin permssions. I can copy the folder using Windows Explorer and run the batch file on the local system without a problem. If I open a cmd prompt (regular or elevated) and run the batch file from the network share, xcopy reports that it cannot find the files. Perhaps the batch file is not running under my logged-in credentials when running at the file share?Orange County District Attorney
February 3rd, 2010 6:09pm

We're using xcopy to help install an old legacy program. We first xcopy the files from a network share to a folder on the user's system under C:\program files and then immediately after that we run a .reg file and then finally run a .vbs file that creates a shortcut on the user system. Yes, it is a bit clunky but it's been working. Now that we're moving into Windows 7, we see that the security model seems to have changed so we're trying to work around it somehow.Orange County District Attorney
Free Windows Admin Tool Kit Click here and download it now
February 3rd, 2010 6:11pm

I was able to get ROBOCOPY to do the trick for me. Even using a normal cmd prompt. I'm running a batch file from a cmd prompt that looks like\\server\share\directory\batch.cmdIt kicks off this on the local machinerobocopy \\server\share\directory" "C:\program files (x86)\program" /E /ISIt screams through and copies everything I need.Orange County District Attorney
February 3rd, 2010 6:52pm

Sounds like it might be a project to replace the old software. Modern development tools allow for a convenient installer such as the MSI format.Vote if answered or helpful, I am running for Office (joke)! IT/Developer, Windows/Linux/Mainframe RaidMax Smilodon, 680W, Asus M2NBP-VM CSM AMD X2 4200+, 2GB DDR2-800, x600, more details on my site, need a video card for the Windows machine, the 8600 GT fried
Free Windows Admin Tool Kit Click here and download it now
February 3rd, 2010 6:57pm

Vegan, It is a bit presumptuous to assume that everyone is a developer. A truly large percentage of companies actually purchase software from other companies. Gee, that is what creates a demand for software developers! To assume that everyone asking a question has it within their power to force another company to upgrade to an MSI is ridiculous.
June 24th, 2010 7:47pm

This thread has that tone as the tools mentioned are old standbys from the DOS era when most were using it for development purposes. Windows was harder and many abandoned development. Still lots of us stuck to it. Vote if answered or helpful, I am running for Office (joke)! IT/Developer, Windows/Linux/Mainframe Need a some parts finish the new server, see the site for remaining items needed
Free Windows Admin Tool Kit Click here and download it now
June 24th, 2010 9:33pm

windows 7 also uses BAT as a file extension for batch files
January 3rd, 2011 4:49am

I prefer to use CMD as the old DOS BAT files have different commands available etc. Elected! Your votes and support have got me my 2010 MVP! Developer | Windows IT | Chess | Economics | Hardcore Games | Vegan Advocate | PC Reviews
Free Windows Admin Tool Kit Click here and download it now
January 3rd, 2011 4:50am

I know this was awhile ago and you've probably worked around this but -- share the directory that you want to have access to (\\servername\share in your example) and then on the workstation: map the a network drive to that location (Win7 has a Menu Bar, but it will be hidden. You have to press ALT button in the Explorer and then do Map Network Drive) -- so if you map it to T: for example then instead of: xcopy \\servername\share "C:\program files\program name\" /E /Y you would do: xcopy T:\ "C:\program files\program name\" /E /Y and that should work.
August 11th, 2011 12:14pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics