我可以让我的VBScript创建一个批处理文件。 [英] Can I make my VBScript create a batch file.

查看:77
本文介绍了我可以让我的VBScript创建一个批处理文件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿大家

我目前正在处理需要.bat文件的人员项目。我遇到的问题是我的脚本将打开.bat文件,但它必须在同一个目录中。我正在尝试使用它来宣传我的组,所以这个vbs脚本将被下载
但是,我无法预测将运行该.bat的strcommand因为,我不知道有谁下载了该文件的目录。

I am currently working on a person project that requires a .bat file. The problem I'm running into is my script will open the .bat file but, it has to be in the same dir. I am trying to use this to advertise my group so this vbs script will be downloaded but, I can't predict the strcommand that will run that .bat because, I will not know there dir of who downloaded the file.

这就是我在剧本上的内容:

This is what I have on my script:

x = msgbox(" test",36," test")
如果x = vbNo则为
x = msgbox("test",36,"test")

如果x = vbNo则

x = msgbox(" test。",64," test")

结束如果

结束如果

x = msgbox(" test。",64," test")

Dim WshShell,oExec zh
设置WshShell = CreateObject(" WScript.Shell")



设置oExec = WshShell.Run(" Test.bat")



执行oExec.Status = 0

      WScript.Sleep 100

循环



WScript.Echo oExec.Status

x=msgbox("test",36,"test")
If x=vbNo Then
x=msgbox("test",36,"test")
If x=vbNo then
x=msgbox("test.",64,"test")
End if
End if
x=msgbox("test.",64,"test")
Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")

Set oExec = WshShell.Run("Test.bat")

Do While oExec.Status = 0
     WScript.Sleep 100
Loop

WScript.Echo oExec.Status

我知道我收到错误代码但暂时没问题。是否有可能让我的VBScript创建文件并为我编码?鉴于我确实在vbscript中编写代码。

I know that i receive a error code but that is fine for the time being. Is it possible to have my VBScript create files and code them for me? Given that i do write the code in the vbscript.

推荐答案


是否可以创建我的VBScript文件和代码给我?..

Is it possible to have my VBScript create files and code them for me?..




是的,可以让你的VBScript创建批处理文件。当然,您必须确保遵守批处理文件语法规则。


Yes, it is possible to get your VBScript to create batch files. You must, of course, make sure to observe batch file syntax rules.


这篇关于我可以让我的VBScript创建一个批处理文件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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