Solved

Xcopy - file not found error message

Posted on 2011-02-22
29
1,203 Views
Last Modified: 2012-05-11
Hi experts,

I have installed the windows AIK-windows 7 tools onto a spare hard drive (drive F) on a desktop computer, on which windows 7 64bit is installed on drive C:

I have created an initial windows PE boot image within drive F and have mounted the image for editing and tried to run the following xcopy command in the deployment tools command promt (running as admin):

Xcopy f:\tools f:\winpe\mount\tools\ /s /I  
but I get a file not found error message an im not sure why, any suggestions and how to resolve? (see attached screenshot)
0
Comment
Question by:kevin1983
  • 10
  • 7
  • 6
  • +2
29 Comments
 
LVL 4

Expert Comment

by:fr0nk
ID: 34950472
Did you mount the .wim with /mountrw?
0
 
LVL 4

Expert Comment

by:fr0nk
ID: 34950493
Meaning: imagex /mountrw <id, find that with /info> f:\winpe\mount
Also, don't forget to do imagex /unmount /commit, after you're done.
0
 

Author Comment

by:kevin1983
ID: 34950554
Yes i mounted but using the following command:

dism /mount-wim /wimfile:f:\winpe\iso\sources\boot.wim /index:1 /mountdir:f:\winpe\mount

This run fine
0
 

Author Comment

by:kevin1983
ID: 34950576
i will unmount and commit when done but i need to resolve the issue first
0
 
LVL 4

Expert Comment

by:fr0nk
ID: 34950654
Can you attach the screenshot? I don't see any attached files.
0
 

Author Comment

by:kevin1983
ID: 34950701
sorry forgot to attach - yes now attached:
Xcopy.jpg
0
 
LVL 30

Expert Comment

by:Zoppo
ID: 34953054
Hi kevin1983,

from the screenshot it looks as if you have no space-characters between the destination path and the two options '/s' and '/i' - it looks as if the command you really use is:

xcopy f:\tools f:\winpe\mount\tools\/s/I

Open in new window


You have to add spaces between the arguments, it should look somehow like this:

xcopy f:\tools f:\winpe\mount\tools\ /s /I

Open in new window


ZOPPO
0
 

Author Comment

by:kevin1983
ID: 34953138
that doesnt seem to work either
0
 

Author Comment

by:kevin1983
ID: 34953164
same eror message with: xcopy f:\tools f:\winpe\mount\tools\ /s /I

(ensuring space where you suggested)
0
 
LVL 24

Expert Comment

by:lionelmm
ID: 34960193
The problem is that you ahve a space between the two /s (space) /i
It should be /s/i (no spaces)

Xcopy f:\tools f:\winpe\mount\tools\ /s_/I--wrong
Xcopy f:\tools f:\winpe\mount\tools\ /s/I--right

But if that doesn't work either
Try this
xcopy f:\tools f:\winpe\mount\tools\ /s/e/i
Copy and paste this
0
 
LVL 30

Expert Comment

by:Zoppo
ID: 34960249
@lionelmm: You wrote

> The problem is that you ahve a space between the two /s (space) /i
> It should be /s/i (no spaces)
>
> Xcopy f:\tools f:\winpe\mount\tools\ /s_/I--wrong

To be honest I don't believe this - I often used xcopy with spaces between the option params without problem. Samples you can find i.e. on Microsoft's MSDN pages even show option parameters seperated by spaces: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/xcopy.mspx

Adding '/e' IMO can't help since the only difference between '/s' and '/e' is that with '/e' even empty directories are copied.

ZOPPO
0
 
LVL 24

Expert Comment

by:lionelmm
ID: 34960330
You're right--I tested the space and did not get an error--I was just relying on my use of it--sorry!
0
 
LVL 30

Expert Comment

by:Zoppo
ID: 34960394
@kevin1983: Are you sure the paths are correct? Especially the 'f:\tools'?

IMO the error message:
> File not found - tools
> 0 File(s) copied
can only occur if the source path isn't found.

If the destination path isn't found 'xcopy ... /i /s' tries to create it - if this creation fails the error message would be different.
0
 
LVL 6

Expert Comment

by:RootsMan
ID: 34960403
Try adding a backslash after the first tools directory.

xcopy f:\tools\ f:\winpe\mount\tools\ /s /I

Open in new window

0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 6

Expert Comment

