dslreports logo
 
    All Forums Hot Topics Gallery
spc
uniqs
40
dave
Premium Member
join:2000-05-04
not in ohio

dave to koam

Premium Member

to koam

Re: [WIN7] Copy complete directory tree

Short form: the guy who authorized loops in the directory structure should be held accountable under "cure is worse than the original disease" regulations.
OZO
Premium Member
join:2003-01-17

OZO

Premium Member

Agreed. It was not smart decision at all

koam
Pink Pecker
Premium Member
join:2000-08-16
East Puddle

koam to dave

Premium Member

to dave
I now have to do the purge thing because I can't delete all of Y:\Users from either Windows or Administrator command prompt.
koam

koam

Premium Member

To purge the extra files:

This really solve the problem you have. The correct syntax is:
robocopy c:\purge d:\users /purge
where "d:\users" is the infinite loop path
Also make sure to create a blank folder named "purge" in c:\ as mentioned above
Run the robocopy command a few times until it delete all the copied folders. It works for me.

I used
robocopy y:\purge y:\users /purge
in the administrator command window
and it cranked for 20 seconds, deleting 401 Extras Folders, and 2595 Extras Files.
koam

koam to dave

Premium Member

to dave
Now I'm trying

robocopy c:\Users y:\Users /mir /sl /xj

but it's hanging because it says that the ntuser.dat file is in use by another process.

Do I have to boot up to DOS or something? (how?)
dave
Premium Member
join:2000-05-04
not in ohio

dave

Premium Member

You can't open a file for which the current opener has said he wants exclusive access. The end. Your only choice is for the copy program to (a) fail, or (b) skip that file.

/R:a-small-number might help.

ntuser.dat is the current user's registry, so assuming you can figure out how to skip it, it might be worth creating a special user for this backup, so that the normal user gts copied correctly.

(There is no 'DOS' anyway).
SipSizzurp
Fo' Shizzle
Premium Member
join:2005-12-28
Houston, TX

SipSizzurp to koam

Premium Member

to koam
said by koam:

but it's hanging because it says that the ntuser.dat file is in use by another process.

Dave was correct, you need to skip files that are locked. Here is from the help file ;

/R:n :: number of Retries on failed copies: default 1 mill
/W:n :: Wait time between retries: default is 30 seconds.


This is some of what my batch files typically have to include sub directories. This will also re-try locked files after one second and only once before moving on.

/S /W:1 /R:1

RazzyInfLoop to dave

Anon

to dave
Is it because of backward compatible of previous Windows software?

koam
Pink Pecker
Premium Member
join:2000-08-16
East Puddle
·Shoreham Telephone

koam to dave

Premium Member

to dave
Thanks all.

Does anyone know if this is likely to work?

»www.kavoir.com/2012/07/h ··· asy.html
dave
Premium Member
join:2000-05-04
not in ohio

dave to RazzyInfLoop

Premium Member

to RazzyInfLoop
said by RazzyInfLoop :

Is it because of backward compatible of previous Windows software?

Because of previous mostly-3rd-party software that used hardwired paths.

But here's the design tradeoff. Do you want:

a) Problems with old apps written by people that don't know how to avoid hardcoded path names - which was always bad practice.

b) Problems in old apps that don't expect loops in file systems - which has never happened before.

In order to avoid people having (a), Windows has exposed (b). I think this was the wrong choice. I'd go further: a loop in a file system is never ever the right choice.

Note, it's not junctions per se I'm complaining about, it is using junctions in such a way as to make loops.

Razzy12345
@rr.com

Razzy12345

Anon

said by dave:

said by RazzyInfLoop :

Is it because of backward compatible of previous Windows software?

Because of previous mostly-3rd-party software that used hardwired paths.

But here's the design tradeoff. Do you want:

a) Problems with old apps written by people that don't know how to avoid hardcoded path names - which was always bad practice.

b) Problems in old apps that don't expect loops in file systems - which has never happened before.

In order to avoid people having (a), Windows has exposed (b). I think this was the wrong choice. I'd go further: a loop in a file system is never ever the right choice.

Note, it's not junctions per se I'm complaining about, it is using junctions in such a way as to make loops.

I understand the needs of using links for poor coding but I'm asking this because you can do the same thing in Linux. Is it avoidable?
dave
Premium Member
join:2000-05-04
not in ohio

dave

Premium Member

The avoidance mechanism is "it's stupid, don't set it up like that".

If the question was about detecting stupidity...

If you own code that need to traverse the file system, you can likely do your own loop detection ("this is a symlink, have I seen it before in this path?").

I believe Posix systems place a limit on the number of symbolic links the kernel will traverse in path resolution. Offhand, I'd suppose that could work in Windows too.
SipSizzurp
Fo' Shizzle
Premium Member
join:2005-12-28
Houston, TX

SipSizzurp to koam

Premium Member

to koam
said by koam:

Does anyone know if this is likely to work?

You should have stated your objective in the first post. I needed to move profiles in W7 so I could use Deep Freeze on the C: drive. I did this a couple of years ago, so my memory of the event is not very fresh. Here is the process I was able to condense after reading the 3 tutorials linked below. You might find some new tips in those tuts.

Using Registry Editor
To accomplish this using Registry editor, follow these steps:

· Create the destination folder first

· Click Start, Run and type Regedit.exe

· For per-user special folders, navigate to the following location:

HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ User Shell Folders

· For per-system special folders, navigate to the following location:

HKEY_LOCAL_MACHINE \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ User Shell Folders

· Double-click the corresponding shell folder name

· Change the Value data accordingly, mentioning the destination path

· Close Regedit.exe

. In Safe Mode, "Move" the user data folders from the original folder to the new folder using Windows "Drag and Move". When prompted about the .ini files tell it to move them too.


The final "Move" operation is performed in safe mode while logged into a different profile than the one you are moving.

Links ;
http://social.technet.microsoft.com/forums/en-US/itprovistasetup/thread/91aa8b26-2b09-4e56-955c-679b297832e1/

http://www.starkeith.net/coredump/2009/05/18/how-to-move-your-windows-user-profile-to-another-drive/

http://answers.microsoft.com/en-us/windows/forum/windows_7-files/win7-how-do-i-move-user-folder-to-a-different/565f16a5-e5ed-43c9-8422-4f56aebb296e