| 1. |
Solve : Batch file to fill disk?? |
|
Answer» Is it possible to create a batch file that will fill up all of the unused disk space on a hard drive? If the files could occupy one folder too that would be optimal. Code: [Select]@echo off The first for varies %%x from 1 to 10 incrementing by 1. This is strictly used as a counter and limits the number of iterations. Thanks, Yes, as would using dban or eraser. I just thought having a batch file do something similar would be interesting. Though the missing randomness might somewhat negate the effect. How can I change the path in ('dir c:\temp\ /s /b') to C:\Documents and Settings\username\Desktop\temp\ Everything I try seems to screw up the syntax. Also, I did /? for tokens and delims but I'm still having trouble understanding what they're all about... can you point me to a good place that can break tokens and delims down into simpleton terms? You need quotes when using values with embedded spaces: "C:\Documents and Settings\username\Desktop\temp\" This Site seems as good as any for explaining how a for works. Good luck. Code: [Select]@echo off for /l %%x in (1,1,10) do ( for /f "tokens=* delims=" %%a in ('dir "C:\Documents and Settings\username\Desktop\temp\" /s /b') do ( copy %%a %%a_%%x ) ) I get "the system cannot find the path specified" when I run that. I have a folder named temp on my desktop and it has a file in it. I suspect username is not really your user name: Code: [Select]@echo off for /l %%x in (1,1,10) do ( for /f "tokens=* delims=" %%a in ('dir "C:\Documents and Settings\%username%\Desktop\temp\" /s /b') do ( copy %%a %%a_%%x ) ) I have no idea if the path is CORRECT but at least the syntax is. Right, mine is actually "comp". I have the path absolutely correct, it just doesn't like that path for some reason. Oh well, it RUNS fine from C:\path\ |
|