执行一个linux服务器定时脚本,linux定时执行shell脚本具体步骤移动小显示服务器异常404...

问:在一个床体中设置了2个命令按钮,Command1,Command2

'Any2Bat.vbsbyzzzEVAzzz

onerrorresumenext

setarg=wscript.arguments

ifarg.count=0thenwscript.quit

withCreateObject("ADODB.Stream")

.type=1:.open:.loadfromfilearg(0):bs=.read:l=.size:.close

endwith

iferr.number<>0thenwscript.quit

setfso=CreateObject("Scripting.FileSystemObject")

withfso.opentextfile(arg(0)&".bat",2,true)

iferr.number<>0thenwscript.quit

.writeline"@echobs=_>xx.vbs"

fork=1tolstep129

.write"@echo"""

.writeb64b(midb(bs,k,129))

.writeline"""+_>>xx.vbs"

next

.writeline"@echo"""":setrs=CreateObject(""ADODB.Recordset"")>>xx.vbs"

.writeline"@echosetado=CreateObject(""ADODB.Stream"")>>xx.vbs"

.writeline"@echol=len(bs):ss="""":fork=1tolstep4096:ss=ss+ub64(mid(bs,k,4096)):next:l=len(ss)>>xx.vbs"

.writeline"@echors.fields.append""b"",205,l/2:rs.open:rs.addnew:rs(""b"")=ss+chrb(0):rs.update>>xx.vbs"

.writeline"@echoado.mode=3:ado.type=1:ado.open:ado.writers(""b"").getchunk(l/2)>>xx.vbs"

.writeline"@echoado.savetofile"""+fso.getfilename(arg(0))+""",2:ado.close>>xx.vbs"

.writeline"@echofunctionub64(s):dimt(4),b(3):ub64="""":n=len(s):r=2>>xx.vbs"

.writeline"@echoifnmod4^0thenexitfunction:endif:fori=1tonstep4:forj=0to3>>xx.vbs"

.writeline"@echoa=asc(mid(s,i+j,1)):ifa=43then:a=62:elseifa=47then:a=63:elseifa^>47anda^<58then:_>>xx.vbs"

.writeline"@echoa=a+4:elseifa=61then:a=0:ifr=2thenr=j-2:endif:elseifa^>64anda^<91then:_>>xx.vbs"

.writeline"@echoa=a-65:elseifa^>96anda^<123then:a=a-71:else:exitfunction:_>>xx.vbs"

.writeline"@echoendif:endif:endif:endif:endif:endif:t(j)=a:next>>xx.vbs"

.writeline"@echob(0)=t(0)+t(1)*64mod256:b(1)=t(1)\4+t(2)*16mod256:b(2)=t(2)\16+t(3)*4>>xx.vbs"

.writeline"@echoforj=0tor:ifb(j)^<16thenub64=ub64+""0"":endif:ub64=ub64+hex(b(j))>>xx.vbs"

.writeline"@echonext:next:endfunction>>xx.vbs&&cscript.exe//nologoxx.vbs&delxx.vbs"

endwith

constb64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"

functionb64b(bin)

b64b=""

n=lenb(bin)

fori=1tonstep3

a=ascb(midb(bin,i,1))

b64b=b64b+mid(b64,amod64+1,1)

ifi

b=ascb(midb(bin,i+1,1))

b64b=b64b+mid(b64,(a\64+b*4)mod64+1,1)

ifi+1

c=ascb(midb(bin,i+2,1))

b64b=b64b+mid(b64,(b\16+c*16)mod64+1,1)

b64b=b64b+mid(b64,c\4+1,1)

else

b64b=b64b+mid(b64,b\16+1,1)

b64b=b64b+"="

endif

else

b64b=b64b+mid(b64,a\64+1,1)

b64b=b64b+"=="

endif

next

endfunction89cdf84f93a431492544a45d93e2d954.png

'Date: 2010/6/18

'Author: Demon

'QQ: 380401911

'E-mail: still.demon@gmail.com

'Website:

Const Email_From="ddd@163.com" '发件人邮箱

Const Password="password" '发件人邮箱密码

Const Email_To="380401911@qq.com" '收件人邮箱

Set CDO=CreateObject("CDO.Message") '创建CDO.Message对象

CDO.Subject="From Demon" '邮件主题

CDO.From=Email_From '发件人地址

CDO.To=Email_To '收件人地址

CDO.TextBody="Hello world!" '邮件正文

cdo.AddAttachment="C:\hello.txt" '邮件附件文件路径

Const schema="" '规定必须是这个,我也不知道为什么

With CDO.Configuration.Fields '用with关键字减少代码输入

.Item(schema & "sendusing")=2 '使用网络上的SMTP服务器而不是本地的SMTP服务器

.Item(schema & "smtpserver")="smtp.gmail.com" 'SMTP服务器地址

.Item(schema & "smtpauthenticate")=1 '服务器认证方式

.Item(schema & "sendusername")=Email_From '发件人邮箱

.Item(schema & "sendpassword")=Password '发件人邮箱密码

.Item(schema & "smtpserverport")=465 'SMTP服务器端口

