1.

Solve : Some folders aren't affected by move command?

Answer»

Hello.  I am having a problem with something I'm trying to do with a BATCH file.  I want to delete most of the files, excluding a few, from a folder called Plugins.  Then I want to move all of the folders (and their contents) from a directory at the same level as Plugins, Plugins.nonpacked, to the Plugins folder.  That STEP is where it's failing.  There are five folders within Plugins.nonpacked, named "BATs, Lots", BSC, Dependencies, PEGPROD, and SFBT.  When the batch file tries to move all of these folders to my Plugins folder, it moves most of them but leaves behind BSC and PEGPROD with a "The system cannot find the file specified" or similar error for each of them.  I have also tried moving these folders individually and using XCOPY to copy them, which results in a message of "0 file(s) copied".  These folders are different from the other three because they contain no files directly within them, but have only subfolders with files inside of those.  The three folders that succeed in moving have files in their root directories, as well as subfolders.  Here is the batch file:

Code: [Select]cd Plugins
attrib "BATs, Lots.dat" +r
attrib Dependencies.dat +r
attrib BSC.dat +r
attrib SFBT.dat +r
attrib PEGPROD.dat +r
attrib "BATs, Lots-*.dat" +r
attrib Dependencies-*.dat +r
attrib BSC-*.dat +r
attrib SFBT-*.dat +r
attrib PEGPROD-*.dat +r
del /s /q *.*
FOR /D %%a in (*) DO rmdir /s /q "%%a"
attrib "BATs, Lots.dat" -r
attrib Dependencies.dat -r
attrib BSC.dat -r
attrib SFBT.dat -r
attrib PEGPROD.dat -r
attrib "BATs, Lots-*.dat" -r
attrib Dependencies-*.dat -r
attrib BSC-*.dat -r
attrib SFBT-*.dat -r
attrib PEGPROD-*.dat -r
cd ..\
for /d %%b in (plugins.nonpacked\*) do move "%%b" "plugins"That is a lot of work. Do you really need to do this?
Or is this just a case of you want to see if it can be done?
Are you short on disk space?
Is this something you need to do an a regular basis?
Do you have an NETWORK drive  for backup?
Windows and DOS do not do well at moving large blocks for files and folders with exemptions and attribute issues..
But making a copy or backup over a network works fine. Even monster volumes
As for me, I would just copy to a backup volume. Then delete everything and restore just what I wanted. No batch file needed.
Please explain - why that would not work for you? Quote from: moonraker0 on November 23, 2010, 10:30:47 PM

These folders are different from the other three because they contain no files directly within them, but have only subfolders with files inside of those. 

When you used XCOPY, did you use the /E switch?Geek-9PM:  Yes, this is something I do frequently, and I became TIRED of doing it all manually.  This batch file is not complete; after all those tasks execute, I also want to RUN an application, and when that's done I want to move the files that were just moved in to the folder back to Plugins.nonpacked.  After that is done, the batch file should copy files from another folder, Plugins.alwaysloose, back into Plugins.

BC_Programmer:  Yes, I forgot to mention that I did use the /e switch when I tried XCOPY.


Discussion

No Comment Found