如何通过Visual Basic .NET编译批处理文件(* .bat)? [英] How do I compile batch files (*.bat) via Visual Basic .NET?

查看:99
本文介绍了如何通过Visual Basic .NET编译批处理文件(* .bat)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

如何将批处理文件(* .bat)编译成带有vb.net的exe文件。

如果可能,我还想要一个图标设置功能和密码保护。

我在Google上搜索过;它只是想出了编译视觉基础项目。



问候,

iProgramIt

解决方案

您必须编写自己的解析器,编译器和函数库来生成.EXE。



.NET Framework没有任何内置功能可以为您完成此任务。



好运气!


通常情况下,你不能,但纯逻辑解决方案会将其编译成代码,主要是对 System.Diagnostic.Process的调用序列。开始。可以内联对其他批处理文件的调用,以进行阻塞调用。当然,它需要计算这些调用的参数,并模仿指令流,包括批处理文件调用(是的,有调用,与Window NT一起引入)和标签。



这有什么实际意义吗?我不这么认为。这将是一项相当重要的工作,没有任何有用的结果。即使发明一种全新的脚本语言,不那么古老,并且实现它,也会更有用。但也不建议这样做。



-SA




这篇文章真的可以帮到你。



Bat文件编译器 [ ^ ]

Hi guys,
How would I compile Batch Files (*.bat) into an exe with vb.net.
If possible, I would also like an icon setting function, and password protect.
I searched on Google; it only came up with compiling visual basic projects.

Regards,
iProgramIt

解决方案

You'd have to write your own parser, compiler and function library to generate the .EXE.

The .NET Framework does not have any built in facility to do this for you.

Good luck!


Generally, you cannot, but a pure logical solution would be compiling it into code which is mainly a sequence of the calls to System.Diagnostic.Process.Start. Calls to other batch files could be inlined, to have a blocking call. Of course, it needs to calculate the parameters of those calls, and imitate the instruction flow, including batch-file "call" (yes, there are calls, introduced with Window NT) and labels.

Does it makes any practical sense? I don't think so. It would be quite a work, without any useful outcome. Even inventing a brand-new scripting language, less archaic, and implementing it, would be a lot more useful. But would not advise going in for that, too.

—SA


Hi,
This post will really helps you.

Bat file compiler[^]


这篇关于如何通过Visual Basic .NET编译批处理文件(* .bat)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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