Making a Menu

Intel / -
February 10, 2009 at 20:46:57
Specs: Windows XP, -
Ok, I have a Batch file that requires a password and once the password is enturned correctly a menu pops up(batch menu). One of the menu options that i made needs the user to type in an address of the program you wanted to run. now the problem...... I want to know how you can get the batch file to read the address the user has typed and open it. now i know that this may see stupied but its a personal project. any help will be worshipped... :)If you want the code for the menu just let me know.

See More: Making a Menu

Report •


#1
February 10, 2009 at 22:51:50
"read the address the user has typed and open it"

Do you mean change to that directory? Or What?


=====================================
If at first you don't succeed, you're about average.

M2


Report •

#2
February 11, 2009 at 15:26:01
I worked it it out with trial and error...

its this code:

@ECHO OFF
setlocal
set fn=%~f1
if not exist "%fn%" set /p fn=Plese type in a file name, you may also need to enter the full path if the file isn't in the same directory (this includes the extenion):
Tree %fn%
pause

Thanks for before M2

Oh one thing, How do you get the batch file to save what is on the screen (batch sreen) onto a txt file?


Report •

#3
February 11, 2009 at 20:07:40
I don't know how to get a bat to capture the screen.


=====================================
If at first you don't succeed, you're about average.

M2


Report •

Related Solutions

#4
February 12, 2009 at 12:56:43
Try adding this to the end of your script... I think this is what you meant. You weren't very clear.

echo %fn% >> logfile.txt
start logfile.txt


Report •

#5
February 12, 2009 at 15:13:24
Sorry,

No that just creats a txt file and in it only has echo is on/off.


For Example
What i want is to type Save and then this saves any data the batch file has displayed above the Save command in a txt file(saved in a txt file).


Report •

#6
February 13, 2009 at 00:51:43
The only way I know of to do this is to extract and convert the command line buffer from memory. This is quite a task and to my knowledge beyond the realms of batch scripting. The buffer contains a lot of other information and is in a Unicode style i.e. for roman characters every second byte will be 00. Another problem is that when the buffer is full you may loose some information from earlier in the session, increasingly more as the session progresses.

To get and idea download hxd open up a cmd window type some commands in then open hxd and click on the chip to open memory and choose cmd.exe - have fun!

It would be much easier to echo or redirect the output into the text file as it happens, using a utility with a tee function would make this easier.


Report •


Ask Question