script1.vbs
来自「在程序中加入脚本支持」· VBS 代码 · 共 41 行
VBS
41 行
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''
'' script1.vbs - Don Box, 1996-1997
''
'' A VBScript program
''
'' handler that will execute when games are played by "shell"
Sub shell_OnPlayGame(s)
shell.writeLn("playing " & s)
End Sub
'' function that starts three instances of notepad and one instance of freecell
Sub Foo()
FOR i = 1 TO 3
shell.exec "notepad.exe"
NEXT
shell.exec "freecell.exe"
End Sub
'' function that writes some text to the console
Sub Bar(x, y)
shell.write(x)
shell.write(", ")
shell.writeLn(y)
shell.writeLn("VBScript Rocks!")
FOR i = 1 TO y
shell.writeLn("I love COM")
NEXT
shell.writeLn("Every app should be scriptable!")
End Sub
'' main entry point that uses the shell object
Sub main()
shell.alert("The X is now silent AND invisible!")
Bar 10, 20
Foo
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?