;===============================================================================
;
; Description: 返回指定文本文件的行数.
; Syntax: FileCountLines(sFilePath)
; Parameter(s): $sFilePath - 路径+文件名
; Requirement(s): 无
; Return Value(s): 成功 - 返回文件的行数
; 失败 - 返回0 并设置 error = 1
; Author(s): Tylo <tylo at start dot no> 修正 by thesnow Converted by Thinkai
;
;===============================================================================
FileCountLines(sFilePath){
global error
IfNotExist, %sFilePath%
{
error = 1
Return 0
}
Else
{
FileRead, m, %sFilePath%
StringSplit, n, m, `n
if n0 = 0
Return 1
Else
Return n0
}
}
;======================================================
;
; 函数名称: EncryptFile(sFilePath)
; 详细信息: 加密文件,NTFS磁盘系统自带的EFS加密
; sFilePath: sFilePath 为您想加密的文件.
; 返回值 : Dllcall的Errorlevel
; 作者: thesnow(rundll32@126.com) Converted by Thinkai
;
;======================================================
EncryptFile(sFilePath){
dllcall("advapi32.dll\EncryptFile","str", sFilePath)
Return Errorlevel
}
;======================================================
;
; 函数名称: DecryptFile(sFilePath)
; 详细信息: 解密文件,NTFS磁盘系统自带的EFS加密
; sFilePath: sFilePath 为您想解密的文件.
; 返回值 : Dllcall的Errorlevel
; 作者: thesnow(rundll32@126.com) Converted by Thinkai
;
;======================================================
DecryptFile(sFilePath){
dllcall("advapi32.dll\DecryptFile","str", sFilePath,"int",1)
Return Errorlevel
}
;======================================================
;
; 函数名称: _HideSystemFolder($PathCode,$Hide)
; 详细信息: 隐藏系统特殊文件夹.
; $PathCode: 系统文件夹代码:
; 0,控制面板/1,程序文件夹目录/2,系统所在驱动器/3,windows目录
; $Hide: 隐藏为1,不隐藏为0.
; 返回值 : 成功返回1,失败(文件夹代码错误)返回0,失败(隐藏代码错误),返回0.
; 作者: thesnow(rundll32@126.com) Converted by Thinkai
;
;======================================================
HideSystemFolder(PathCode:=4,Hide:=1){
If Hide is not integer
{
Return 0
}
Else
{
if PathCode = 0
RegWrite, REG_DWORD, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\WebView\BarricadedFolders, shell:ControlPanelFolder, %Hide%
Else if PathCode = 1
RegWrite, REG_DWORD, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\WebView\BarricadedFolders, shell:ProgramFiles, %Hide%
Else if PathCode = 2
RegWrite, REG_DWORD, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\WebView\BarricadedFolders, shell:SystemDriveRootFolder, %Hide%
Else if PathCode = 3
RegWrite, REG_DWORD, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\WebView\BarricadedFolders, shell:Windows, %Hide%
Else if PathCode = 4
RegWrite, REG_DWORD, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\WebView\BarricadedFolders, shell:Windows, %Hide%
Else
Return 0
}
Return 1
}
62 queries in 2.792 seconds |