Windows 7 - Xcopy32.exe

BenCasey
4StarLounger
Posts: 495
Joined: 13 Sep 2013, 07:56

Windows 7 - Xcopy32.exe

Post by BenCasey »

Hi,
I am trying to locate xcopy32.exe for a Windows 7 Pro machine.
Nothing found on microsoft site and I am a bit wary of downloading from some the the 'giveaway' sites.
Can anybody point me to a safe place to download it?

The problem I am having is trying to create a Bat file but xcopy won't recognise the /i switch unless it is entered directly from the ms-dos window.

Thanks
Regards, Ben

"Science is the belief in the ignorance of the experts."
- Richard Feynman

User avatar
HansV
Administrator
Posts: 78797
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Windows 7 - Xcopy32.exe

Post by HansV »

xcopy.exe and xcopy32.exe are identical, and in recent Windows versions, only xcopy.exe is available. (The last version to have xcopy32 was Windows ME, I think)

Perhaps you can use robocopy?
Best wishes,
Hans

BenCasey
4StarLounger
Posts: 495
Joined: 13 Sep 2013, 07:56

Re: Windows 7 - Xcopy32.exe

Post by BenCasey »

Thanks, I will have a look at that.

There are many differences between the switches on the two. The MS site lists them.

Regards
Regards, Ben

"Science is the belief in the ignorance of the experts."
- Richard Feynman

BenCasey
4StarLounger
Posts: 495
Joined: 13 Sep 2013, 07:56

Re: Windows 7 - Xcopy32.exe

Post by BenCasey »

In spite of many searches I never could find a download site for RoboCopy.
I did find that it came preinstalled on Win7 but when I invoke it, it just flashes for a moment and then its gone again.

Any other alternatives, Hans?

Thanks
Regards, Ben

"Science is the belief in the ignorance of the experts."
- Richard Feynman

User avatar
John Gray
PlatinumLounger
Posts: 5437
Joined: 24 Jan 2010, 08:33
Location: A cathedral city in England

Re: Windows 7 - Xcopy32.exe

Post by John Gray »

Start up a Command Prompt window, then run ROBOCOPY /?
This will tell you what the parameters are.

If you say what you want to do, then someone can probably assist with what you need.
John Gray

If you are having problems with solitude, you are not alone.

PJ_in_FL
5StarLounger
Posts: 1113
Joined: 21 Jan 2011, 16:51
Location: Florida

Re: Windows 7 - Xcopy32.exe

Post by PJ_in_FL »

Robocopy is very feature-rich, a euphemism for really, really difficult to figure out.

I've just started looking into it myself and found two helper apps on MS Technet you may want to look at, too:

1. Robocopy GUI - http://technet.microsoft.com/en-us/maga ... light.aspx

2. RichCopy - http://technet.microsoft.com/en-us/maga ... light.aspx

Also a script generator is on SourceForge:
RoboCop RoboCopy - Unique Robocopy GUI Skin and script generator with Progress Monitoring (site)

All of these suggestions come untried. Just a product of some of today's research that I thought might be helpful and that I'm going to be looking into further.
PJ in (usually sunny) FL

User avatar
John Gray
PlatinumLounger
Posts: 5437
Joined: 24 Jan 2010, 08:33
Location: A cathedral city in England

Re: Windows 7 - Xcopy32.exe

Post by John Gray »

PJ_in_FL wrote:Robocopy is very feature-rich, a euphemism for really, really difficult to figure out.
It's not really at all difficult to use if you've been using it since XP became available!
Where were you?! :evilgrin:
John Gray

If you are having problems with solitude, you are not alone.

BenCasey
4StarLounger
Posts: 495
Joined: 13 Sep 2013, 07:56

Re: Windows 7 - Xcopy32.exe

Post by BenCasey »

Thanks Guys. Got RoboCopy working now. Sometimes I can be so dumb! John put me back on track when he mentioned about opening a dos prompt. Of course it was opening and closing when I click on the robocopy.ext because I hadn't given it anything to do!!!
Once the penny dropped (thanks John) then I wrote the batch file and it works ok.

What I was doing was to create a batch file to auto backup up a folder/sub folders to alternative drives.
Looking back, I suppose I should have been search for a backup program. Oh well.