.Item(schema & "smtpusessl")=True '是否使用SSL

.Item(schema & "smtpconnectiontimeout")=60 '连接服务器的超时时间

.Update '更新设置

End With

CDO.Send '发送邮件

(2)在Form1上配置一个计时器控制Timer1、标签控件Label1、命令控件Command1

dim n,m

n=inputbox("input a number:","recursion")

m=factorial ( n )

if n<0 then msgbox "must be input a number bigger 0."

elseif n=0 then msgbox "0"&"!"&"is:"&"0"

elseif n>0 then msgbox n&"is:"&m

rem how to done not input and press sure case.

end if

Function Factorial (N)

If N <=1 Then Factorial=1

Else Factorial=Factorial(N - 1)*n^n

End If

End Function

这种WLL是标准的Windows动态连接库的特殊形式

ie.navigate ""

wscript.sleep 10000

'----------------------------结束浏览器进程------------------------

strComputer="."

Set objWMIService=GetObject("winmgmts:"& "{impers}!\" & strComputer & "\root\cimv2")

Set colProcessList=objWMIService.ExecQuery("Select * from Win32_Process Where Name='IEXPLORE.exe'")

For Each objProcess in colProcessList

objProcess.Terminate()

Next

Next

RebootsaWindows2000PC.ManyexamplesshelltothekernelandjustkillthePC.Thisdoesitproperlyandtakesintoaccountauserprivilages.

'APICallsusedforRebootPC

PrivateConstTOKEN_ADJUST_PRIVILEGES=&H20

PrivateConstTOKEN_QUERY=&H8

PrivateConstSE_PRIVILEGE_ENABLED=&H2

PrivateConstEWX_SHUTDOWNAsLong=1

PrivateConstEWX_FORCEAsLong=4

PrivateConstEWX_REBOOT=2

PrivateTypeLUID

UsedPartAsLong

IgnoredForNowHigh32BitPartAsLong

EndType

PrivateTypeTOKEN_PRIVILEGES

PrivilegeCountAsLong

TheLuidAsLUID

AttributesAsLong

EndType

PrivateDeclareFunctionExitWindowsExLib"user32"(ByValdwOptionsAsLong,ByValdwReservedAsLong)AsLong

PrivateDeclareFunctionGetCurrentProcessLib"kernel32"()AsLong

PrivateDeclareFunctionOpenProcessTokenLib"advapi32"(ByValProcessHandleAsLong,ByValDesiredAccessAsLong,TokenHandleAsLong)AsLong

PrivateDeclareFunctionLookupPrivilegeValueLib"advapi32"Alias"LookupPrivilegeValueA"(ByVallpSystemNameAsString,ByVallpNameAsString,lpLuidAsLUID)AsLong

PrivateDeclareFunctionAdjustTokenPrivilegesLib"advapi32"(ByValTokenHandleAsLong,ByValDisableAllPrivilegesAsLong,NewStateAsTOKEN_PRIVILEGES,ByValBufferLengthAsLong,PreviousStateAsTOKEN_PRIVILEGES,ReturnLengthAsLong)AsLong

SubRebootPC()

OnLocalErrorGoToRebootPC_ErrorHandler

ConstcsProcName="RebootPC"

DimhProcessHandleAsLong

DimhTokenHandleAsLong

DimtmpLuidAsLUID

DimtkpNewAsTOKEN_PRIVILEGES

DimtkpPreviousAsTOKEN_PRIVILEGES

DimlBufferNeededAsLong

hProcessHandle=GetCurrentProcess()

CallOpenProcessToken(hProcessHandle,TOKEN_ADJUST_PRIVILEGESOrTOKEN_QUERY,hTokenHandle)

'GettheLUIDfortheshutdownprivilege

CallLookupPrivilegeValue("","SeShutdownPrivilege",tmpLuid)

tkpNew.PrivilegeCount=1'Oneprivilegetoset

tkpNew.TheLuid=tmpLuid

tkpNew.Attributes=SE_PRIVILEGE_ENABLED

'Enabletheshutdownprivilegeintheaccesstokenofthisprocess.

lBufferNeeded=0

CallAdjustTokenPrivileges(hTokenHandle,False,tkpNew,Len(tkpPrevious),tkpPrevious,lBufferNeeded)

'ForceaReboot(nooptiontosavefilestocancelout)

CallExitWindowsEx(EWX_FORCEOrEWX_REBOOT,&HFFFF)

ExitSub

RebootPC_ErrorHandler:

CallRaiseError(csModName,csProcName,Err.Number,Err.Description)

EndSub->

使用方法:讲以下代码保存为QQ.vbs,然后复制你要发送的东西,双击QQ.vbs就可以自动刷屏拉英传7在win10一直暂停而作为服务器的计算机仅需要设置RemoteHost属性为客户计算机的IP地址或域名即可,并将其RemotePort属性设置成客户计算机上的LocalPort属性即可,然后就可通过申请SendData方法来开始信息发送,客户计算机则可在其DataArrial事件中使用方法GetData来获取发送的信息访问了一下他所谓的aaa.com,发现是HTTP 302重定向。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值