从另一个 vbscript 运行一个 vbscript [英] Run a vbscript from another vbscript

查看:34
本文介绍了从另一个 vbscript 运行一个 vbscript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何让一个 vbscript 运行另一个 vbscript?

How do I get a vbscript to run another vbscript?

我想象它只有几行代码,但之前没有尝试过这样做,两者之间没有任何传递,一个只需要调用/运行另一个.

Id imagine its only a few lines of code but not tried doing this before, nothing is passed between the 2, one just needs to call/run the other.

例如,正在运行的脚本称为 TestScript.vbs,它调用/运行的另一个脚本称为 Secondscript.vbs,两者都位于 C:\Temp.

For examples the script being run is called TestScript.vbs, the other script for it to call/run would be called Secondscript.vbs, both of which are located in C:\Temp.

谢谢标记

推荐答案

看看以下是否有效

Dim objShell
Set objShell = Wscript.CreateObject("WScript.Shell")

objShell.Run "TestScript.vbs" 

' Using Set is mandatory
Set objShell = Nothing

这篇关于从另一个 vbscript 运行一个 vbscript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