Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
ok, so I was talking to Kerm before about this, and he told me to post so he would be reminded, but I guess anybody else can give me help too then
what I want is a batch file that will read from a text file the programs and such and build a menu from that
it would then launch the program after you choose to launch it
all the programs are stored two directory's down ( Program_files/whatever the name of the folder is/ )
so yeah
Grammar and punctuation. You need it.
posting relevant material. You need it.
Eeems wrote:
posting relevant material. You need it.


I can't post relevant material if I don't know what the f*#k you are asking for, now can I?
then you can ask for clarification...
Eeems wrote:
then you can ask for clarification...


I did.
no you didn't...
Quote:
Grammar and punctuation. You need it.

I don't see any questions here
Trying to get back on topic... I don't know batch file syntax so I can't help there but I know it would be very easy in just about any programming language, in C build and array of names using scanf("%s", variable) or &variable if it is not a character array or other type that automatically transfers as a pointer then printf each line prefixed by a line number, then scanf("%d", &int) to get the number, then system(your command here to launch) to append strings you could sprintf to a character array. I might write this one out later if it still has not been done and I have time but I would need to know the maximum length of the text file lines, the prefix for the line for the command and the max number of lines in the file or I could #define them so they can be edited easily which is probably best anyway.
hmm, that sounds interesting...I don't actually know the maximum length of the lines. I think that the amount of lines should remain flexible due to the fact that the amount of programs could fluctuate. What exactly do you mean the prefix?
Eeems wrote:
hmm, that sounds interesting...I don't actually know the maximum length of the lines. I think that the amount of lines should remain flexible due to the fact that the amount of programs could fluctuate. What exactly do you mean the prefix?


I didn't mean the exact number of lines, I meant a maximum number, the number of slots to allocate in the array which could be changed by changing the number in the program and then recompiling if change is needed. The prefix is what to put before the line in the file to call it for instance if I needed to call a program with "/usr/bin/php" and "php" was the line then "/usr/bin/" would be the prefix. That could also be put in a #define if that might change or it could be put as the top line of the file for even easier changing.
hmm, I guess that would work...
the programs will be stored under different folders, but they will be one down under Program_files, then whatever the next folder is...
so I guess the prefix would be different for each of them...
but I guess we could somehow include that, like every odd line would be the path, and every even line would be the program name
Yup, every other line could work, I won't have time to do it tonight but I might get a chance tomorrow, I have been busy lately but I might have time.
Windows supports VBScript and JScript natively, which is a decent half-way-house between a "real" programming language and the pains of batch scripts.
thanks Glenn
@benryves: well I guess...I just got started with batch files because I wondered if it would be possible to use them...
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement