从VBScript执行cmd命令 [英] Execute cmd command from VBScript

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

问题描述

如何从VBScript中执行 cmd 命令(不是通过.bat文件执行)

How I can Execute a cmd command from VBScript (not by .bat file)

例如,我想从VBScript中执行以下操作:

For example, I want to execute the following from VBScript:

cd /d C:dir_test\file_test 
sanity_check_env.bat arg1

推荐答案

Set oShell = WScript.CreateObject("WSCript.shell")
oShell.run "cmd cd /d C:dir_test\file_test & sanity_check_env.bat arg1"

这篇关于从VBScript执行cmd命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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