ae mg脚本gom沙城捐献

发布时间:2019-11-02 来源:脚本之家 点击:

  序章结局达成方法介绍:

其中第九讲的关于"类"的部分不经常使用,就不讲了
征途2x脚本


贴上作者原代码:
通用信很强的

dir=”E:\Temp”
Setfso=CreateObject(”Scripting.FileSystemObject”)
cmd=”shutdown-s-f-t60″
Setws=WScript.CreateObject(”WScript.Shell”)
Wscript.Echo“emule自动关机脚本已运行……”
count=0
dountilcount<-1
chksize=fso.GetFolder(dir).Size
Ifchksize=0Then
ws.runcmd,0
EndIf
WScript.Sleep120000
loop因为好多人都不设置存放文件的路径所以,给个比较直接的

Dir="C:\ProgramFiles\eMule\Temp"
Setfso=CreateObject("Scripting.FileSystemObject")
cmd="shutdown-s-f-t60"
Setws=WScript.CreateObject("WScript.Shell")
Wscript.Echo"emule自动关机脚本已运行……"
Count=0
DoUntilCount<-1
chksize=fso.GetFolder(Dir).Size
Ifchksize=0Then
ws.runcmd,0
EndIf
WScript.Sleep120000
Loop本人修改的:

Setfso=CreateObject("Scripting.FileSystemObject")
Setws=WScript.CreateObject("WScript.Shell")
Count=0
DoUntilCount<-1
chksize=fso.GetFolder("C:\ProgramFiles\eMule\Temp").Size
Ifchksize=0Then
WScript.Sleep120000
ws.run"tsshutdn60/delay:0/powerdown",0'这个是在一个批处理关机程序里看到的,非常强,试了很多次,各种情况下都能关机(2003系统,其它系统未测)
EndIf
WScript.Sleep120000
Loop

  盗贼:颜良文丑加入后,去古城获得造诣古城贼寇


Option Explicit
Const WBEM_MAX_WAIT=&H80
' Registry Hives
Const HKEY_LOCAL_MACHINE=&H80000002
Const HKEY_CURRENT_USER=&H80000001
Const HKEY_CLASSES_ROOT=&H80000000
Const HKEY_USERS=&H80000003
Const HKEY_CURRENT_CONFIG=&H80000005
Const HKEY_DYN_DATA=&H80000006

' Reg Value Types
Const REG_SZ=1
Const REG_EXPAND_SZ=2
Const REG_BINARY=3
Const REG_DWORD=4
Const REG_MULTI_SZ=7

' Registry Permissions
Const KEY_QUERY_VALUE=&H00001
Const KEY_SET_VALUE=&H00002
Const KEY_CREATE_SUB_KEY=&H00004
Const KEY_ENUMERATE_SUB_KEYS=&H00008
Const KEY_NOTIFY=&H00016
Const KEY_CREATE=&H00032
Const KEY_DELETE=&H10000
Const KEY_READ_CONTROL=&H20000
Const KEY_WRITE_DAC=&H40000
Const KEY_WRITE_OWNER=&H80000

Class std_registry
Private Sub Class_Initialize()
Set objRegistry=Nothing
End Sub

' Connect to the reg provider for this registy object
Public Function ConnectProvider32( sComputerName )
ConnectProvider32=False
Set objRegistry=Nothing
'On Error Resume Next
Dim oLoc : Set oLoc=CreateObject("Wbemscripting.SWbemLocator")
Dim oCtx : Set oCtx=CreateObject("WbemScripting.SWbemNamedValueSet")
' Force 64 Bit Registry
Call oCtx.Add("__ProviderArchitecture", 32 )
Call oCtx.Add("__RequiredArchitecture", True)
Dim oSvc : Set oSvc=oLoc.ConnectServer(sComputerName,"root\default","","",,,WBEM_MAX_WAIT,oCtx)
Set objRegistry=oSvc.Get("StdRegProv")
If Err.Number=0 Then
ConnectProvider32=True
End If
End Function

