Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wrap A DOS application in a gui/exe???

Status
Not open for further replies.

cbsarge

IS-IT--Management
Jun 20, 2001
219
US
Is it possible or terribly difficult to put a nice wrapper on a dos type application?

For example, there is a utility called Contig (contig.exe) that will let you defrag a single file. Normally you run it fro ma command prompt. It would be nice to be able to wrap it in a gui that prompts for the file to be defragged, where it is by brownsing, etc.

I only have the Express Edition of Visual C++ and a very limited programming skill set.

Thanks for any help, hints or comments.
 
I might consider a different language for that, like VB or C#. From what I hear, those are much easier when trying to make GUIs. Since the bulk of your application will be the GUIs, and the underlying console app will do the work, you don't really need any extra power you might get from C++.

As far as wrapping it goes, how well you can do it depends on how nice the command line interface is. If a lot of options are available through the command line or config files or whatever, then it should not be too hard to add GUI on top of it.
 
Use a .hta wrapper. Try the Javascript or VBScript forum if you want more info. Put the following in a .hta file. When you type the name into the text box, and click go, it will launch it in notepad.
Code:
<HTML>
<HEAD>
<TITLE>Wrapper</TITLE>
<SCRIPT language="javascript">
function goBtn_onClick ()
{
   var dos = new ActiveXObject ("WScript.Shell");
   dos.run ("notepad.exe " + fnTxt.value);
}
</SCRIPT>
</HEAD>
<BODY>

<P>Filename: <INPUT size=40 name="fnTxt"></P>
<INPUT type="button" value="Go" name="goBtn" onclick="goBtn_onClick();">
</BODY>
</HTML>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top