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=FALSE所以应该写成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。