找回密码
 加入
搜索
查看: 3012|回复: 7

[AU3基础] 套用代码.变量未声明?

  [复制链接]
发表于 2011-5-18 14:23:15 | 显示全部楼层 |阅读模式
本帖最后由 control938 于 2011-6-5 09:08 编辑
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=C:\autoit3\Aut2Exe\Icons\lock.ico
#AutoIt3Wrapper_outfile=Tools.exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_Comment=工具权限锁
#AutoIt3Wrapper_Res_Description=龙旋风工具锁
#AutoIt3Wrapper_Res_Fileversion=1.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright=免费软件 自由传播
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#Region AutoIt3Wrapper 预编译参数(常用参数)
;#AutoIt3Wrapper_Res_Field=AutoIt Version|%AutoItVer%                ;自定义资源段
;#AutoIt3Wrapper_Run_Tidy=                                                   ;脚本整理
;#AutoIt3Wrapper_Run_Obfuscator=                                                      ;代码迷惑
;#AutoIt3Wrapper_Run_AU3Check=                                                                 ;语法检查
;#AutoIt3Wrapper_Run_Before=                                                                 ;运行前
;#AutoIt3Wrapper_Run_After=                                                                        ;运行后
#EndRegion AutoIt3Wrapper 预编译参数设置完成
#cs ____________________________________

 Au3 版本:3.3.6.1
 脚本作者:东拼西凑
        Email:control938@yeah.net
        QQ/TM:5823475
 脚本版本:1.0.0.0
 脚本功能:工具权限锁

#ce _______________脚本开始_________________

#include <GUIConstants.au3>
#include <Process.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("龙旋风工具锁 V" & @YEAR, 288, 100, 354, 160);标题栏
GUISetBkColor(0x0066CC);设置窗体颜色
$Button1 = GUICtrlCreateButton("系统锁定", 30, 20, 100, 25, 0)
$Button2 = GUICtrlCreateButton("系统解锁", 160, 20, 100, 25, 0)
$Label1 = GUICtrlCreateLabel("系统时间:", 95, 65, 96, 25)
$Label2 = GUICtrlCreateLabel("Label2", 155, 65, 48, 25)
$sUsS = @UserName
$sUsN = "administrator"
$sUsP = @WDAY & @HOUR & @MDAY & @WDAY & @MON & @HOUR
login()
GUISetState(@SW_SHOW)
        WinSetState($Form1,"",@SW_HIDE)
