搜尋此網誌

2012年1月27日 星期五

【第一期】Batch File 教學 — 初階防盜

第一期    Batch File 教學 — 初階防盜
發佈日期:2012/01/27    作者:秘密行動 (C.A.S.)



大家好,相信有部份人士認識我吧?
我是 YK Forum 及 MyChat 的秘密行動 ~
第一次在此發教學,又是第一篇文章,可能頗為失準,在此首先道歉 ......
我不會在此說 Basic Command,因為不想在這浪費時間 ......
說回正題,初階防盜的功能是防止外人修改批次檔名稱
(不過轉來有甚麼用 ...... 沒有人會將整個 BAT 給人吧)
大家應該使用各軟件來將 批次檔(BAT) 轉換為 應用程式(EXE),
以防止給他人修改,但這並不算防盜,因為現時已有軟件能反編了。
 
=========================================

這此初階防盜十分簡單,可說是菜鳥也懂! ^^
初階防盜寫法如下 (Example):

:: if not exist (如果沒有)
:: exit (離開)
:: 即是如果目錄找不到 Test.exe 檔案,就會離開

if not exist Test.exe exit

=========================================

若你檔案在某資料夾內,那怎樣寫?很簡單,再來看看例子:
:: 例子:C:\\User\Administrator\Test_File\Test.exe
(Test.exe 位置)
:: 例子:C:\\User\Batch_Files_01.bat
(批次檔位置)

if not exist Administrator\Test_File\Test.exe exit

=========================================

但如果我的批次檔不在目標範圍內,那怎辦?
:: 例子:C:\\User\Administrator\Te
st_File\Test.exe
(Test.exe 位置)
:: 例子:D:\\Admin\Batch_Files_01.bat

(批次檔位置)

if not exist C:\\User\Administrator\Test_File\Test.exe exit

=========================================

我想更多檔案,那又怎辦?
:: 例子:C:\\User\Administrator\Test_File_1\Test1.exe

(Test1.exe 位置)
:: 例子:C:\\User\Administrator\Test_File_2\Test2.exe

(Test2.exe 位置)
:: 例子:C:\\User\Administrator\Test_File_3\Test3.exe

(Test3.exe 位置)
:: 例子:D:\\Admin\Batch_Files_01.bat

(批次檔位置)

if not exist C:\\User\Administrator\Test_File_1\Test1.exe (
if not exist C:\\User\Administrator\Test_File_1\Test2.exe (
if not exist C:\\User\Administrator\Test_File_1\Test3.exe (
exit
)
)
)

!.!緊記多少括號 【(】,就要在最後加回多少【)】!.!

  
=========================================

那麼別人一旦將你的批次檔名稱更改,

當他更改名稱後再開啟卻發現批次檔就會自動關閉了。

沒有留言:

張貼留言