U盘之家 > U盘工具 > 安全工具 > U盘NTFS格式用户权限写保护工具(附源码)

U盘NTFS格式用户权限写保护工具(附源码)

  • 更新时间:2013-09-22 08:58
  • 报告错误
  • 软件大小:750 KB
  • 浏览次数:2982
  • 下载次数:2232
  • 软件语言:简体中文
  • 开 发 商:http://
  • 应用平台:Win7,WinXP,Win2003,Win2000
  • 交流社区:暂无
  • U盘NTFS格式用户权限写保护工具(附源码)

    点击图片放大点击图片放大

      U盘工具介绍:

    为NTFS格式的U盘加入权限写保护可以防止简单的U盘病毒入侵!
    注意:放到U盘以外使用! www.upan.cc

    附AU3源码:

    优盘之家

    #NoTrayIcon
    #Region ;**** 参数创建于 ACNWrapper_GUI ****
    #AutoIt3Wrapper_icon=项目2.ico
    #AutoIt3Wrapper_outfile=U盘权限设置.exe
    #AutoIt3Wrapper_Compression=4
    #AutoIt3Wrapper_UseUpx=n
    #AutoIt3Wrapper_Res_Description=U盘权限设置
    #AutoIt3Wrapper_Res_Fileversion=13.1.26.4
    #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
    #AutoIt3Wrapper_Res_LegalCopyright=QQ:411933069
    #EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
    ; 脚本开始 - 在这后面添加您的代码.
    #AutoIt3Wrapper_UseAnsi=y
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <ComboConstants.au3>
    
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUiCreate("U盘权限设置工具", 480, 206, -1, -1)
    $Group1 = GUICtrlCreateGroup("U盘权限设置工具说明", 16, 16, 445, 150)
    GUICtrlSetColor(-1, 0x42A5FF)
    GUICtrlCreateLabel("NTFS格式是WINDOWS系统推荐使用的格式,设置用户权限后可以防止病毒 的写入!", 30, 45, 430, 20)
    GUICtrlCreateLabel("对系统安全和U盘资料安全有着至关重要的作用!设置简单方便,只需轻轻一点!", 30, 70, 430, 20)
    GUICtrlCreateLabel("注意:U盘设置NTFS格式后在DOS下将无法识别!,请仔细阅读说明后再设置!", 30, 95, 430, 20)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUICtrlCreateLabel("请选择U盘:", 20, 184, 145, 245)
    $button = GUICtrlCreateButton("转换格式", 335, 180, 65, 23)
    $button1 = GUICtrlCreateButton("应 用 权 限 保 护 (&Y)", 30, 128, 160, 30)
    $button2 = GUICtrlCreateButton("解 除 权 限 保 护 (&N)", 280, 128, 160, 30)
    $button3 = GUICtrlCreateButton("刷新磁盘", 270, 180, 60, 23)
    $button4 = GUICtrlCreateButton("退出", 405, 180, 65, 23)
    $combo1 = GUICtrlCreateCombo("", 80, 182, 185, 35, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $CBS_DROPDOWNLIST))
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    _Disk()
    Write()
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE, $button4
    Exit
    Case $button
    $Zdrive = GUICtrlRead($combo1)
    $drive = StringLeft($Zdrive, 2)
    If DriveGetFileSystem($drive) = "NTFS" Then
    MsgBox(0, "温馨提醒", "此U盘已是NTFS格式无需转换")
    ContinueLoop
    Else
    ToolTip(@CR & "正在转换磁盘为NTFS格式,请稍等......" & @CR, @DesktopWidth - 260, @DesktopHeight - 120)
    GUICtrlSetState($combo1, $GUI_DISABLE)
    GUICtrlSetState($button, $GUI_DISABLE)
    GUICtrlSetState($button1, $GUI_DISABLE)
    GUICtrlSetState($button2, $GUI_DISABLE)
    GUICtrlSetState($button3, $GUI_DISABLE)
    GUICtrlSetState($button4, $GUI_DISABLE)
    RunWait(@ComSpec & ' /c convert ' & $drive & ' /fs:ntfs', @ScriptDir, @SW_HIDE)
    GUICtrlSetState($combo1, $GUI_ENABLE)
    GUICtrlSetState($button, $GUI_ENABLE)
    GUICtrlSetState($button1, $GUI_ENABLE)
    GUICtrlSetState($button2, $GUI_ENABLE)
    GUICtrlSetState($button3, $GUI_ENABLE)
    GUICtrlSetState($button4, $GUI_ENABLE)
    ProcessWaitClose("cmd.exe")
    DirRemove("c:\recycler", 1)
    FileDelete("c:\Recycled")
    ToolTip(@CR & "正设置完成!感谢使用!" & @CR, @DesktopWidth - 260, @DesktopHeight - 120)
    Sleep(1000)
    Write() 
    ToolTip("")
    EndIf
    Case $button1
    $Zdrive = GUICtrlRead($combo1)
    $drive = StringLeft($Zdrive, 2)
    If DriveGetFileSystem($drive) <> "NTFS" Then
    $Zx = MsgBox(36, "温馨提醒", "您的磁盘不是NTFS格式的是否转换后在执行?", 6)
    If $Zx = 6 Then
    ToolTip(@CR & "正在转换磁盘为NTFS格式,请稍等......" & @CR, @DesktopWidth - 260, @DesktopHeight - 120)
    GUICtrlSetState($combo1, $GUI_DISABLE)
    GUICtrlSetState($button, $GUI_DISABLE)
    GUICtrlSetState($button1, $GUI_DISABLE)
    GUICtrlSetState($button2, $GUI_DISABLE)
    GUICtrlSetState($button3, $GUI_DISABLE)
    GUICtrlSetState($button4, $GUI_DISABLE)
    RunWait(@ComSpec & ' /c convert ' & $drive & ' /fs:ntfs', @ScriptDir, @SW_HIDE)
    ToolTip(@CR & "正在设置磁盘为只读状态,请稍等......" & @CR, @DesktopWidth - 260, @DesktopHeight - 120)
    RunWait(@ComSpec & ' /c ' & 'echo y|cacls ' & $drive & ' /t /g everyone:r', @ScriptDir, @SW_HIDE)
    GUICtrlSetState($combo1, $GUI_ENABLE)
    GUICtrlSetState($button, $GUI_ENABLE)
    GUICtrlSetState($button1, $GUI_ENABLE)
    GUICtrlSetState($button2, $GUI_ENABLE)
    GUICtrlSetState($button3, $GUI_ENABLE)
    GUICtrlSetState($button4, $GUI_ENABLE)
    ToolTip(@CR & "正设置完成!感谢使用!" & @CR, @DesktopWidth - 260, @DesktopHeight - 120)
    Sleep(1000)
    Write() 
    ToolTip("")
    EndIf
    Else
    ToolTip(@CR & "正在设置磁盘为只读状态,请稍等......" & @CR, @DesktopWidth - 260, @DesktopHeight - 120)
    GUICtrlSetState($combo1, $GUI_DISABLE)
    GUICtrlSetState($button, $GUI_DISABLE)
    GUICtrlSetState($button1, $GUI_DISABLE)
    GUICtrlSetState($button2, $GUI_DISABLE)
    GUICtrlSetState($button3, $GUI_DISABLE)
    GUICtrlSetState($button4, $GUI_DISABLE)
    RunWait(@ComSpec & ' /c ' & 'echo y|cacls ' & $drive & ' /t /g everyone:r', @ScriptDir, @SW_HIDE)
    GUICtrlSetState($combo1, $GUI_ENABLE)
    GUICtrlSetState($button, $GUI_ENABLE)
    GUICtrlSetState($button1, $GUI_ENABLE)
    GUICtrlSetState($button2, $GUI_ENABLE)
    GUICtrlSetState($button3, $GUI_ENABLE)
    GUICtrlSetState($button4, $GUI_ENABLE)
    ToolTip(@CR & "设置只读状态完成!感谢使用!" & @CR, @DesktopWidth - 260, @DesktopHeight - 120)
    Sleep(1000)
    Write() 
    ToolTip("")
    EndIf
    Case $button2
    $Zdrive = GUICtrlRead($combo1)
    $drive = StringLeft($Zdrive, 2)
    ToolTip(@CR & "正在解除磁盘只读状态,请稍等......" & @CR, @DesktopWidth - 260, @DesktopHeight - 120)
    GUICtrlSetState($combo1, $GUI_DISABLE)
    GUICtrlSetState($button, $GUI_DISABLE)
    GUICtrlSetState($button1, $GUI_DISABLE)
    GUICtrlSetState($button2, $GUI_DISABLE)
    GUICtrlSetState($button3, $GUI_DISABLE)
    GUICtrlSetState($button4, $GUI_DISABLE)
    RunWait(@ComSpec & ' /c ' & 'echo y|cacls ' & $drive & ' /t /g everyone:f', @ScriptDir, @SW_HIDE)
    GUICtrlSetState($combo1, $GUI_ENABLE)
    GUICtrlSetState($button, $GUI_ENABLE)
    GUICtrlSetState($button1, $GUI_ENABLE)
    GUICtrlSetState($button2, $GUI_ENABLE)
    GUICtrlSetState($button3, $GUI_ENABLE)
    GUICtrlSetState($button4, $GUI_ENABLE)
    ToolTip(@CR & "您已获得磁盘所有权限!感谢使用!" & @CR, @DesktopWidth - 260, @DesktopHeight - 120)
    Sleep(1000)
    Write() 
    ToolTip("") 
    Case $button3
    _Disk()
    Write()
    Case $combo1
    Write() 
    EndSwitch
    WEnd
    
    Func _Disk()
    GUICtrlSetData($combo1, "")
    $disk = DriveGetDrive("REMOVABLE")
    If Not @error Then
    For $i = 1 To $disk[0]
    $disk[$i] = StringUpper($disk[$i])
    If DriveGetLabel($disk[$i]) = "" Then
    $DriveLabel = "\可移动磁盘"
    Else
    $DriveLabel = "\" & DriveGetLabel($disk[$i])
    EndIf
    $DriveTotal = DriveSpaceTotal($disk[$i])
    $DriveTotalGB = "【容量:" & ByteConversion($DriveTotal) & "】"
    GUICtrlSetData($combo1, $disk[$i] & $DriveLabel & $DriveTotalGB, $disk[1] & $DriveLabel & $DriveTotalGB)
    Next
    EndIf
    EndFunc ;==>_Disk
    
    Func Write()
    $Zdrive = GUICtrlRead($combo1)
    $drive = StringLeft($Zdrive, 2)
    $File = $drive & "\Temp\"
    $Temp = DirCreate($File)
    If FileExists($File) Then
    DirRemove($File, 1)
    GUICtrlSetState($button2, $GUI_DISABLE)
    GUICtrlSetState($button1, $GUI_ENABLE)
    Else
    DirRemove($File, 1)
    GUICtrlSetState($button1, $GUI_DISABLE)
    GUICtrlSetState($button2, $GUI_ENABLE)
    EndIf
    EndFunc ;==>Write
    
    Func ByteConversion($lBytes)
    If $lBytes < 1024 Then
    Return Round($lBytes, 2) & "MB"
    ElseIf $lBytes < 1048576 Then
    Return Round($lBytes / 1024, 2) & "GB"
    EndIf
    EndFunc ;==>ByteConversion
    
     优盘之家 

     

    U盘NTFS格式用户权限写保护工具(附源码):http://www.upan.cc/tools/security/3150.html

     

    将选中内容分享到新浪微博 将选中内容分享到腾讯微博
    tags:  
    下载地址
    下载说明:

    ☉本站软件大部分都会通过权威的卡巴斯基杀毒软件扫描,若你发现你的杀软误报(误报最严重的是金山杀毒,其次是360杀毒),请自己考虑是否继续使用;很多工具,我们自己团队都是先使用,然后分享给大家,尤其是群联、慧荣、银灿等主流量产工具;
    ☉本站所有资源都采用了自有的绿色解压包,即可解压到当前目录。


    (U)优盘之家,是一个集U盘量产工具U盘启动盘制作工具内存卡修复工具U盘检测工具于一体的专业指导性网站,请牢记我们的域名:www.upan.cc
    评论(请自觉遵守互联网相关政策法规,管理可以直接删除恶意评论、广告或违禁词语):
    表情:
     
    网友评论
    评论表情游客 2013-09-23发表 广西桂林市 电信 网友 支持[0] 反对[0] 引用[盖楼]
    可以用 好东西啊
    回顶部
    关于我们 | 免责声明 | 广告服务 | 联系我们 | 合作联系 | 网站地图 | 友情链接 | 关于淘宝直营店
    copyright © 2002-2024 upan.cc. all rights reserved .
    桂ICP备2023005296号-2