#EndRegion ### END Koda GUI section ###
While 1
        If TrayGetMsg()=$TRAY_EVENT_PRIMARYDOWN Then
        WinSetState($Form1,"",@SW_HIDE)
        login()
        WinSetState($Form1,"",@SW_SHOW)
        EndIf
        $nMsg = GUIGetMsg()
        GUICtrlSetData($Label2, @HOUR & ':' & @MIN & ':' & @SEC)
        Sleep(50)
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        GUISetState(@SW_HIDE, $Form1)
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoRecentDocsMenu", "REG_DWORD", "00000001");开始菜单-隐藏文档
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoSetFolders", "REG_DWORD", "00000001");开始菜单-隐藏设置中的<控制面板>和<打印机>
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoSetTaskbar", "REG_DWORD", "00000001");开始菜单-隐藏设置中的<任务栏和开始菜单>1
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoChangeStartMenu", "REG_DWORD", "00000001");开始菜单-隐藏设置中的<任务栏和开始菜单>2
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoFavoritesMenu", "REG_DWORD", "00000001");开始菜单-隐藏收藏夹
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoFind", "REG_DWORD", "00000001");开始菜单-隐藏查找
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoSMHelp", "REG_DWORD", "00000001");开始菜单-隐藏帮助
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoRun", "REG_DWORD", "00000001");开始菜单-隐藏运行
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "StartMenuLogOff", "REG_DWORD", "00000001");开始菜单-隐藏注销
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoNetHood", "REG_DWORD", "00000001");桌面-隐藏网上邻居
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoTrayContextMenu", "REG_DWORD", "00000001");桌面-禁任务栏右键
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoActiveDesktop", "REG_DWORD", "00000001");桌面-禁<活动桌面>
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoCloseDragDropBands", "REG_DWORD", "00000001");桌面-禁止更改任务栏
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoFileMenu", "REG_DWORD", "00000001");资源管理器-隐藏文件菜单
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoNetConnectDisconnect", "REG_DWORD", "00000001");资源管理器-删除网络映射菜单
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoSharedDocuments", "REG_BINARY", "00000001");资源管理器-隐藏共享文档
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoLowDiskSpaceChecks", "REG_DWORD", "3ffffff");资源管理器-禁止显示磁盘空间不足
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoFolderOptions", "REG_DWORD", "00000001");开始菜单-隐藏设置中的<文件夹选项>
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoSetActiveDesktop", "REG_DWORD", "00000001");开始菜单-隐藏设置中的<活动桌面>
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoWindowsUpdate", "REG_DWORD", "00000001");开始菜单-隐藏设置中的<Windows Update>
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoControlPanel", "REG_DWORD", "00000001");开始菜单-锁定控制面板
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoRecentDocsHistory", "REG_DWORD", "00000001");开始菜单-禁止<文档>记载记录
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\system", "DisableLockWorkstation", "REG_DWORD", "00000001");系统-禁止锁定计算机
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\system", "DisableChangePassword", "REG_DWORD", "00000001");系统-禁止锁定电脑时修改密码
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\system", "Disableregistrytools", "REG_DWORD", "00000001");系统-禁用注册表编辑器
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Associations", "ModRiskFileTypes", "REG_SZ", ".exe");系统-禁用文件安全警告
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu", "{450D8FBA-AD25-11D0-98A8-0800361B1103}", "REG_DWORD", "00000001");桌面-隐藏我的文档
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu", "{20D04FE0-3AEA-1069-A2D8-08002B30309D}", "REG_DWORD", "00000001");桌面-隐藏我的电脑
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu", "{208D2C60-3AEA-1069-A2D7-08002B30309D}", "REG_DWORD", "00000001");桌面-隐藏网络邻居
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu", "{871C5380-42A0-1069-A2EA-08002B30309D}", "REG_DWORD", "00000001");桌面-隐藏IE
                        RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Restrictions", "NoBrowserOptions", "REG_DWORD", "00000001");IE-禁IE选项
                        RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Restrictions", "NoSelectDownloadDir", "REG_DWORD", "00000001");IE-禁止下载文件保存到磁盘
                        RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{645FF040-5081-101B-9F08-00AA002F954E}");桌面-隐藏回收站
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3", "1803", "REG_DWORD", "00000003");IE-锁定IE下载功能
                        RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurePipeServers\winreg", "RemoteRegAccess", "REG_DWORD", "00000001");禁止远程修改注册表
                        RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System", "DisableCMD", "REG_DWORD", "00000002");系统-禁用命令行
                        RegDelete("HKEY_CLASSES_ROOT\lnkfile", "IsShortcut"); 去除快捷方式的箭头
                        RegWrite("HKEY_CLASSES_ROOT\lnkfile","","REG_SZ",""); 去除快捷方式字样
                        RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","龙旋风工具锁","REG_SZ",@AutoItExe);添加自启动项
                        ;禁止组策略.
                        _RunDOS("regsvr32 /s /u fde.dll")
                    _RunDOS("regsvr32 /s /u gpedit.dll")
                    _RunDOS("regsvr32 /s /u gptext.dll")
                    _RunDOS("regsvr32 /s /u wsecedit.dll")
                    _RunDOS("gpupdate.exe /force");刷新策略
                        _RunDOS("gpupdate.exe /force");必须刷新两次才能见效果
                        ;快捷方式
            FileCreateShortcut(@ScriptFullPath,@DesktopCommonDir & "\龙旋风工具锁 .lnk")
            FileCreateShortcut(@ScriptFullPath,@StartMenuDir & "\龙旋风工具锁 .lnk")
            FileCreateShortcut(@ScriptFullPath,@StartMenuCommonDir & "\龙旋风工具锁 .lnk")
                Case $Button1
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoRecentDocsMenu", "REG_DWORD", "00000001");开始菜单-隐藏文档
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoSetFolders", "REG_DWORD", "00000001");开始菜单-隐藏设置中的<控制面板>和<打印机>
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoSetTaskbar", "REG_DWORD", "00000001");开始菜单-隐藏设置中的<任务栏和开始菜单>1
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoChangeStartMenu", "REG_DWORD", "00000001");开始菜单-隐藏设置中的<任务栏和开始菜单>2
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoFavoritesMenu", "REG_DWORD", "00000001");开始菜单-隐藏收藏夹
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoFind", "REG_DWORD", "00000001");开始菜单-隐藏查找
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoSMHelp", "REG_DWORD", "00000001");开始菜单-隐藏帮助
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoRun", "REG_DWORD", "00000001");开始菜单-隐藏运行
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "StartMenuLogOff", "REG_DWORD", "00000001");开始菜单-隐藏注销
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoNetHood", "REG_DWORD", "00000001");桌面-隐藏网上邻居
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoTrayContextMenu", "REG_DWORD", "00000001");桌面-禁任务栏右键
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoActiveDesktop", "REG_DWORD", "00000001");桌面-禁<活动桌面>
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoCloseDragDropBands", "REG_DWORD", "00000001");桌面-禁止更改任务栏
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoFileMenu", "REG_DWORD", "00000001");资源管理器-隐藏文件菜单
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoNetConnectDisconnect", "REG_DWORD", "00000001");资源管理器-删除网络映射菜单
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoSharedDocuments", "REG_BINARY", "00000001");资源管理器-隐藏共享文档
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoLowDiskSpaceChecks", "REG_DWORD", "3ffffff");资源管理器-禁止显示磁盘空间不足
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoFolderOptions", "REG_DWORD", "00000001");开始菜单-隐藏设置中的<文件夹选项>
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoSetActiveDesktop", "REG_DWORD", "00000001");开始菜单-隐藏设置中的<活动桌面>
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoWindowsUpdate", "REG_DWORD", "00000001");开始菜单-隐藏设置中的<Windows Update>
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoControlPanel", "REG_DWORD", "00000001");开始菜单-锁定控制面板
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoRecentDocsHistory", "REG_DWORD", "00000001");开始菜单-禁止<文档>记载记录
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\system", "DisableLockWorkstation", "REG_DWORD", "00000001");系统-禁止锁定计算机
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\system", "DisableChangePassword", "REG_DWORD", "00000001");系统-禁止锁定电脑时修改密码
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\system", "Disableregistrytools", "REG_DWORD", "00000001");系统-禁用注册表编辑器
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Associations", "ModRiskFileTypes", "REG_SZ", ".exe");系统-禁用文件安全警告
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu", "{450D8FBA-AD25-11D0-98A8-0800361B1103}", "REG_DWORD", "00000001");桌面-隐藏我的文档
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu", "{20D04FE0-3AEA-1069-A2D8-08002B30309D}", "REG_DWORD", "00000001");桌面-隐藏我的电脑
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu", "{208D2C60-3AEA-1069-A2D7-08002B30309D}", "REG_DWORD", "00000001");桌面-隐藏网络邻居
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu", "{871C5380-42A0-1069-A2EA-08002B30309D}", "REG_DWORD", "00000001");桌面-隐藏IE
                        RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Restrictions", "NoBrowserOptions", "REG_DWORD", "00000001");IE-禁IE选项
                        RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Restrictions", "NoSelectDownloadDir", "REG_DWORD", "00000001");IE-禁止下载文件保存到磁盘
                        RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{645FF040-5081-101B-9F08-00AA002F954E}");桌面-隐藏回收站
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3", "1803", "REG_DWORD", "00000003");IE-锁定IE下载功能
                        RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurePipeServers\winreg", "RemoteRegAccess", "REG_DWORD", "00000001");禁止远程修改注册表
                        RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System", "DisableCMD", "REG_DWORD", "00000002");系统-禁用命令行
                        RegDelete("HKEY_CLASSES_ROOT\lnkfile", "IsShortcut"); 去除快捷方式的箭头
                        RegWrite("HKEY_CLASSES_ROOT\lnkfile","","REG_SZ",""); 去除快捷方式字样
                        RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","龙旋风工具锁","REG_SZ",@AutoItExe);添加自启动项
                        ;禁止组策略.
                        _RunDOS("regsvr32 /s /u fde.dll")
                    _RunDOS("regsvr32 /s /u gpedit.dll")
                    _RunDOS("regsvr32 /s /u gptext.dll")
                    _RunDOS("regsvr32 /s /u wsecedit.dll")
                    _RunDOS("gpupdate.exe /force");刷新策略
                        _RunDOS("gpupdate.exe /force");必须刷新两次才能见效果
                        ;快捷方式
            FileCreateShortcut(@ScriptFullPath,@DesktopCommonDir & "\龙旋风工具锁 .lnk")
            FileCreateShortcut(@ScriptFullPath,@StartMenuDir & "\龙旋风工具锁 .lnk")
            FileCreateShortcut(@ScriptFullPath,@StartMenuCommonDir & "\龙旋风工具锁 .lnk")
                Case $Button2
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoRecentDocsMenu", "REG_DWORD", "00000000");开始菜单-隐藏文档
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoSetFolders", "REG_DWORD", "00000000");开始菜单-隐藏设置中的<控制面板>和<打印机>
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoSetTaskbar", "REG_DWORD", "00000000");开始菜单-隐藏设置中的<任务栏和开始菜单>1
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoChangeStartMenu", "REG_DWORD", "00000000");开始菜单-隐藏设置中的<任务栏和开始菜单>2
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoFavoritesMenu", "REG_DWORD", "00000000");开始菜单-隐藏收藏夹
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoFind", "REG_DWORD", "00000000");开始菜单-隐藏查找
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoSMHelp", "REG_DWORD", "00000000");开始菜单-隐藏帮助
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoRun", "REG_DWORD", "00000000");开始菜单-隐藏运行
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "StartMenuLogOff", "REG_DWORD", "00000000");开始菜单-隐藏注销
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoViewContextMenu", "REG_DWORD", "00000000");桌面-禁鼠标右键
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoTrayContextMenu", "REG_DWORD", "00000000");桌面-禁任务栏右键
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoCloseDragDropBands", "REG_DWORD", "00000000");桌面-禁止更改任务栏
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoFileMenu", "REG_DWORD", "00000000");资源管理器-隐藏文件菜单
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoDrives", "REG_DWORD", "0X00000000");资源管理器-隐藏盘符
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoViewOnDrive", "REG_DWORD", "00000000");禁止从我的电脑访问驱动器(只允许打开D盘)
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoFolderOptions", "REG_DWORD", "00000000");开始菜单-隐藏设置中的<文件夹选项>
                     RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoControlPanel", "REG_DWORD", "00000000");开始菜单-锁定控制面板
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\system","NoDispAppearancePage","REG_DWORD","00000000");桌面-隐藏显示属性中的<外观>
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\system","NoDispScrSavPage","REG_DWORD","00000000");桌面-隐藏显示属性中的<屏幕保护>
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\system","NoDispSettingsPage","REG_DWORD","00000000");桌面-隐藏显示属性中的<设置>
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\system","NoDispBackgroundPage","REG_DWORD","00000000");桌面-隐藏显示属性中的<背景>
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\system", "DisableLockWorkstation", "REG_DWORD", "00000000");系统-禁止锁定计算机
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\system", "DisableChangePassword", "REG_DWORD", "00000000");系统-禁止锁定电脑时修改密码
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\system", "DisableTaskMgr", "REG_DWORD", "00000000");系统-禁用任务管理器
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\system", "Disableregistrytools", "REG_DWORD", "00000000");系统-禁用注册表编辑器
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu", "{450D8FBA-AD25-11D0-98A8-0800361B1103}", "REG_DWORD", "00000000");桌面-显示我的文档
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu", "{20D04FE0-3AEA-1069-A2D8-08002B30309D}", "REG_DWORD", "00000000");桌面-显示我的电脑
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu", "{871C5380-42A0-1069-A2EA-08002B30309D}", "REG_DWORD", "00000000");桌面-显示IE
                        RegWrite("HKEY_CLASSES_ROOT\CLSID\{3FC0B520-68A9-11D0-8D77-00C04FD70822}\InProcServer32","","REG_EXPAND_SZ","%SystemRoot%\System32\shell32.dll");桌面-隐藏显示属性中的<桌面>
                        RegWrite("HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\InProcServer32","","REG_SZ","shell32.dll");解锁回收站
                        RegWrite("HKEY_CLASSES_ROOT\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}\InProcServer32","","REG_SZ","mydocs.dll");解锁我的文档
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer","NoThemesTab","REG_DWORD","00000000");桌面-隐藏显示属性中的<主题>
                        RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Restrictions", "NoBrowserOptions", "REG_DWORD", "00000000");IE-禁IE选项
                        RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Restrictions", "NoFavorites", "REG_DWORD", "00000000");IE-禁IE收藏夹
                        RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Restrictions", "NoSelectDownloadDir", "REG_DWORD", "00000000");IE-禁止下载文件保存到磁盘
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3", "1803", "REG_DWORD", "00000000");IE-锁定IE下载功能
                        RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System", "DisableCMD", "REG_DWORD", "00000000");系统-禁用命令行
                        RegDelete("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Ratings");删除IE分级审查
                        ;启用组策略.
                    _RunDOS("regsvr32 /s fde.dll")
                    _RunDOS("regsvr32 /s gpedit.dll")
                    _RunDOS("regsvr32 /s gptext.dll")
                    _RunDOS("regsvr32 /s wsecedit.dll")                
                    _RunDOS("gpupdate.exe /force");刷新策略
                        _RunDOS("gpupdate.exe /force");必须刷新两次才能见效果
                        MsgBox(64, "提示", "系统解锁成功!")
                        ;快捷方式
            FileCreateShortcut(@ScriptFullPath,@DesktopCommonDir & "\龙旋风工具锁 .lnk")
            FileCreateShortcut(@ScriptFullPath,@StartMenuDir & "\龙旋风工具锁 .lnk")
            FileCreateShortcut(@ScriptFullPath,@StartMenuCommonDir & "\龙旋风工具锁 .lnk")
        EndSwitch
