开发者

How to create a windows executable which starts a command?

I would like to have a windows executable (.exe-file) which starts a given command. The command to execute would be stored in an .ini-file (or something similar) in the same directory as the executable.

It needs 开发者_如何学编程to work on XP, Vista and Win7.

What is the easiest way to get such an executable with open source tools?


Make a batch file (.bat) and use a Batch to Exe converter to convert it to an .exe file.

The batch file contains the following commands:

@echo off
set /p var= <MyCommand.txt
%var%
exit

And MyCommand.txt contains your command, for example:

"notepad.exe"

The batch file reads the command from the text file and runs it. And if you don't want a .bat then convert it to .exe. That's it.


There's a tool called IExpress that converts batch files or vb scripts to exe files. I haven't tried it, but it seems to be what you want.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