Jump to content

How to "wrap" a .BAT file or .VBS file in an .EXE


Recommended Posts


krick:

Thanks a lot for the tip.

No, I didn't know about the "XP pin shortcut to Start menu" tip.

I do know about iexpress.exe and its potential, though.

I create install packages for 9x/ME/NT4 using Iexpress all the time.

More info:

http://www.mdgx.com/add.htm#DEV

The trick is actually to use a custom SED configuration file which will do everything for you.

Then you can run iexpress followed by the SED file name to automatically [unattended] create the EXE installer you wish.

And these installers can contain +/- run anything you want, like BAT, VBS, COM, EXE, INF, HTA, LNK, REG, PIF, URL files etc...

Please note that the title of that blog article is misleading, because iexpress does not convert anything into anything else, only creates an EXE installer from a list of files, which in turn can run another executable of any type supported by the OS [see examples above].

And the issue described here [guide about how to use iexpress to create exe installers]:

http://renegadetech.blogspot.com/2006/07/h...r-vbs-file.html

is completely different from the issue described here [which is the actual XP pin shortcut to Start menu tip]:

http://www.microsoft.com/technet/scriptcen...04/hey1111.mspx

Thanks again.

Link to comment
Share on other sites

Please note that the title of that blog article is misleading, because iexpress does not convert anything into anything else, only creates an EXE installer from a list of files, which in turn can run another executable of any type supported by the OS.

Oh, I realize that. I just thought it was slick to use an exe installer to not actually install anything and just "wrap" a batch file. I would have never thought of that in a million years.

Once you've wrapped your batch file in the exe, another cool thing you could do is use a resource hacker to change the default "installer" icon to something more presentable.

This is probably more useful than you realize. I've seen more than one program that will only call external programs that end with "exe". Case in point, two years ago, I was trying to get some software here at work to launch a java JAR file. Not only did the program refuse to accept the JAR extension, it also converted the whole command line to upper case so I was unable to call java.exe -jar foo.jar since java is case sensitive and only recognizes "-jar" not "-JAR". The wrapper trick would have solved this problem.

Link to comment
Share on other sites

Oh, I do that all the time with some of my friends' PCs, who are not quite what you would call computer savvy.

I fix/update some of their registry keys/values and sometimes even delete temp/cache files by running INF files "wrapped" inside EXEs created with iexpress.

FYI:

I don't know if you know...

among other things, you can create shortcuts to files of folders using INF files.

HTH

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...