WEnd
Func login()

        If $sUsS <> $sUsN Then

        

                $sUsPi = InputBox($sUsP, "请输入密码:", "", "*", 200, 80)

                If $sUsPi = $sUsP Then



                Else

                        MsgBox(64, "提示", "请联系管理员")

                        Exit

                EndIf

        EndIf

EndFunc   ;==>login
看了版主的代码.套了一下,脚本提示$TRAY_EVENT_PRIMARYDOWN: 未声明的全局变量.谁帮我声明一下啊
发表于 2011-5-18 16:58:05 | 显示全部楼层
值得思考!
发表于 2011-5-18 21:44:47 | 显示全部楼层
给你个思路,你要做的还有很多,建立托盘菜单,处理关闭按钮。。。。
#include <GUIConstants.au3>
#include <Process.au3>
#include <Constants.au3>
Opt ('TrayMenuMode',1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("龙旋风工具锁 V" & @YEAR, 288, 100, 354, 160)
GUISetBkColor(0x0066CC);设置窗体颜色
$Button1 = GUICtrlCreateButton("系统锁定", 30, 20, 100, 25, 0)
$Button2 = GUICtrlCreateButton("系统解锁", 160, 20, 100, 25, 0)
$Label1 = GUICtrlCreateLabel("系统时间:", 95, 65, 96, 25)
$Label2 = GUICtrlCreateLabel("Label2", 155, 65, 48, 25)
$sUsS = @UserName
$sUsN = "龙旋风"
$sUsP = @WDAY & @HOUR & @MDAY & @WDAY & @MON & @HOUR
login()
GUISetState(@SW_SHOW)
        WinSetState($Form1,"",@SW_HIDE)
#EndRegion ### END Koda GUI section ###
While 1
        If TrayGetMsg()=$TRAY_EVENT_PRIMARYDOWN Then
        WinSetState($Form1,"",@SW_HIDE)
        login()
        WinSetState($Form1,"",@SW_SHOW)
        EndIf
        $nMsg = GUIGetMsg()
        GUICtrlSetData($Label2, @HOUR & ':' & @MIN & ':' & @SEC)
        Sleep(50)
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu", "{450D8FBA-AD25-11D0-98A8-0800361B1103}", "REG_DWORD", "00000001");桌面-隐藏我的文档
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu", "{20D04FE0-3AEA-1069-A2D8-08002B30309D}", "REG_DWORD", "00000001");桌面-隐藏我的电脑
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu", "{208D2C60-3AEA-1069-A2D7-08002B30309D}", "REG_DWORD", "00000001");桌面-隐藏网络邻居
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu", "{871C5380-42A0-1069-A2EA-08002B30309D}", "REG_DWORD", "00000001");桌面-隐藏IE
                        RegDelete("HKEY_CLASSES_ROOT\lnkfile", "IsShortcut"); 去除快捷方式的箭头
                        RegWrite("HKEY_CLASSES_ROOT\lnkfile", "", "REG_SZ", ""); 去除快捷方式字样
                        ;禁止组策略.
                        _RunDOS("regsvr32 /s /u fde.dll")
                        _RunDOS("regsvr32 /s /u gpedit.dll")
                        _RunDOS("regsvr32 /s /u gptext.dll")
                        _RunDOS("regsvr32 /s /u wsecedit.dll")
                        _RunDOS("gpupdate.exe /force");刷新策略
                        _RunDOS("gpupdate.exe /force");必须刷新两次才能见效果
                        MsgBox(64, "提示", "系统锁定成功!")
                        ;快捷方式
                        FileCreateShortcut(@ScriptFullPath, @DesktopCommonDir & "\龙旋风工具锁 .lnk")
                        FileCreateShortcut(@ScriptFullPath, @StartMenuDir & "\龙旋风工具锁 .lnk")
                        FileCreateShortcut(@ScriptFullPath, @StartMenuCommonDir & "\龙旋风工具锁 .lnk")
                Case $Button2
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu", "{450D8FBA-AD25-11D0-98A8-0800361B1103}", "REG_DWORD", "00000000");桌面-显示我的文档
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu", "{20D04FE0-3AEA-1069-A2D8-08002B30309D}", "REG_DWORD", "00000000");桌面-显示我的电脑
                        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu", "{871C5380-42A0-1069-A2EA-08002B30309D}", "REG_DWORD", "00000000");桌面-显示IE
                        RegDelete("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Ratings");删除IE分级审查
                        ;启用组策略.
                        _RunDOS("regsvr32 /s fde.dll")
                        _RunDOS("regsvr32 /s gpedit.dll")
                        _RunDOS("regsvr32 /s gptext.dll")
                        _RunDOS("regsvr32 /s wsecedit.dll")
                        _RunDOS("gpupdate.exe /force");刷新策略
                        _RunDOS("gpupdate.exe /force");必须刷新两次才能见效果
                        MsgBox(64, "提示", "系统解锁成功!")
                        ;快捷方式
                        FileCreateShortcut(@ScriptFullPath, @DesktopCommonDir & "\龙旋风工具锁 .lnk")
                        FileCreateShortcut(@ScriptFullPath, @StartMenuDir & "\龙旋风工具锁 .lnk")
                        FileCreateShortcut(@ScriptFullPath, @StartMenuCommonDir & "\龙旋风工具锁 .lnk")
        EndSwitch
WEnd
Func login()
        If $sUsS <> $sUsN Then
        
                $sUsPi = InputBox($sUsP, "请输入密码:", "", "*", 200, 80)
                If $sUsPi = $sUsP Then

                Else
                        MsgBox(64, "提示", "请联系管理员")
                        Exit
                EndIf
        EndIf
EndFunc   ;==>login
 楼主| 发表于 2011-6-5 18:39:53 | 显示全部楼层
本帖最后由 control938 于 2011-6-5 20:11 编辑

套用代码.变量未声明?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2011-6-6 01:01:54 | 显示全部楼层
_RunDOS("gpupdate.exe /force");刷新策略

                        _RunDOS("gpupdate.exe /force");必须刷新两次才能见效果

你的变量错误我没看,不过这个应该是误区"必须刷新两次才能见效果"

刷新组策略用wait:0参数应该就可以了
发表于 2011-6-6 10:08:49 | 显示全部楼层
又见楼主啊...在自由天空看到楼主的...在回复一次,赚点钱...o(∩_∩)o
pcbar大里面包含了这个#include <Constants.au3>...在Constants.au3这个文件里面包含了那个变量的定义..
楼主可以看看Constants.au3那个文件,打开就可以看到变量在那个里面有定义的
 楼主| 发表于 2011-6-6 11:23:37 | 显示全部楼层
呵呵···  你真是太给力了
发表于 2011-6-6 11:52:55 | 显示全部楼层
回复 7# control938


    楼主咋有这么多金钱的???羡慕ing
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-11-15 01:44 , Processed in 0.083506 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表