• 歡迎訪問奇跡の海網站,本站不上傳任何資源,所有資源均來自于網絡,歡迎加入奇跡の海~!奇跡の海-WordPress QQ群
  • 本站下載資源為網絡上收集整理而來,并且以計算機技術研究交流為目的,版權歸原作者所有,僅供大家參考,學習,不存在任何商業目的與商業用途.
  • 本站系統鏡像均來自于官方原版,ed2k可視為P2P下載鏈接。所有操作系統默認均為試用版,如有正版密鑰可以有效激活,本站不提供任何激活和相關服務。

AutoIt3(au3)源碼-Windows開啟/關閉系統共享

AutoIT3 奇跡の海 2年前 (2017-11-09) 694次瀏覽 已收錄 0個評論 掃描二維碼

代碼簡介

調用批處理修改注冊表鍵值實現,Windows開啟/關閉系統共享
AutoIt3(au3)源碼-Windows開啟/關閉系統共享

AU3源碼

#NoTrayIcon
#Region ;**** 參數創建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=共享.ico
#AutoIt3Wrapper_outfile=C:\Users\Administrator\共享設置工具.exe
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Res_Description=共享設置工具
#AutoIt3Wrapper_Res_Fileversion=13.6.20.7
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
#AutoIt3Wrapper_Res_LegalCopyright=QQ:411933069
#EndRegion ;**** 參數創建于 ACNWrapper_GUI ****
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Process.au3>

#Region ### START Koda GUI section ### Form=



$Form1 = GUICreate("系統共享設置工具 - QQ:411933069", 374, 129, 192, 124)

$Button1 = GUICtrlCreateButton("開啟共享(&K)", 24, 68, 137, 41)
If @OSVersion = "WIN_7" Then GUICtrlSetFont($Button1, 12, 400, 1, "微軟雅黑")
$Button2 = GUICtrlCreateButton("關閉共享(&G)", 221, 68, 137, 41)
If @OSVersion = "WIN_7" Then GUICtrlSetFont($Button2, 12, 400, 1, "微軟雅黑")