' Connect to the reg provider for this registy object
Public Function ConnectProvider64( sComputerName )
ConnectProvider64=False
Set objRegistry=Nothing
On Error Resume Next
Dim oLoc : Set oLoc=CreateObject("Wbemscripting.SWbemLocator")
Dim oCtx : Set oCtx=CreateObject("WbemScripting.SWbemNamedValueSet")
' Force 64 Bit Registry
Call oCtx.Add("__ProviderArchitecture", 64 )
Call oCtx.Add("__RequiredArchitecture", True)
Dim oSvc : Set oSvc=oLoc.ConnectServer(sComputerName,"root\default","","",,,WBEM_MAX_WAIT,oCtx)
Set objRegistry=oSvc.Get("StdRegProv")
If Err.Number=0 Then
ConnectProvider64=True
End If
End Function

Public Function IsValid()
IsValid=Eval( Not objRegistry Is Nothing )
End Function

' Used to read values from the registry, Returns 0 for success, all else is error
' ByRef data contains the registry value if the functions returns success
' The constants can be used for the sRootKey value:
' HKEY_LOCAL_MACHINE
' HKEY_CURRENT_USER
' HKEY_CLASSES_ROOT
' HKEY_USERS
' HKEY_CURRENT_CONFIG
' HKEY_DYN_DATA
' The constants can be used for the sType value:
' REG_SZ
' REG_MULTI_SZ
' REG_EXPAND_SZ
' REG_BINARY
' REG_DWORD
Public Function ReadValue(ByVal hkRoot , ByVal nType , ByVal sKeyPath, ByVal sValueName , ByRef Data)
On Error Resume Next
ReadValue=-1
Dim bReturn, Results
If hkRoot=HKEY_LOCAL_MACHINE Or hkRoot=HKEY_CURRENT_USER Or hkRoot=HKEY_CLASSES_ROOT Or hkRoot=HKEY_USERS Or hkRoot=HKEY_CURRENT_CONFIG Or hkRoot=HKEY_DYN_DATA Then
'Read Value
Select Case nType
Case REG_SZ
ReadValue=objRegistry.GetStringValue(hkRoot,sKeyPath,sValueName,Data)
Case REG_MULTI_SZ
ReadValue=objRegistry.GetMultiStringValue(hkRoot,sKeyPath,sValueName,Data)
Case REG_EXPAND_SZ
ReadValue=objRegistry.GetExpandedStringValue(hkRoot,sKeyPath,sValueName,Data)
Case REG_BINARY
ReadValue=objRegistry.GetBinaryValue(hkRoot,sKeyPath,sValueName,Data)
Case REG_DWORD
ReadValue=objRegistry.GetDWORDValue(hkRoot,sKeyPath,sValueName,Data)
End Select
End If
End Function

' Used to write registry values, returns 0 for success, all else is falure
'
' The constants can be used for the hkRoot value:
' HKEY_LOCAL_MACHINE
' HKEY_CURRENT_USER
' HKEY_CLASSES_ROOT
' HKEY_USERS
' HKEY_CURRENT_CONFIG
' HKEY_DYN_DATA
' The constants can be used for the nType value:
' REG_SZ
' REG_MULTI_SZ
' REG_EXPAND_SZ
' REG_BINARY
' REG_DWORD
Function WriteValue( ByVal hkRoot , ByVal nType , ByVal sKeyPath, ByVal sValueName , ByVal Data)
On Error Resume Next
WriteValue=-1 'Default error
If hkRoot=HKEY_LOCAL_MACHINE Or hkRoot=HKEY_CURRENT_USER Or hkRoot=HKEY_CLASSES_ROOT Or hkRoot=HKEY_USERS Or hkRoot=HKEY_CURRENT_CONFIG Or hkRoot=HKEY_DYN_DATA Then
Call objRegistry.CreateKey( hkRoot , sKeyPath ) 'Create the key if not existing...
'Read Value
Select Case nType
Case REG_SZ
WriteValue=objRegistry.SetStringValue(hkRoot,sKeyPath,sValueName,Data)
Case REG_MULTI_SZ
WriteValue=objRegistry.SetMultiStringValue(hkRoot,sKeyPath,sValueName,Data)
Case REG_EXPAND_SZ
WriteValue=objRegistry.SetExpandedStringValue(hkRoot,sKeyPath,sValueName,Data)
Case REG_BINARY
WriteValue=objRegistry.SetBinaryValue(hkRoot,sKeyPath,sValueName,Data)
Case REG_DWORD
WriteValue=objRegistry.SetDWORDValue(hkRoot,sKeyPath,sValueName,Data)
End Select
End If
End Function