Thanks all
Regards, Ben

"Science is the belief in the ignorance of the experts."
- Richard Feynman

PJ_in_FL
5StarLounger
Posts: 1113
Joined: 21 Jan 2011, 16:51
Location: Florida

Re: Windows 7 - Xcopy32.exe

Post by PJ_in_FL »

John Gray wrote:
PJ_in_FL wrote:Robocopy is very feature-rich, a euphemism for really, really difficult to figure out.
It's not really at all difficult to use if you've been using it since XP became available!
Where were you?! :evilgrin:
I've been using xplorer2 pro (x2), and now xplorer2 ultimate, since 2006, on every computer I own, and if on a computer I don't own, then a portable version of x2 from a thumb drive. Before that xcopy and I were "friendly". I didn't even know RoboCopy was native to Windows until yesterday! :scratch:

So in short, I never really needed anything else except x2 for copying, syncing, etc. :shrug:

That said, I have one function I do a lot -- moving large files from my office / work PCs, running XP and Win 7, to the PC that drives the home theater, running Vista. For some reason, that operation will bog down the source system even though the processor load appears to be minimal and the data rate across a 65MIPS WiFi link to the Vista PC pegs out at 1.65MB / sec. X2 development is a one-man show, and networks aren't his thing, so I thought I'd try to "outsource" this operation to something that was more network-friendly. Yesterday I sat down to look at options and thought of 3rd party copy programs and started my research with Robocopy (which I found isn't 3rd party :doh: ). That's the first time I ever looked at it, so my post is just showing my ignorance and the result of about 1 hour or so of research.

With that as a preamble, what *I* need help with is to develop two drag and drop targets on the desktop that I can drag one or more folders onto and have RoboCopy create the folders in specific locations on the remote drive, e.g. I drag ..\folder1\many.files (from x2, of course) and drop onto a desktop icon. The Robocopy command associated with that icon creates \folder1 under \\TheaterPC\Target1 and copies all files and subfolders from the local ..\folder1 to the new \\TheaterPC\Target1\folder1. The output is the creation of \\TheaterPC\Target1\folder1\many.files.

One desktop icon copies to ..\Target1 and the other desktop icon copies to ..\Targer2.

Simple, right? So what is the .CMD files and/or Robocopy command that makes that simple task happen???
PJ in (usually sunny) FL

BenCasey
4StarLounger
Posts: 495
Joined: 13 Sep 2013, 07:56

Re: Windows 7 - Xcopy32.exe

Post by BenCasey »

If it helps, this is the code I run from a batch file to copy to 2 x memory sticks on my current PC and another computer on my wireless network called Server:

robocopy c:\movcon \\SERVER\MainC\movcon /e /create /v /log:copylog.txt /tee
robocopy c:\movcon h:\movcon /e /create /v /log+:copylog.txt /tee
robocopy c:\movcon i:\movcon /e /create /v /log+:copylog.txt /tee

The /create means it will create the folder/directory if not already present.
The copylog.txt will be created in the same folder as the batch file (in my case it is on my desktop). If you run it manually from a dos prompt the copylog.txt file will be found in the ../users/... etc folder.
One other thing is that the connection to the \\Server\ pc was initially made manually with the box ticked to remember the credentials.

Hope that helps
Regards, Ben

"Science is the belief in the ignorance of the experts."
- Richard Feynman

User avatar
John Gray
PlatinumLounger
Posts: 5437
Joined: 24 Jan 2010, 08:33
Location: A cathedral city in England

Re: Windows 7 - Xcopy32.exe

Post by John Gray »

Ben, I've never even considered dragging and dropping folders onto an icon pointing to a BATch file, and I greatly doubt that (even if it can be done) you would get the results you require. Perhaps someone who has tried this sort of thing could talk about it?

Might I suggest you look at always including /R:0 and /W:0 in your Robocopy parameters, and look at
/MIR to mirror the source path to the target path
/S to copy subdirectories (if relevant) - I never want empty directories
/COPYALL to copy all the characteristics of files and directories

I've never used /CREATE (or, for that matter, /E) since target directories are created automatically to match those 'occupied' source directories.

I've included a text file which shows the Robocopy Windows 7 parameters which are added to the Windows XP ones.
Robocopy_XP_W7.txt
You do not have the required permissions to view the files attached to this post.
John Gray

If you are having problems with solitude, you are not alone.

BenCasey
4StarLounger
Posts: 495
Joined: 13 Sep 2013, 07:56

Re: Windows 7 - Xcopy32.exe

Post by BenCasey »

Hi John, I think it was PJ_inFL that wanted the drag-n-drop option.
Mine is just a plain old batch file sitting on my desktop and when I double-click it, it runs and does its job in seconds. I check the output text file just to check but it all works ok (for now anyway).
I looked at the /R and /W switches but I don't need them. There have been no contention so far but I will bear them in mind.

I tried the copyall but it told me I didn't have the required permissions !! Whatever that means. As it was not important to me, I didn't delve into it.

I actually do need the /e switch because the program that I am copying used all the supporting files and folders even if they are not in use at a particular time. When I transfer them to somebody else's PC I need it to be complete. They simple copy everything from the memory-stick and they are good to go.

Thanks for the attachment.
Regards, Ben

"Science is the belief in the ignorance of the experts."
- Richard Feynman

PJ_in_FL
5StarLounger
Posts: 1113
Joined: 21 Jan 2011, 16:51
Location: Florida

Re: Windows 7 - Xcopy32.exe

Post by PJ_in_FL »

Well, it's a little more complicated than that so let me try to create a word picture:

Source:
  • G:\WorkArea\FileTypeA\FolderA\many.files
    G:\WorkArea\FileTypeA\FolderB\folder1\many.files
    G:\WorkArea\FileTypeA\FolderB\folder2\many.files
    G:\WorkArea\FileTypeA\FolderC\many.files
Destination:
  • \\TheaterPC\FileTypeA
Result:
  • \\TheaterPC\FileTypeA\FolderA\many.files
    \\TheaterPC\FileTypeA\FolderB\folder1\many.files
    \\TheaterPC\FileTypeA\FolderB\folder2\many.files
    \\TheaterPC\FileTypeA\FolderC\many.files
Straight Robocopy, like Xcopy before it, would instead create:
  • \\TheaterPC\FileTypeA\WorkArea\FileTypeA\FolderA\many.files
    \\TheaterPC\FileTypeA\WorkArea\FileTypeA\FolderB\folder1\many.files
    \\TheaterPC\FileTypeA\WorkArea\FileTypeA\FolderB\folder2\many.files
    \\TheaterPC\FileTypeA\WorkArea\FileTypeA\FolderC\many.files
Which is not the desired result.

Appears the .CMD file will need some intelligence in building the Robocopy commands, but the list of parameters can be obtained easily enough from this CMD file I adapted from Stackoverflow:

Code: Select all

@echo off

setlocal ENABLEDELAYEDEXPANSION
rem Take the cmd-line, remove all until the first parameter
set "ZZparams=!cmdcmdline:~0,-1!"
set "ZZparams=!ZZparams:*" =!"
set ZZcount=0

rem Split the parameters on spaces but respect the quotes
rem creates separate items for each parameter dragged onto the shortcut
for %%G IN (!ZZparams!) do (
  set /a ZZcount+=1
  set "ZZitem_!ZZcount!=%%~G"
  rem echo !ZZcount! %%~G
)

rem list the parameters -- here is where the individual parameters will need to be processed
rem   and the Robocopy commands created and executed
for /L %%n in (1,1,!ZZcount!) DO (
  echo Robocopy "!ZZitem_%%n!" \\TheaterPC\FolderA
)

rem Pause here to check the results of the command generation above
pause

REM ** The exit is important, so the cmd.exe doesn't try to execute commands after ampersands
exit
So now comes the hard part to strip the preamble portion of the path (G:\WorkArea\FileTypeA) and let Robocopy operate only on the folder structure below that.

Suggestions most welcome!
PJ in (usually sunny) FL

BenCasey
4StarLounger
Posts: 495
Joined: 13 Sep 2013, 07:56

Re: Windows 7 - Xcopy32.exe

Post by BenCasey »

PJ_in_FL wrote:Well, it's a little more complicated than that so let me try to create a word picture:
Suggestions most welcome!
Using a RoboCopy batch file on my desktop and simulating the folders you mention, the following worked for me. It will create any necessary folders if they are not there. The log file will give you chapter and verse.

Code: Select all

robocopy C:\WorkArea\FileTypeA\FolderA \\SERVER\MainC\TheaterPC\FileTypeA\FolderA  /e /create /v /log:copylog.txt /tee
robocopy C:\WorkArea\FileTypeA\FolderB \\SERVER\MainC\TheaterPC\FileTypeA\FolderB  /e /create /v /log+:copylog.txt /tee
robocopy C:\WorkArea\FileTypeA\FolderC \\SERVER\MainC\TheaterPC\FileTypeA\FolderC  /e /create /v /log+:copylog.txt /tee
HTH
Regards, Ben

"Science is the belief in the ignorance of the experts."
- Richard Feynman

PJ_in_FL
5StarLounger
Posts: 1113
Joined: 21 Jan 2011, 16:51
Location: Florida

Re: Windows 7 - Xcopy32.exe

Post by PJ_in_FL »

BenCasey wrote:
PJ_in_FL wrote:Well, it's a little more complicated than that so let me try to create a word picture:
Suggestions most welcome!
Using a RoboCopy batch file on my desktop and simulating the folders you mention, the following worked for me. It will create any necessary folders if they are not there. The log file will give you chapter and verse.

Code: Select all

robocopy C:\WorkArea\FileTypeA\FolderA \\SERVER\MainC\TheaterPC\FileTypeA\FolderA  /e /create /v /log:copylog.txt /tee
robocopy C:\WorkArea\FileTypeA\FolderB \\SERVER\MainC\TheaterPC\FileTypeA\FolderB  /e /create /v /log+:copylog.txt /tee
robocopy C:\WorkArea\FileTypeA\FolderC \\SERVER\MainC\TheaterPC\FileTypeA\FolderC  /e /create /v /log+:copylog.txt /tee
HTH
Ben,

Thanks for taking time to reply to my query! :grin:

I also have come up with a solution but it has one catch - "special" characters! I often use the "!" character in folder and file names to get items sorted at the top of the list. Unfortunately the method I'm using below to extract the pieces of the folder spec to feed to Robocopy fails when "!" characters, and probably others that I haven't found yet, are in the folder spec ... :groan:

Here's what I have so far:

Code: Select all

@echo off
    setlocal ENABLEDELAYEDEXPANSION

rem Take the cmd-line, remove all until the first parameter
    set "ZZparams=!cmdcmdline:~0,-1!"
    set "ZZparams=!ZZparams:*" =!"

rem Add an ECHO here to look at the input from the command line
echo Command line: !ZZparams!

rem Split the parameters on spaces but respect the quotes
rem creates separate COMMAND for each parameter dragged onto the shortcut
    for %%G IN (!ZZparams!) do (
        echo Input: %%G
        echo Robocopy "%%~dpG" "\\TheaterPC\FolderA\%%~nxG" *.* /R:0 /W:0 /E /COPYALL
rem Add a pause here to look at the final command lines generated
pause
)

REM ** The exit is important, so the cmd.exe doesn't try to execute commands after ampersands
exit
But here's the puzzling results, edited for clarity:
  • Command line: C:\Users\UID\Desktop\!Me C:\Users\UID\Desktop\!Tools C:\Users\UID\Desktop\_temp "C:\Users\UID\Desktop\Multi Word Folder Example" C:\Users\UID\Desktop\PERSONAL.xlsb.Modules

    Input: C:\Users\UID\Desktop\Me
    Robocopy "C:\Users\UID\Desktop\" "\\TheaterPC\FolderA\0 /W:0 /E /COPYALL

    Input: C:\Users\UID\Desktop\Tools
    Robocopy "C:\Users\UID\Desktop\" "\\TheaterPC\FolderA\0 /W:0 /E /COPYALL

    Input: C:\Users\UID\Desktop\_temp
    Robocopy "C:\Users\UID\Desktop\" "\\TheaterPC\FolderA\_temp" *.* /R:0 /W:0 /E /COPYALL

    Input: "C:\Users\UID\Desktop\Multi Word Folder Example"
    Robocopy "C:\Users\UID\Desktop\" "\\TheaterPC\FolderA\Multi Word Folder Example" *.* /R:0 /W:0 /E /COPYALL

    Input: C:\Users\UID\Desktop\PERSONAL.xlsb.Modules
    Robocopy "C:\Users\UID\Desktop\" "\\TheaterPC\FolderA\PERSONAL.xlsb.Modules" *.* /R:0 /W:0 /E /COPYALL
PJ in (usually sunny) FL

BenCasey
4StarLounger
Posts: 495
Joined: 13 Sep 2013, 07:56

Re: Windows 7 - Xcopy32.exe

Post by BenCasey »

I think (from memory) that the "pipe" is used by DOS and Systems.
It is a bad choice. Perhaps I could suggest the underscore (_) instead.]
Regards, Ben

