objws.Run "c:\xxx.exe"
谁帮我改下上面的代码,把C盘改成获取系统临时目录的路径或者获取系统安装目录的路径。
------解决方案--------------------------------------------------------
以下Script演示了获取系统临时目录及用户临时目录路径的方法:
- VBScript code
Set WshShell = WScript.CreateObject("WScript.Shell")Set WshEnv = WshShell.Environment("SYSTEM")WScript.Echo "System Temp Directory: " & WshEnv("TEMP")Set WshEnv = WshShell.Environment("USER")WScript.Echo "User Temp Directory: " & WshEnv("TEMP")Set WshEnv = NothingSet WshShell = Nothing