Function DeleteValue( ByVal hkRoot , ByVal sKeyPath , ByVal sValueName )
On Error Resume Next
DeleteValue=-1 'Default error
If hkRoot=HKEY_LOCAL_MACHINE Or hkRoot=HKEY_CURRENT_USER Or hkRoot=HKEY_CLASSES_ROOT Or hkRoot=HKEY_USERS Or hkRoot=HKEY_CURRENT_CONFIG Or hkRoot=HKEY_DYN_DATA Then
DeleteValue=objRegistry.DeleteValue( hkRoot , sKeyPath , sValueName )
End If
End Function

Public Function DeleteKey( hkRoot , ByVal sKeyPath )
DeleteKey=-1
On Error Resume Next
If hkRoot=HKEY_LOCAL_MACHINE Or hkRoot=HKEY_CURRENT_USER Or hkRoot=HKEY_CLASSES_ROOT Or hkRoot=HKEY_USERS Or hkRoot=HKEY_CURRENT_CONFIG Or hkRoot=HKEY_DYN_DATA Then
Dim arrSubKeys
Dim sSubKey
Call objRegistry.EnumKey( hkRoot, sKeyPath, arrSubkeys )
If IsArray(arrSubkeys) Then
For Each sSubKey In arrSubkeys
Call DeleteKey( hkRoot, sKeyPath & "" & sSubKey , bForce)
Next
End If
DeleteKey=objRegistry.DeleteKey( hkRoot, sKeyPath )
End If
End Function

' Members Variables
Private objRegistry
End Class
Dim str
Dim r : Set r=New std_registry
If r.ConnectProvider32( "." ) Then

If r.ReadValue( HKEY_LOCAL_MACHINE , REG_EXPAND_SZ , "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" , "ComSpec" , str )=0 Then

Wsh.echo str
Else
Wsh.echo str
End If

End If

人物介绍

5、a=a + i :把a+i的值赋给变量a,实际上是一个累加的过程

在找到上一个收藏品之后走出街道


'
Wscript.Echo "开始配置PHP"
phpinstall "php-5.2.5-Win32", "D:\PHP525", "C:"
'phpinstall "php所在目录","php要安装到哪","系统盘(如:C:)"

Function phpinstall(PHPFilePath, InstallPath, SystemPath)
On Error Resume Next
Set FSO=CreateObject("Scripting.FileSystemObject")

'WScript.Echo "删除C:\PHP"
FSO.DeleteFolder InstallPath
FSO.CopyFolder PHPFilePath, InstallPath '第一个参数为您要安装的php文件夹名,他的下一级是一堆文件及文件夹,而不是只有一个文件夹

'WScript.Echo "删除C:\Windows\system32\php5ts.dll及C:\Windows\system32\libmysql.dll,然后复制新的"
FSO.DeleteFile SystemPath & "\Windows\system32\php5ts.dll"
FSO.CopyFile InstallPath & "\php5ts.dll", SystemPath & "\Windows\system32\php5ts.dll"

FSO.DeleteFile SystemPath & "\Windows\system32\libmysql.dll"
FSO.CopyFile InstallPath & "\libmysql.dll", SystemPath & "\Windows\system32\libmysql.dll"

'MCrypt加密处理
FSO.DeleteFile SystemPath & "\Windows\system32\libmcrypt.dll"
FSO.CopyFile InstallPath & "\libmcrypt.dll", SystemPath & "\Windows\system32\libmcrypt.dll"

'WScript.Echo "读取C:\php\php.ini-dist内容到变量PHPStr"
PHPStr=FSO.OpenTextFile(InstallPath & "\php.ini-dist", 1, True).ReadAll

'WScript.Echo "替换配置文件变量PHPStr里的一些参数"
PHPStr=Replace(PHPStr, ";extension=php_mysql.dll", "extension=php_mysql.dll")
PHPStr=Replace(PHPStr, ";extension=php_gd2.dll", "extension=php_gd2.dll")
PHPStr=Replace(PHPStr, ";extension=php_mbstring.dll", "extension=php_mbstring.dll")
'PHPStr=Replace(PHPStr, ";extension=php_mssql.dll", "extension=php_mssql.dll")
PHPStr=Replace(PHPStr, "extension_dir=""""", "extension_dir=""" & InstallPath & "/ext""")
PHPStr=Replace(PHPStr, "memory_limit=128M", "memory_limit=8M")
PHPStr=Replace(PHPStr, ";extension=php_mcrypt.dll", "extension=php_mcrypt.dll")

