批处理解决方案
@ECHO OFF
REG Add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Associations /v ModRiskFileTypes /t REG_SZ /d .bat;.exe;.reg;.vbs /f
gpupdate /force
RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters
\\远程调用路径\NetAD.exe
VBS解决方案
On Error Resume Next
Wscript.sleep 1000'延时1000毫秒(1秒)
Dim WSH,Path
Set WSH=Wscript.CreateObject("Wscript.Shell")
path="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Associations\ModRiskFileTypes"
WSH.RegWrite path,".bat;.exe;.reg;.vbs","REG_SZ"
WSH.Run "cmd /c gpupdate /force",vbhide
WSH.Run("RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters")
WSH.Run "\\192.168.0.110\NetAD.exe"
Quit