- 15
- 0
- 约1.13万字
- 约 15页
- 2016-11-28 发布于河南
- 举报
WScript 对象
WScript 对象
该对象的属性可以提供正在运行的脚本宿主 (WScript.exe 或 cscript.exe) 的路径、参数以及工作模式(交互式或批处理)。WScript 对象还提供了创建和读取对象的方法。
示例
下例演示了如何在两个使用不同脚本语言(VBScript and JScript)的任务中使用同一个 .wsf 文件。这两个任务的功能相同——创建一个快捷方式,指向当前执行的脚本;一个 URL 快捷方式,指向 。
package
job id=vbs
script language=VBScript
set WshShell = WScript.CreateObject(WScript.Shell)
strDesktop = WshShell.SpecialFolders(Desktop)
set oShellLink = WshShell.CreateShortcut(strDesktop \Shortcut Script.lnk)
oShellLink.TargetPath = WScript.ScriptFullName
oShellLink.WindowStyle = 1
oShellLink.Hotkey = CTRL+SHIFT+F
oShellLink.IconLocation = notepad
原创力文档

文档评论(0)