Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I'm hoping someone can help me with this minor problem. I wrote a tiny batch file in XP that requires user input. However, if I make a shortcut on the desktop all it does is briefly open and close a command prompt window. This is the batch file I made called ascii.bat:
copy e:\cat4\usr\maryann\%1.v1 a:\*.asc
As you can see, it simply asks the user to provide a file name (with the extension .v1) and copies it to a floppy with the extension .asc (yes, it is a text file -- why the program that creates the text file uses the extension .v1 is beyond me).
Can anyone suggest a way for me to create a shortcut that will open the command prompt window looking like this:
c:\ascii
which simply waits for the user to input the file name and press enter?
Thank you.

I think it might work with "batch.bat ?"
From rin1010
"This example merely echoes the replaceable parameter to the screen
and then closes the window, but perhaps it will give you some ideas...
::
@echo off
cls
echo.
if "%1"=="" goto usage
echo You entered: %1
goto end
:usage
echo Must enter a valid parameter...
:end
echo.
pause
cls
exit
::
"

To clarify a bit. The ? should be added to the pif command line params. The pif should also be edited for either close on or not.

Jefro, thank you so much. I'm going to see if I can adapt your suggestion. The only reason I'm doing this is for my wife, who is not very computer literate. She becomes frustrated when confronted with a directory structure, and of course telephones me at work so I can walk her through it. Hopefully your suggestion will work.
I had one other idea, and that was to write a small Visual Basic app to accomplish the task, only that would require me to learn something new!
Thanks again.
Kevin

c:
cd c:\ascii
set /p file=Enter filename:
copy e:\cat4\usr\maryann\%file%.v1 a:\%file%.ascAdd a line
pause
if you want to see the results before the window closes. It's a bit more complicated if you want the window to stay open.

Rambler, your suggestion worked like a charm. Thank you so much.
And thanks again, Jefro, for all your help.
Kevin

![]() |
accessing doc. from anoth...
|
Damn Boot Problems
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |