I need a small DOS application, 50K or less and the smaller the better, that prompts for keyboard input. Any names come to mind?
I need a small DOS application, 50K or less and the smaller the better, that prompts for keyboard input. Any names come to mind?
Last edited by jmsrickland; May 11th, 2012 at 11:12 AM.
The better the information you give to begin with and the sooner you reply the sooner you will get help and get your problem resolved
When I was young and in my prime I used to program all the time but now I'm old and getting gray I only program once a day
A simple call to cmd.exe and the black window prompts for keyb input... or what do you mean by "application that prompts for keyboard input. "?
You don't need to add Cmd.exe to your Project or deploy it, since it's already present on all Windows versions, you just need to call it from your app, there is no disk space required for that. Maybe you need something else that you're not telling, maybe you need this to run in a VB Form or something like that?
I think you're in the wrong forum. VB6 programs don't run under DOS.
Any particular reason why it's got to be DOS ? I'd have thought that a simple InputBox with a character to hex conversion loop putting the result into a TextBox would take less than 50K in VB6.
(I just knocked one up and the .exe is 20K)
Code:Option Explicit Private Const ITEMS_PER_LINE As Integer = 8 Private Sub Command1_Click() Dim strData As String Dim strH As String Dim intI As Integer strData = InputBox("Enter Data") If strData <> "" Then For intI = 1 To Len(strData) strH = Hex(Asc(Mid$(strData, intI, 1))) strH = Left$("00", 2 - Len(strH)) & strH & " " txtHex.Text = txtHex.Text & strH If intI Mod ITEMS_PER_LINE = 0 Then txtHex.Text = txtHex.Text & vbNewLine Next intI End If End Sub
Last edited by Doogle; May 11th, 2012 at 01:19 AM. Reason: Put the .Text bits in
The better the information you give to begin with and the sooner you reply the sooner you will get help and get your problem resolved
When I was young and in my prime I used to program all the time but now I'm old and getting gray I only program once a day
No, there is no "DOS" in modern versions of Windows, nor was there in any Windows NT version. However there certainly is a Console Subsystem.
Not "talking wrong" will help you avoid dead-ends. You're looking for a console program.
It is entirely possible to build VB6 programs that run in the Console Subsystem instead of the Windows Subsystem. However it requires a small "tweak" since VB6.exe is hard-coded to build programs only for the latter.
You also need to use an "external" method of doing standard stream I/O because the language doesn't have one built in. API calls work, or you can just use the FSO in many cases.
I've attached a small VB6 project that does this. Be sure to look at the readme.txt for instructions. The resulting EXE is only 10KB here, but I use the LINK.EXE from the Win 6.0 SDK most of the time. The default linker installed with VB6 makes slightly larger EXEs but yours should still be far less than 50KB.
Maybe my question was wrong. I'm looking for any app that is like cmd.exe but much smaller, more like 50K or less. I am not looking for a VB6 app, just a simple DOS or console app if console is what it is now called. I'm not looking to make one either. I'm sure there already is one or more that exists somewhere.
The better the information you give to begin with and the sooner you reply the sooner you will get help and get your problem resolved
When I was young and in my prime I used to program all the time but now I'm old and getting gray I only program once a day
I'd assumed you wanted "any small console program that prompts for keyboard input" and that it related to a VB6 project you have going on there.
Hmm, so it sounds like what you are really asking for is a console command shell. These are also sometimes called command interpreters. Cmd.exe and Command.com (Win9x) are examples of these. You could also use the approach I showed in the example to make just such a program yourself in VB6.
jmstrickland, no need to cop an attitude. You posted your question in the section called "Visual Basic 6" so of course people are trying to interpret your question in relation to VB6. You were not clear in your question and that is your fault, not ours.
There are lots of command line programs that prompt for input, many are small, many are not.
I do not understand why it needs to be smaller than CMD.EXE as that will already be there so it effectively takes 0 bytes, can't get much smaller than that.
Of course you did not even give us a clue as to what you are trying to do beyond get keyboard input so we are all in the dark.
How about a bat file with 1 line in it
Code:cmd.exe
CMD.EXE is about 380K on my computer. I need something more in the 20K to 40K and the smaller the better. I just need a name of an app, that is all I need of an app that takes keyboard input that is small. I do not need the app itself, just the name. I'm sorry but I do not know how to make my question any simpler.
If you know the name of such an app please post it. That is all I am asking for
The better the information you give to begin with and the sooner you reply the sooner you will get help and get your problem resolved
When I was young and in my prime I used to program all the time but now I'm old and getting gray I only program once a day
Hmm, well choice.exe is pretty small.
I'm still a little confused, you seem to have changed the requirement since I last looked.
Is this right:
You want a DOS program, which is already available, that will accept input from a DOS 'window' ? Do you just want it to 'echo' whatever's been typed in or what?
It begs the question; what do you want to do with the data? (There was previously mention of converting the data to Hex and displaying it in a TextBox - is this no longer the case?)
Perhaps if you could explain the problem you're trying to solve it may help us to be a little more useful.
CHOICE.EXE is a perfect example of what I need. Thanks, dilettante. Why I didn't think to go look in one of my old DOS directories I'll never know but there are several apps there that also will do. All of you guys spent too time and effort in asking questions that really had no bearing on anything when all I wanted was a name of a small DOS app with keyboard input. I cannot imagine why it makes such a difference as to why I want it, what I am going to do with it or what I am going to do with the data or anything else. Cannot it just suffice that all I wanted was a name?
The better the information you give to begin with and the sooner you reply the sooner you will get help and get your problem resolved
When I was young and in my prime I used to program all the time but now I'm old and getting gray I only program once a day
Had you posted in a non-programming forum then you would have a point, but as I have already implied, what has this to do with VB6 ? (or programming come to that)
Had you asked the simple question: "Please can you tell me the name of an existing DOS application that accepts keyboard input (and by the way it's got nothing to do with writing a program or VB6)?" then we might not have wasted so much time and frustrated both you and ourselves.
Last edited by Doogle; May 12th, 2012 at 03:43 PM.
Yeah, I think the "existing" (or perhaps really "can be expected to already be present on a random system") part was what I didn't understand.
That's why I gave an example in VB. I assumed any such program would do for some kind of testing.
Then "like cmd.exe" came along... by then I guess I was really off in the weeds.
Doogle, I posted here because I am in this Forum 99.999999% of the time and it just hit me to ask and since I was already here I just opened a thread. I opened the same thread in the Forum you suggested and it was the same thing as it was here. I would have thought that my question was as simple and clear as possible without going into a lot of detail as to why, what, when, and where stuff that really had nothing to do with me just wanting the name of a DOS app that accepted keyboard input. Since I knew that no one was going post a zip of such of an app then I assumed that anyone would just assume that I needed the name only and not the app itself. I am sorry that I didn't foresee such as it turned out because I simply thought it wouldn't matter which Forum I posted in and to me the question was very straight forward.
I need a small DOS application, 50K or less and the smaller the better, that prompts for keyboard input. Any names come to mind?
The last sentence. Doesn't that say I want the name only? Does it really matter what I wanted it for or what I am doing or whether it's part of a VB project or not and even if it was part of a VB project would not have told you anything you needed to know to simply give me a name of a DOS app? Yes, I could have written a lot of stuff explaining everything but I always try to be as plain and simple as possible. I guess I have a lot to learn about asking questions around here.
P.S. Now that I got the name I needed do you still want to know what I am going to do with it?
Last edited by jmsrickland; May 12th, 2012 at 04:23 PM.
The better the information you give to begin with and the sooner you reply the sooner you will get help and get your problem resolved
When I was young and in my prime I used to program all the time but now I'm old and getting gray I only program once a day