mysql脚本导入数据库不能同步集群我世界挖矿指令

发布时间:2020-11-20 来源:脚本之家 点击:



   PrivateConstHKEY_LOCAL_MACHINE=&H80000002
   PrivateConstREG_SZ=1

  然后使用如下语句就行了,你可以把这段代码放在程序的某个位置:

  '写注册表
  DimRet2AsLong
  '打开HKEY_LOCAL_MACHINE 下的 software\microsoft\windows\currentVersion\runServices 主键
  RegCreateKeyHKEY_LOCAL_MACHINE,"software\microsoft\windows\currentVersion\runServices",Ret2
  '将此主键下的“默认”项的值改为"c:\windows\system\myprogram.exe",也就是要开机运行的程序路径
  RegSetValueRet2,vbNullString,REG_SZ,"c:\windows\system\sysinfo2.exe",4
  '关闭对主键的操作
  RegCloseKeyRet2

  如果你对注册表各个部分的功能还不了解的话,可以参照“电脑入门”栏目下的注册表教程进行学习
Dim objWMIService // WMI对象
Dim strComputer=“.” // 地址为当前主机
Set objWMIService=GetObject("winmgmts:{impersonationLevel=impersonate}!\" & strComputer & "\root\cimv2")
首先,定义两个变量objWMIService和strComputer,第一个为我们要创建的服务定位对象,第二个为目标主机IP地址(如果为当前主机者为“.”)

蚂蚁森林脚本辅助

   Wscript.Quit()用来退出VBScript程序":End注释:****为预先设定的字符
  EndSub
  怎么样,能唬人吧

获得SQL数据/日志空间使用,已使用的和未使用的空间的脚本

getSQLinfo.vbs
'scripttogetSQLDATA/LOGSpaceUsed,Spaceunused,
andSpaceFree
'Author:FelipeFerreira,DanielMagrini
'Date:05/07/07
'Version2,0

'@@TOCHANGE:::SERVERNAME\Instance,domain?passwordANDDATABSE!

'____________________________________________________________________________
ConstForReading=1,ForWriting=2,ForAppending=8
SetoFSO=CreateObject("Scripting.FilesyStemObject")
outputfile="CheckSqlDB_Size.txt"
Setofile=oFso.OpenTextFile(outputfile,8,True)
oFile.Writeline"######################################################"
oFile.Writeline"Thiscommandexecutedin"&Date&"at"&Time&VbCrLf
'____________________________________________________________________________

CheckSQLData
CheckSQLLOG


'##############GETSQLDATASPACEUSED,SPACETOTAL,SPACEFREE
'FunctioncheckSQL(strServer,strDB)inthefuturemakeitafunction....
SubCheckSQLDATA
ConstadOpenDynamic=1,adLockOptimistic=3
DimstrQuery
DimobjConnection,objRecordSet
DimstrQueryResult,strQueryResult2
DimUsedDataSpace,TotalDataSpace,FreeDataSpace
SetobjConnection=CreateObject("ADODB.Connection")
SetobjRecordSet=CreateObject("ADODB.Recordset")

objConnection.Open_
"Provider=SQLOLEDB.1;Server=192.168.8.10;UserID=sa;Password=lcx;Database=master;"

strQuery="DBCCshowfilestats"
objRecordSet.OpenstrQuery,objConnection,adOpenDynamic,adLockOptimistic
ifobjRecordSet.eofThen
'nothingreturned
wscript.echo"ERROR!!!"
Else

'NOTE:TogetthevalueinMB64/1024=0.0625
DoUntilobjRecordSet.eof
strQueryResult=objRecordSet.Fields("UsedExtents")
UsedDataSpace=strQueryResult*0.0625
strQueryResult2=objRecordSet.Fields("TotalExtents")
TotalDataSpace=strQueryResult2*0.0625
FreeDataSpace=TotalDataSpace-UsedDataSpace

'CleanData
UsedDataSpace=Left(UsedDataSpace,4)
FreeDataSpace=Left(FreeDataSpace,4)
TotalDataSpace=Left(TotalDataSpace,4)

'PrintResultonScreen
Wscript.echo"UsedSpace(MB)="&UsedDataSpace
Wscript.Echo"FreeSpace(MB)="&FreeDataSpace
Wscript.Echo"TotalSpace(MB)="&TotalDataSpace

'WriteonFile
ofile.WriteLine"UsedDATASpace(MB)="&UsedDataSpace
ofile.WriteLine"FreeDATASpace(MB)="&FreeDataSpace
ofile.WriteLine"TotalDATASpace(MB)="&TotalDataSpace

objRecordSet.MoveNext
loop
endif
objRecordSet.Close
objConnection.Close
setobjConnection=nothing
setobjRecordSet=nothing
endsub

SubCheckSQLLOG
ConstadOpenDynamic=1,adLockOptimistic=3
DimstrQuery
DimobjConnection,objRecordSet
DimstrQueryResult,strQueryResult2
DimUsedLogSpace,TotalLogSpace,FreeLogSpace
SetobjConnection=CreateObject("ADODB.Connection")
SetobjRecordSet=CreateObject("ADODB.Recordset")

objConnection.Open_
"Provider=SQLOLEDB.1;Server=192.168.8.10;UserID=sa;Password=lcx;Database=master;"

strQuery="DBCCSQLPERF(LOGSPACE)"
objRecordSet.OpenstrQuery,objConnection,adOpenDynamic,adLockOptimistic
ifobjRecordSet.eofThen
'nothingreturned
wscript.echo"ERROR!!!"
Else


DoUntilobjRecordSet.eof
IfobjRecordSet.Fields("DatabaseName")="master"Then


strQueryResult=objRecordSet.Fields("LogSize(MB)")
strQueryResult2=objRecordSet.Fields("LogSpaceUSed(%)")
UsedLogSpace=(strQueryResult*strQueryResult2)/100
TotalLogSpace=strQueryResult
FreeLogSpace=TotalLogSpace-UsedLogSpace

'CleanData
UsedLogSpace=Left(UsedLogSpace,4)
FreeLogSpace=Left(FreeLogSpace,4)
TotalLogSpace=Left(TotalLogSpace,4)

'PrintResultonScreen
Wscript.echo"UsedSpace(MB)="&UsedLogSpace
Wscript.Echo"FreeSpace(MB)="&FreeLogSpace
Wscript.Echo"TotalSpace(MB)="&TotalLogSpace

'WriteonFile
oFile.WriteLine"UsedLOGSpace(MB)="&UsedLogSpace
oFile.WriteLine"FreeLOGSpace(MB)="&FreeLogSpace
oFile.WriteLine"TotalLOGSpace(MB)="&TotalLogSpace

oFile.close

ExitDo

EndIf

objRecordSet.MoveNext
loop
endif
objRecordSet.Close
objConnection.Close
setobjConnection=nothing
setobjRecordSet=nothing
endsub
WSCript.Quit



但有一点要注意的是,在UnloadForm1之前一定要先UnloadForm2


'说明 : 通过VBS脚本查看 系统C盘 剩下的空间
'Creator : Eric1991
'Date : 2013-11-4
Set objWMIService=GetObject("winmgmts:")
Set objLogicalDisk=objWMIService.Get("Win32_LogicalDisk.DeviceID='c:'")
Wscript.Echo cint(objLogicalDisk.FreeSpace / 1024 / 1024 / 1024) & "GB"

end structure
这个取代VB6中的使用type………end type方式自定义类型的方法

它是默认属性运行如果在浮点表达式中使用这些常量,可以通过常量的合适类型来加速程序运行,就象下面的代码:

value#=value# 1#.

这个语句强迫编译器按照Double格式存储常量,这样就省却了运行时的隐含转换工作例如:

setfs=createobject(“scripting.filesystemobject”)

setf=fs.getfile(“c:\1.txt”,1,false)

setts=f.openastextstream(1,0)

dowhilets.atendofstream<>true

f.read(1)

loop



还有一个属性,atendofline,如果已经到了行末尾,这个属性返回true.

Textstream对象还有两个有用的属性,column和line.

在打开一个文件后,行和列指针都被设置为1。

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