Solved Insufficient Memory Errors running Batch file

jarhtmd

New member
Local time
5:41 PM
Messages
17
Location
Maryland, USA
I have a batch file that . . .
1. reads a txt file that contains a list of filename prefixes.
2. drills down thru a folder tree looking for filesnames beginning with each of those prefixes.
3. copies (XCOPY) each matching file into a new folder tree (with matching subfolder structure).


It usually works great, but when searching a large tree of data with many subfolders, sub-subfolders and many files I get "insufficient memory" errors. I don't really understand what that means except that memory has not been "released". I get several of these errors.


I don't know if processing in OK to a certain point within the list of prefixes, and stops working (for the rest of the list) whenever an "insufficient memory" error occurs. Nor do I know the prefixes on which the errors occur.


Is there a way to prevent or recover from this problem? I assume it is related to the characteristics of the tree being searched.
 

My Computer

OS
Windows 7 Home Premium 64bit

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom Build
OS
Windows 7 Ultimate x64 SP1
CPU
AMD Phenom 2 1090T
Motherboard
Gigabyte GA-890FXA-UD5
Memory
2x8GB Kingston HyperX Fury Black 1600Mhz Unganged
Graphics Card(s)
MSI GTX 970 Gaming 4G
Sound Card
Realtek On-Board HD 7.1 Audio / Logitech G35
Monitor(s) Displays
3xAcer GD245HQ
Screen Resolution
1920x1080
Hard Drives
Samsung 850 Pro 512GB SSD - OS /
WD Caviar Black SATA 3 - 1 TBx2 - Dynamic RAID 0 /
WD Caviar Green SATA 2 - 640GBx2 - Dynamic RAID 0 /
WD Caviar Green SATA 2 - 640GB - Internal Backup /
Seagate Barracude SATA 3 - 3TB - External Backup/ Sync
PSU
HighPower 1000W
Case
Cooler Master HAF 932
Cooling
Noctua NH-D14
Keyboard
Logitech G19
Mouse
Logitech G500
Internet Speed
100/4 Mbit Cable (100GB quota)
Antivirus
ZoneAlarm Extreme Security / MBAM Pro / MBAE Free / SAS Free
Browser
IE 11 - Firefox - Chrome
Other Info
Logitech F710/ G27/ G940/ Z5500 // TrackIR 5 // Nvidia 3D Surround Vision
Will you please translate this into a Robocopy command?

for /F "delims=" %%i in (Prefix-List.txt) do (
xcopy "%src_folder%\%%i*" "%dst_folder%" /C /H /I /K /Q /R /S /Y >nul 2>>Errors.txt
)
 

My Computer

OS
Windows 7 Home Premium 64bit
Code:
for /F "delims=" %%I in (Prefix-List.txt) do (
	robocopy "%src_folder%" "%dst_folder%" "%%~I*" /s >nul 2>>Errors.txt
)
 

My Computer

Computer type
PC/Desktop
OS
Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
Thanks. I used Dir /B /S /O:GN >dir.txt to get the full paths involved. Then after importing dir.txt into Excel I was able to find the very long paths. I shortened those & solved my immediate problem. Using Robocopy should prevent future problems.

This is the 1st that I've heard of Robocopy. Is there a list/catalog of similar commands?

* * * * *

I did not mark http://www.sevenforums.com/member.php?u=406309Pyprohly's post as "Solved", because I wasn't sure if I'd still be able to post this. Some forums don't allow additional posts after "Solved". My intent was to then go back to mark http://www.sevenforums.com/member.php?u=406309Pyprohly's post as the solution. Apparently, the last post is the only one that can be marked as a solution.

Therefore, I will mark this post as "Solved". Thanks again, Pyprohly.
 
Last edited:

My Computer

OS
Windows 7 Home Premium 64bit
This is the 1st that I've heard of Robocopy. Is there a list/catalog of similar commands?
Copy, Xcopy, and Robocopy are the builtin Command Prompt commands that copy. For a list of all commands and their documentation, see this wonderful web resource.


Some forums don't allow additional posts after "Solved". My intent was to then go back to mark Pyprohly's post as the solution. Apparently, the last post is the only one that can be marked as a solution.

Therefore, I will mark this post as "Solved". Thanks again, Pyprohly.
That's weird: not allowing users to continue posting after someone's solved it.

In this forum, at least, when you hit that 'Mark as Solved' button at the top of your thread, the whole thread is considered solved, and the person who actually 'solved' the problem is not displayed as such and is not recorded. When a thread is marked solved, the thread is marked solved, not a post.
 

My Computer

Computer type
PC/Desktop
OS
Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
Back
Top