"Science is the belief in the ignorance of the experts."
- Richard Feynman

BenCasey
4StarLounger
Posts: 495
Joined: 13 Sep 2013, 07:56

Re: Windows 7 - Xcopy32.exe

Post by BenCasey »

I am also suggesting that you ditch whatever that is that you are struggling with and just go with a simple batch file. Far easier and easier to debug as well with a ton of options.

It looks as if you are struggling with something that RoboCopy did in 3 lines.

I never knew about RoboCopy until this thread even though it had been on my system for years. MS never told me! What else lies undiscovered, I wonder.
Regards, Ben

"Science is the belief in the ignorance of the experts."
- Richard Feynman

PJ_in_FL
5StarLounger
Posts: 1113
Joined: 21 Jan 2011, 16:51
Location: Florida

Re: Windows 7 - Xcopy32.exe

Post by PJ_in_FL »

The part i'm struggling with is to make the shortcut generic enough to handle any folder dropped on it and put it in the correct structure on the destination.

I'm probably going to have to resort to a hybrid of .CMD and VBScript or pure VBScript to build the ROBOCOPY command lines and covering all the bases. The vagarities of the .CMD parameter expansion appears to eliminate that option. Since I actually have multiple source and destination structures, I can then use VBScript to detect which file type and adjust accordingly instead of creating separate shortcuts for each type (and the error checking to be sure I dropped the folder on the correct shortcut :sad: :confused: ). I'll work that out and post the solution for others to use the techniques for multiple item processing via DnD using ROBOCOPY with VBScript ....

