• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

creating a script to delete TONS of files

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.
Dump the paths from SQL to a csv:
Powershell:

Code:
Import-CSV "C:\temp.csv" | % { 
$path = $_.csvcolumnname
Remove-item "$path"
}

"csvcolumnname" is whatever you name the column in row 1

If you are working at the directory levels you could wildcard the paths as needed. A couple of examples of data sql is returning might help me give you a better solution.
 
Last edited:
Do this all the time using vbscript. We do it based on historical values of timestamps; deleting files older than a specific date.

In a nutshell, just write the code in vbscript, save it and run it using a schedule task. Its ridiculously easy to do. Google for the script as its out there. And yeah you can do it a few ways too using Powershell or windows commands in a batch file or even Windows explorer search.
 
Initial count of first batch is 461,479. They tightened the purge parameters some, so the "millions" has been reduced. That being said. the 461,479 is only the # of scans. Each scan could contain 1-## actual .tif files. I'm using a wild card on each of the 461,479 so while its 461,479 rows of "del", it could end up being millions of actual *.tif files that get nuked still.
 
Make sure you have a backup because even the slightest error in code could end in disaster. Any script/prg would require serious testing before allowing it to comb the folder structure.

Perhaps you should make the test program/script copy the files somewhere and only then delete them.

Later you can always delete the copies.
 
Back
Top