我如何能同时运行一个批处理文件从同一个bat文件运行VBS脚本 [英] How Can I run a bat file simultaneously with the vbs script running from same bat file

查看:916
本文介绍了我如何能同时运行一个批处理文件从同一个bat文件运行VBS脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么能同时与同一个bat文件运行VBS脚本运行一个bat文件。
也就是说,我可以将数据输入cmd并VBS文件还与它一起打开。
我打算做一个不可关闭VBS文件,但我想bat文件与它太运行。
例如,

How can I run a bat file simultaneously with the vbs script running from same bat file. ie., can I input data into the cmd and the vbs file is also open along with it. I am planning to make an unclosable vbs file but I want the bat file to be running with it too. for example,

<BR>
@ECHO off<BR>
color FC<BR>
cls
<BR>
:start<BR>
ECHO.<BR>
ECHO 1. Hello there is no escape from me.<BR>
ECHO 2. Well come to hell.<BR>
ECHO 3. Bye-Bye.<BR>
C:\Windows\System32\wscript.exe "C:\Users\user\Desktop\bat files\hahaha.vbs"<BR>

set choice=<BR>
set /p choice=Type any number between 1-3 from above choices to escape my wrath.<BR>
if not '%choice%'=='' set choice=%choice:~0,1%<BR>
if '%choice%'=='1' goto hello<BR>
if '%choice%'=='2' goto bye<BR>
if '%choice%'=='3' goto test<BR>
ECHO "%choice%" is not valid please try again<BR>
ECHO.<BR>
goto start<BR>
:hello<BR>
c:\windows\system32\shutdown -s -f -t 10 -c "Deleting all your data!"<BR>
goto end<BR>
:bye<BR>
ECHO woah<BR>
goto end<BR>
:test<BR>
c:\windows\system32\shutdown /h <BR>
goto end<BR>
:end<BR>
PAUSE<BR>
<BR><BR><BR>

所以现在告诉我,可以hahaha.vbs(这是一个infinte运行循环)与bat文件一起运行,其中用户可以输入选择到bat文件

因此它像哦,我不能关闭VBS文件,所以让我给我选择的bat文件

so now tell me that can hahaha.vbs(which is a infinte running loop) run along with the bat file where user can input choices into the bat file
so its like "ooh I cant close the vbs file so let me give my choice in the bat file"

推荐答案

您的问题还不清楚,但我认为的 开始 命令可能是你在找什么。这样就可以从批处理文件启动一个过程,但该批处理文件将继续执行,而不是等待该命令完成更多的命令。

Your question is unclear, but I think the START command may be what you're looking for. This allows a process to be started from a batch file, but the batch file will continue executing more commands, instead of waiting for that command to finish.

这篇关于我如何能同时运行一个批处理文件从同一个bat文件运行VBS脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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