如何以Exe身份运行文件 [英] How to Run a file as Exe

查看:60
本文介绍了如何以Exe身份运行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是你如何以.exe运行文件。

听起来很简单,但事实并非如此。我不是在谈论这个:

My question is how do you run a file as .exe.
It may sound simple but it isn''t. I am not talking about this:

Process.Satrt("anything.exe")



我的问题是:

假设我有一个名为a.txt的文件,当我点击它作为a.exe运行的按钮而不是a.txt

换句话说它是一个临时文件转换器。

任何代码????





OP的附加信息来自非解决方案

见什么我告诉你在WINDOWS EXPLORER中你可以将a.txt重命名为a.exe或a.bat

或a.cmd然后执行它。我想对VB.NET 2010做同样的事情EXPRESS。

我需要它为我的程序RUN AS ANYTHING。

我也试过这个但是我失败了:


My question is :
Suppose I have a file called a.txt and when i click a button it runs as a.exe not a.txt
In other words it is a Temporary File Converter.
Any Code for that????


OP''s additional information moved from non-solution below
See what i am telling is that in WINDOWS EXPLORER you can rename a.txt to a.exe or a.bat
or a.cmd and then execute it.I want to do the same with VB.NET 2010 EXPRESS.
I need it for my program "RUN AS ANYTHING".
Also i have tried this but i failed :

Button1_Click
Dim O as New OpenfileDialog
o.showdialog
Process.start(Openfiledialog.Filename + "exe")'For running the program or a file in exe format

推荐答案

那里没有内置的方法来做到这一点,我看不出你想要的任何(非恶意)理由。
There is no built in way to do that, and I can''t see any (non-malicious) reason why you would want to.


这篇关于如何以Exe身份运行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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