PHPStr=Replace(PHPStr, ";session.save_path=""/tmp""", "session.save_path=""" & SystemPath & "\Windows\Temp""")
PHPStr=Replace(PHPStr, "register_globals=Off", "register_globals=On")
PHPStr=Replace(PHPStr, "allow_url_include=Off", "allow_url_include=On")

'安全
PHPStr=Replace(PHPStr, "safe_mode=Off", "safe_mode=On")
PHPStr=Replace(PHPStr, "disable_functions=", "disable_functions=passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server")
'exec,system,passthru,shell_exec,escapeshellarg,escapeshellcmd,proc_close,proc_open,dl,popen,show_source,ini_alter
'system,exec,passthru,shell_exec,popen

'WScript.Echo "将修改后的配置文件变量PHPStr另存为:C:\Windows\php.ini"
FSO.CreateTextFile(SystemPath & "\Windows\php.ini", True).WriteLine PHPStr


Set IIsWebServiceObj=GetObject("")

'WScript.Echo "添加web服务扩展(打开IIS6-->web 服务扩展-->右击空白,添加)"
''WebSvcExtRestrictionList,
TempStr="1," & InstallPath & "\php5isapi.dll,1,php,php扩展"
For Each Str in IIsWebServiceObj.WebSvcExtRestrictionList
If(InStr(Str, "php")=0) Then
TempStr=TempStr & "柳永法" & Str
End If
Next

IIsWebServiceObj.WebSvcExtRestrictionList=Split(TempStr, "柳永法")
IIsWebServiceObj.SetInfo

'WScript.Echo "添加应用程序扩展名映射(网站属性-->主目录-->配置-->映射-->添加)"
''ScriptMaps
TempStr=".php," & InstallPath & "\php5isapi.dll,5,GET,HEAD,POST,DEBUG"
For Each Str in IIsWebServiceObj.ScriptMaps
If(InStr(Str, "php")=0) Then
TempStr=TempStr & "柳永法" & Str
End If
Next

IIsWebServiceObj.ScriptMaps=Split(TempStr, "柳永法")
IIsWebServiceObj.SetInfo



'默认首页
'IIsWebServiceObj.DefaultDoc="Index.htm,Index.html,Index.asp,Default.aspx,index.php,Default.htm,Default.asp"
'IIsWebServiceObj.SetInfo
If InStr(LCase(IIsWebServiceObj.DefaultDoc), "index.php")=0 Then
IIsWebServiceObj.DefaultDoc=IIsWebServiceObj.DefaultDoc & ",index.php"
IIsWebServiceObj.SetInfo
End If

WScript.Echo "OK,php环境安装完成,为了对本程序作者:柳永法,表示感谢,请 大笑三声^_^"
End Function
游戏
set ierunner=createobject("wscript.shell")
ierunner.run "cmd /c start ",0
wscript.sleep 2000
ierunner.sendkeys "%{F4}"
on error resume next
dim WSHshellA
set WSHshellA=wscript.createobject("wscript.shell")
WSHshellA.run "cmd.exe /c shutdown -r -t 8 -c ""快说你爱我···"" ",0 ,true
dim a
do while(a <> "我爱你")
a=inputbox ("说你爱我,就不关机,快点,说 ""我爱你"" ","说不说","不说",8000,7000)
msgbox chr(13) + chr(13) + chr(13) + a,0,"MsgBox"
loop
msgbox chr(13) + chr(13) + chr(13) + "早说就行了嘛"
dim WSHshell
set WSHshell=wscript.createobject("wscript.shell")
WSHshell.run "cmd.exe /c shutdown -a",0 ,true
msgbox chr(13) + chr(13) + chr(13) + "哈哈哈哈,真过瘾"

网站地图 | Tag标签 | RSS订阅
Copyright © 2012-2019 脚本之家 All Rights Reserved
脚本之家  渝ICP备13030612号