你可以在 Visual Studio 中调试 VBScript 吗? [英] Can you debug VBScript in Visual Studio?

查看:122
本文介绍了你可以在 Visual Studio 中调试 VBScript 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道 Visual Studio 是否可以运行和调试 VBScript 文件?

I was wondering if Visual Studio can run and debug VBScript files?

感谢您的宝贵时间.

推荐答案

首先,VBScript 是一种解释型语言,不需要编译.

First of all VBScript is an interpreted language and does not need to be compiled.

但是是的,您可以在 Visual Studio 中调试您的 VBScript 文件.在工具/外部工具"下,您必须使用一些启动参数注册一次 Windows 脚本宿主(CScript.exe 或 WScript.exe)(以使其在工具"菜单中可用):>

But yes, you can debug your VBScript file inside Visual Studio. Under "Tools / External Tools" you have to register the Windows Script Host (CScript.exe or WScript.exe) once with some startup parameters (to make it available in the Tools menu):

Title:             VBScript Debug
Command:           C:WindowsSystem32cscript.exe
Arguments:         //nologo //X $(ItemPath)
Initial directory: $(ItemDir)
Check "Use Output window"
Hit the OK button

然后,直接用Visual Studio打开你要调试的文件(通过File --> Open --> File...)

Then, just open the file you want to debug with Visual Studio (via File --> Open --> File...)

要启动调试器,只需单击工具/VBScript 调试".

In order to start the debugger, just click "Tools / VBScript Debug".

VS JIT 调试器会询问您要使用的调试器.只需选择您的 *.vbs 文件,然后单击是".

The VS JIT debugger asks you, wich debugger you want to use. Just select your *.vbs file and click Yes.

注意:此答案仍然有效并且适用于 Visual Studio 2019.

Note: This answer is still valid and works with Visual Studio 2019.

这篇关于你可以在 Visual Studio 中调试 VBScript 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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