Before going down that radical change, I may try one cross-post on WS as there's a group of very BATCH-centric experts there, and the things I've seen them come up with are amazing.
PJ in (usually sunny) FL

PJ_in_FL
5StarLounger
Posts: 1113
Joined: 21 Jan 2011, 16:51
Location: Florida

Re: Windows 7 - Xcopy32.exe

Post by PJ_in_FL »

Well, to the 1 person still watching this thread ...

I've scrapped .CMD completely for the file transfer operation, choosing to bite the bullet and use VBScript to drive the ROBOCOPY commands. :clapping:

Just too many issues with variable expansion in .CMD files, and, besides the simple trial I ran showed I can drop almost 32K characters worth of folders onto a desktop icon containing a "cscript copyfiles.vbs" command and process them one at a time to my hearts content. :grin:

The final justification for this approach was confirmed by a test transfer using simple DnD between two WE windows. A similar transfer from within X2 would lock up or slow down Xplorer2 and, strangely enough, Chrome. Clicks to either program are ignored for sometimes a minute or two! Although the native Windows transfer ran about 30% slower, I could continue to use X2 and Chrome without delay. So the reduced impact on system response makes the effort seem a worthwhile endeavor.

Thus comes my final query to the good folk herein ... what benefits (or pitfalls) come from using the restartable and / or backup options? In my case, I have control of both systems, but occasionally I may start a transfer when the destination is not available (I forgot to boot it up first :groan: ). Tales of your experiences and conjectures are both welcome! :thankyou:
PJ in (usually sunny) FL

BenCasey
4StarLounger
Posts: 495
Joined: 13 Sep 2013, 07:56

Re: Windows 7 - Xcopy32.exe

Post by BenCasey »

Would something like this work?

Code: Select all

Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")

If fso.FileExists("C:\myFolder\newFile.txt") Then
    'Perform Code
End If
I just done a google search for vbs if exists and there are lots of hits.
HTH
Regards, Ben

"Science is the belief in the ignorance of the experts."
- Richard Feynman