以文本方式查看主题 - 计算机科学论坛 (http://bbs.xml.org.cn/index.asp) -- 『 C/C++编程思想 』 (http://bbs.xml.org.cn/list.asp?boardid=61) ---- Wscript.Shell 对象详细介绍!! (http://bbs.xml.org.cn/dispbbs.asp?boardid=61&rootid=&id=64745) |
-- 作者:卷积内核 -- 发布时间:7/19/2008 8:26:00 AM -- Wscript.Shell 对象详细介绍!! WshShell 对象 ProgID Wscript.Shell 文件名 WSHom.Ocx CLSID F935DC22-1CF0-11d0-ADB9-00C04FD58A0B IID F935DC21-1CF0-11d0-ADB9-00C04FD58A0B 属性 说明 方法 说明 语法 注释 对于 Windows 95,strType 参数仅支持 "Process"。 下列变量是由 Windows 操作系统提供的。脚本也可获取由其他应用程序设置的环境变量。 名称 说明 Set WshSysEnv = WshShell.Environment("SYSTEM") 请参阅 ProgID N/A 属性 说明 |
-- 作者:卷积内核 -- 发布时间:7/19/2008 8:28:00 AM -- 下表描述与 WshEnvironment 对象关联的方法。 方法 说明 语法 示例 WshSpecialFolders 对象 ProgID N/A 属性 描述 WshSpecialFolders.Item 语法 注释 Windows 95 和 Windows NT 4.0 操作系统提供下列指定文件夹: AllUsersPrograms AllUsersStartup Desktop Favorites Fonts MyDocuments NetHood PrintHood Programs Recent SendTo StartMenu Startup Templates |
-- 作者:卷积内核 -- 发布时间:7/19/2008 8:28:00 AM -- 示例 ' This fragment returns the full path for the Windows Desktop folder Set WshShell = Wscript.CreateObject("Wscript.Shell") StrMyDesktop = WshShell.SpecialFolders("Desktop") ' List all special folders 请参阅 语法 示例 请参阅 WshShortcut 对象 ProgID N/A 属性 说明 方法 说明 WshShortcut.Arguments 语法 WshShortcut.Description |
-- 作者:卷积内核 -- 发布时间:7/19/2008 8:29:00 AM -- 语法 WshShortcut.Description = strDescription WshShortcut.Hotkey 语法 注释 Hotkey ::= modifier* keyname 所有键的名称都可以在 WINUSER.H 中找到。热键不区分大小写。 热键只能激活位于 Windows 桌面或 Windows“开始”菜单的快捷方式。 Windows 资源管理器不接受 ESC、ENTER、TAB、SPACE、PRINT SCREEN 或 BACKSPACE,即使 WshShortcut.Hotkey 遵循 Win32 API 支持它们。因此,建议在快捷方式中不要用这些键。 示例 请参阅 WshShortcut.IconLocation 语法 WshShortcut.TargetPath |
-- 作者:卷积内核 -- 发布时间:7/19/2008 8:29:00 AM -- 语法 WshShortcut.TargetPath = strTargetPath WshShortcut.WindowStyle 语法 WshShortcut.WorkingDirectory 语法 WshShortcut.Save 语法 WshUrlShortcut 对象 ProgID N/A 属性 说明 方法 说明 WshUrlShortcut.FullName 语法 WshUrlShortcut.TargetPath 语法 WshUrlShortcut.Save 语法 WshShell.ExpandEnvironmentStrings 环境变量不区分大小写。 语法 示例
WshShell.Popup 语法 注释 |
-- 作者:卷积内核 -- 发布时间:7/19/2008 8:30:00 AM -- natType 的含义与其在 Win32? MessageBox 函数中相同。下表显示 natType 中的值及含义。下表中的值可以组合。 按钮类型 返回值 intButton 指示用户所单击的按扭编号。若用户在 natSecondsToWait 秒之前不单击按扭,则 intButton 设置为 -1 。 值 说明 请参阅 Wscript.Echo 参数用空格分隔。在 Cscript.exe 中,该方法在显示最后一个参数之后输出一对回车/换行(CR LF)。 语法 示例 WshShell.RegDelete 语法 参数 短根键名 长根键名 WshShell.RegDelete "HKCU\ScriptEngine\Value" ' Delete value "Value" 请参阅 语法 参数 Short Long 示例 WshShell.RegRead("HKCU\ScriptEngine\Val") ' Read from value "Val" 请参阅 语法 参数 Short Long
anyValue strType WshShell.RegWrite "HKCU\ScriptEngine\Value", "Some string value" 请参阅 语法 参数 intWindowStyle
blnWaitOnReturn 示例 ' This fragment returns the error code from the executed application |
W 3 C h i n a ( since 2003 ) 旗 下 站 点 苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》 |
125.000ms |