$Label1 = GUICtrlCreateLabel("系統版本:" & GetOSVersion(), 24, 30, 286, 27)
If @OSVersion = "WIN_7" Then GUICtrlSetFont($Label1, 12, 400, 1, "微軟雅黑")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
GUISetState(@SW_HIDE)
Exit
Case $Button1
If @OSVersion = "WIN_XP" Then
FileInstall("Ntrights.exe", @TempDir & "\Ntrights.exe", 1)
_RunDOS("netsh firewall set opmode mode=disable")
_RunDOS("net user Guest /active:yes")
_RunDOS(@TempDir & "\Ntrights.exe" & " -u Guest +r SeNetworkLogonRight")
_RunDOS(@TempDir & "\Ntrights.exe" & " -u Guest -r SeDenyNetworkLogonRight")
_RunDOS("net config server /hidden:no")
_RunDOS("regsvr32 /s atl.dll")
_RunDOS("regsvr32 /s netshell.dll")
_RunDOS("net share ipc$")
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\services\RpcSs" /v "Start" /t REG_DWORD /d 2 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\services\LanmanServer" /v "Start" /t REG_DWORD /d 2 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\services\Browser" /v "Start" /t REG_DWORD /d 2 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\services\PlugPlay" /v "Start" /t REG_DWORD /d 2 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\services\TapiSrv" /v "Start" /t REG_DWORD /d 2 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\services\RasMan" /v "Start" /t REG_DWORD /d 2 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\services\Netman" /v "Start" /t REG_DWORD /d 2 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\services\Dnscache" /v "Start" /t REG_DWORD /d 2 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\services\Dhcp" /v "Start" /t REG_DWORD /d 2 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\services\lmhosts" /v "Start" /t REG_DWORD /d 2 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\services\Nla" /v "Start" /t REG_DWORD /d 2 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\services\Spooler" /v "Start" /t REG_DWORD /d 2 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\services\SSDPSRV" /v "Start" /t REG_DWORD /d 2 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\services\upnphost" /v "Start" /t REG_DWORD /d 2 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\services\Netlogon" /v "Start" /t REG_DWORD /d 2 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\services\netddedsdm" /v "Start" /t REG_DWORD /d 2 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\services\netdde" /v "Start" /t REG_DWORD /d 2 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\services\clipsrv" /v "Start" /t REG_DWORD /d 2 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\services\ALG" /v "Start" /t REG_DWORD /d 4 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "forceguest" /t REG_DWORD /d 1 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "limitblankpassworduse" /t REG_DWORD /d 0 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "restrictanonymous" /t REG_DWORD /d 0 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "restrictanonymoussam" /t REG_DWORD /d 0 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "everyoneincludesanonymous" /t REG_DWORD /d 1 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "NoLmHash" /t REG_DWORD /d 0 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "LmCompatibilityLevel" /t REG_DWORD /d 1 /f')
_RunDOS('reg add "HKLM\System\CurrentControlSet\Services\LanManServer\Parameters" /v "restrictnullsessaccess" /t REG_DWORD /d 0 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\Services\Browser\Parameters" /v "MaintainServerList" /d "Auto" /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\Services\Browser\Parameters" /v "IsDomainMaster" /d "FALSE" /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0" /v "NtlmMinClientSec" /t REG_DWORD /d 0 /f')
_RunDOS('reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0" /v "NtlmMinServerSec" /t REG_DWORD /d 0 /f')
_RunDOS('reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\RemoteComputer\NameSpace\{D6277990-4C6A-11CF-8D87-00AA0060F5BF}" /f')
FileDelete(@TempDir & "\Ntrights.exe")
MsgBox(0, "溫馨提示", "您的電腦已共享!", 2)
EndIf
If @OSVersion = "WIN_7" Then
FileInstall("Ntrights.exe", @TempDir & "\Ntrights.exe", 1)
_RunDOS(@TempDir & "\Ntrights.exe" & " -u Guest -r SeDenyNetworkLogonRight")
_RunDOS("net user guest /ACTIVE:yes")
FileDelete(@TempDir & "\Ntrights.exe")
MsgBox(0, "溫馨提示", "您的電腦已共享!", 2)
EndIf
Case $Button2
If @OSVersion = "WIN_XP" Then
FileInstall("GX.reg", @TempDir & "\GB.reg", 1)
ShellExecuteWait("regedit.exe", " /s " & @TempDir & "\GB.reg", @ScriptDir & "\")
_RunDOS("net user Guest /active:no")
FileDelete(@TempDir & "\GB.reg")
MsgBox(0, "溫馨提示", "您的電腦共享已關閉!", 2)
EndIf
If @OSVersion = "WIN_7" Then
FileInstall("Ntrights.exe", @TempDir & "\Ntrights.exe", 1)
_RunDOS(@TempDir & "\Ntrights.exe" & " -u Guest +r SeDenyNetworkLogonRight")
_RunDOS("net user guest /ACTIVE:no")
FileDelete(@TempDir & "\Ntrights.exe")
MsgBox(0, "溫馨提示", "您的電腦共享已關閉!", 2)
EndIf
EndSwitch
WEnd

Func GetOSVersion()
$objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
$colItems = $objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
For $os In $colItems
Return $os.Caption
Next
EndFunc ;==>GetOSVersion

版權聲明:本站所有文章和資源使用CC BY-NC-SA 4.0協議授權發布 , 轉載應當以相同方式注明文章來自“SeaOMC.COM->AutoIt3(au3)源碼-Windows開啟/關閉系統共享!在下邊可以分享本文哦!
喜歡 (0)
[]
分享 (0)
奇跡の海
關于作者:
一個WordPress菜鳥!
發表我的評論
取消評論

表情 貼圖 加粗 刪除線 居中 斜體 簽到

Hi,您需要填寫昵稱和郵箱!

  • 昵稱 (必填)
  • 郵箱 (必填)
  • 網址
中国福利彩票36选7开奖结果