by:RootsMan
ID: 34960457
Looking at your screen shot, if you're trying to copy the contents of F:\Program Files\Windows AIK\Tools\ to f:\winpe\mount\tools\, then you should be in F:\Program Files\Windows AIK\ when you run the command.

CD to: F:\Program Files\Windows AIK\
Then
xcopy f:tools\ f:\winpe\mount\tools\ /s /I 

Open in new window


Note that there is no backslash after the first f:. This will tell xcopy to copy the "tools" directory from its current location, not the root of drive F:.

0
 

Author Comment

by:kevin1983
ID: 34960689
Thanks all for further comments, ive tried all the suggestions but none of them seem to work:

all have the same error message except RootsMan: i tried what you suggested in your lastest post but i get the following slightly different error message:

invalid path
0 file(s) copied
0
 
LVL 30

Expert Comment

by:Zoppo
ID: 34960910
I still think it's a path-issue. Could you please execute the following command and post the output here:

dir f:\ /s /ad /b

Open in new window


If you think it's too much to post here you can use

dir f:\ /s /ad /b > f:\dirs.txt

Open in new window


and upload 'f:\dirs.txt' here.

ZOPPO
0
 
LVL 24

Expert Comment

by:lionelmm
ID: 34961022
or you can try
xcopy F:\"Program Files"\Windows AIK\Tools\ to f:\winpe\mount\tools\ /s/i
0
 
LVL 6

Expert Comment

by:RootsMan
ID: 34961559
Okay, try without the backslash after the first "tools."

xcopy f:tools f:\winpe\mount\tools\ /s /I 

Open in new window


If that doesn't work, then try:
      
xcopy f:tools\*.* f:\winpe\mount\tools\ /s /I 

Open in new window

0
 
LVL 6

Expert Comment

by:RootsMan
ID: 34961576
Remember you need to run the command from F:\Program Files\Windows AIK\
0
 

Author Comment

by:kevin1983
ID: 34961771
zoppo attached is the output you requested.
Thanks
dirs.txt
0
 

Author Comment

by:kevin1983
ID: 34961783
lionelmm:

I tried:
xcopy F:\"Program Files"\Windows AIK\Tools\ to f:\winpe\mount\tools\ /s/i

but an error says invalid number of parameters
0
 

Author Comment

by:kevin1983
ID: 34961802
RootsMan:

i tried: xcopy f:tools f:\winpe\mount\tools\ /s /I  
but an erorr says:
file not found - tools
0 files copied

Also tried
 xcopy f:tools\*.* f:\winpe\mount\tools\ /s /I  
but an eror says: file not found *.*
0 files copied
0
 
LVL 6

Expert Comment

by:RootsMan
ID: 34961832
How many files are in the "F:\Program Files\Windows AIK\Tools" ?
0
 
LVL 30

Accepted Solution

by:
Zoppo earned 150 total points
ID: 34961932
ok, from the 'dirs.txt' you can clearly see there simply isn't a folder 'f:\tools'.

So you have to find from where you want to copy anything to 'f:\winpe\mount\tools'.

Could it be you mean 'f:\Program Files\Windows AIK\Tools'?

In this case try this:

xcopy "f:\Program Files\Windows AIK\Tools" f:\winpe\mount\tools\ /s /I

ZOPPO
0
 
LVL 6

Assisted Solution

by:RootsMan
RootsMan earned 150 total points
ID: 34962016
Okay try manually creating the Tools directory in f:\winpe\mount\

The try your original command again, but enclose the source in quotes since there are spaces in the directory names:

xcopy "f:\Program Files\Windows AIK\Tools" f:\winpe\mount\tools\ /s /i

Open in new window

0
 
LVL 30

Expert Comment

by:Zoppo
ID: 34962461
hm - IMO it's not needed to create the 'tools' destination folder manually since 'xcopy' will create it if it doesn't exist (that's the meaning of '\i')

The posted command is exactly the same I posted one comment earlier ...
0
 
LVL 6

Expert Comment

by:RootsMan
ID: 34962718
We must have been typing at the same time. :)
0
 

Author Closing Comment

by:kevin1983
ID: 34970897
Thanks all for your input,

Rootsman and Zoppo your latest suggestions both worked fine thanks :-) happy a solution was found.

Kevin
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
topping3 challenge 14 52
ZIP or ZIPX 8 71
Windows 7 Blue Screen of Death minidump analysis request 7 62
move command 5 32
This is an explanation of a simple data model to help parse a JSON feed
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…
This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now