我有一個項目,我需要證明消磁器的優點,可以完全擦除標準硬盤上所有文件的痕跡。我想用重複的信息(例如單個單詞「information」)傳播主題HDD。如何編寫'recurrsion copy'命令?
我在想,通過這種方式,我可以快速搜索消磁驅動器,以證明過程的卓越性。作爲我的安全要求的一部分,dBan等程序不如那些會破壞媒體的存儲和檢索功能的過程。消磁器應用的環境,如果證明其完整性,也會限制存儲介質的物理破壞。
我希望創建的.bat文件應該包含一個遞歸,它將影響被複制文件的大小,從而逐步增加數據傳輸量,從而減少填充驅動器的時間。
我已經使用了以下內容,並且到目前爲止,在一個非常(相對)短的時間後,這個過程變得很慢。我已經在ERRORLEVEL之前和之後嘗試過使用'%',並且它似乎用%符號表示程序在進程中儘早失敗。有人有主意嗎?這是我一直在使用這個腳本,我想通過這個過程計算機的規格:
P4,1GB內存,2.8GHz的
echo off
Rem Setting home folder
C:
Rem Setting Home folder again
cd\
:copy repeat
rem Using date and time so it formats the file IT_20130708_Time in hours minutes and milliseconds
set hr=%time:~0,2%
if "%hr:~0,1%" equ " " set hr=0%hr:~1,1%
COPY "IT.txt" "C:\testcopy\IT_%date:~-4,4%%date:~-10,2%%date:~-7,2%_%hr%%time:~3,2%%time:~6,2%%RANDOM%.txt"
COPY "IT.txt" "C:\testcopy2\IT_%date:~-4,4%%date:~-10,2%%date:~-7,2%_%hr%%time:~3,2%%time:~6,2%%RANDOM%.txt"
COPY "IT.txt" "C:\testcopy3\IT_%date:~-4,4%%date:~-10,2%%date:~-7,2%_%hr%%time:~3,2%%time:~6,2%%RANDOM%.txt"
COPY "IT.txt" "C:\testcopy4\IT_%date:~-4,4%%date:~-10,2%%date:~-7,2%_%hr%%time:~3,2%%time:~6,2%%RANDOM%.txt"
COPY "IT.txt" "C:\testcopy5\IT_%date:~-4,4%%date:~-10,2%%date:~-7,2%_%hr%%time:~3,2%%time:~6,2%%RANDOM%.txt"
COPY "IT.txt" "C:\testcopy6\IT_%date:~-4,4%%date:~-10,2%%date:~-7,2%_%hr%%time:~3,2%%time:~6,2%%RANDOM%.txt"
COPY "IT.txt" "C:\testcopy7\IT_%date:~-4,4%%date:~-10,2%%date:~-7,2%_%hr%%time:~3,2%%time:~6,2%%RANDOM%.txt"
COPY "IT.txt" "C:\testcopy8\IT_%date:~-4,4%%date:~-10,2%%date:~-7,2%_%hr%%time:~3,2%%time:~6,2%%RANDOM%.txt"
COPY "IT.txt" "C:\testcopy9\IT_%date:~-4,4%%date:~-10,2%%date:~-7,2%_%hr%%time:~3,2%%time:~6,2%%RANDOM%.txt"
COPY "IT.txt" "C:\testcopy10\IT_%date:~-4,4%%date:~-10,2%%date:~-7,2%_%hr%%time:~3,2%%time:~6,2%%RANDOM%.txt"
rem if it Does not error GOTO the start aka :copy repeat
IF ERRORLEVEL ==0 GOTO copy repeat
rem end this file if error
goto end
:end
在上面的意圖是繼續複製下一組文件即使在複製操作中出現故障。此外,該過程需要儘可能在短時間內完成。我衷心感謝所有的建議,感謝您的時間和考慮。
'errorlevel'從每一個設置'copy'命令和從下覆蓋。你不能測試一個「副本」塊。 – Endoro
感謝您編輯,相當長的原創,看起來好多了! –