linux接受参数脚本,linux脚本获取输入参数bash如何执行source

2:右手往左用滑鼠点一下倒数第二个控制项,左手按F4,左手按0

SetobjSession=CreateObject("Microsoft.Update.Session")

SetobjSearcher=objSession.CreateUpdateSearcher

SetobjResults=objSearcher.Search("Type='Software'")

SetcolUpdates=objResults.Updates

Fori=0tocolUpdates.Count-1

'IfcolUpdates.Item(i).Title=_

'"SecurityUpdateforWindowsXP(KB899587)"Then

'IfcolUpdates.Item(i).IsInstalled<>0Then

'Wscript.Echo"Thisupdateisinstalled."

'Wscript.Quit

'Else

'Wscript.Echo"Thisupdateisnotinstalled."

'Wscript.Quit

'EndIf

'EndIf

wscript.echocolUpdates.Item(i).Title

Next

'Wscript.Echo"Thisupdateisnotinstalled."

如何关闭WindowsXPServicePack2防火墙?

SetobjFirewall=CreateObject("HNetCfg.FwMgr")SetobjPolicy=objFirewall.LocalPolicy.CurrentProfile

objPolicy.FirewallEnabled=FALSESetobjFirewall=CreateObject("HNetCfg.FwMgr")SetobjPolicy=objFirewall.LocalPolicy.CurrentProfile

objPolicy.FirewallEnabled=FALSEe12b8d9d596a262b1857d83238913093.png所以应该写成WshShell.AppActivate("(D:)"),考虑到内存节约的问题,应该这样写:

setWshShell=WScript.CreateObject("WScript.Shell")

do

IFWshShell.AppActivate("(D:)")Then

MsgBox"ok"

wscript.quit

EndIf

loop

这种方法有个缺点,就是运行环境中必须装有MSAccess

Zip "D:\test.iso", "D:\test.zip"

Zip "D:\test", "D:\test.zip"

Msgbox "OK"

Sub Zip(ByVal mySourceDir, ByVal myZipFile)

Set fso=CreateObject("Scripting.FileSystemObject")

If fso.GetExtensionName(myZipFile) <> "zip" Then

Exit Sub

ElseIf fso.FolderExists(mySourceDir) Then

FType="Folder"

ElseIf fso.FileExists(mySourceDir) Then

FType="File"

FileName=fso.GetFileName(mySourceDir)

FolderPath=Left(mySourceDir, Len(mySourceDir) - Len(FileName))

Else

Exit Sub

End If

Set f=fso.CreateTextFile(myZipFile, True)

f.Write "PK" & Chr(5) & Chr(6) & String(18, Chr(0))

f.Close

Set objShell=CreateObject("Shell.Application")

Select Case Ftype

Case "Folder"

Set objSource=objShell.NameSpace(mySourceDir)

Set objFolderItem=objSource.Items()

Case "File"

Set objSource=objShell.NameSpace(FolderPath)

Set objFolderItem=objSource.ParseName(FileName)

End Select

Set objTarget=objShell.NameSpace(myZipFile)

intOptions=256

objTarget.CopyHere objFolderItem, intOptions

Do

WScript.Sleep 1000

Loop Until objTarget.Items.Count > 0

End Sub

二、可采用以下几种方式使用API函数,以SetWindowPos函数为例:

(1)忽略函数返回值的调用:

SetWindowPosForm1.hWnd,-2,0,0,0,0,3

注意此时函数的参数是不加括号的

有两个问题值得注意:一:如要进行参数的传递,可以先用VB写临时数据文件,再用Lisp读此临时数据文件

可以说,HTA使我们能够将InternetExplorer和脚本代码结合在一起,并反过来为脚本提供图形用户界面jj捕鱼模式请给窗体缺省创建一个按钮(用于观察效果)

if fso.fileexists(newpath&""&OldFileName1 ) then

set f=fso.getfile(newpath&""&OldFileName1)

f.name=newFileName1

end if。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值