How-To Geek Forums / Tutorials
(Solved) - bat files
(9 posts)- View Accepted Answer
- Remove Solved Status
Here is a .bat file that displays the days of the week...
@echo off
echo "Sunday"
echo "Monday"
echo "Tuesday"
echo "Wednesday"
echo "Thursday"
echo "Friday"
echo "Saturday"
To print the output, you could pipe the output to a printer, e.g., C:\>dow.bat | LPT1:
or you could send the output to a .txt file and then print that, e.g., with Notepad: C:\dow.bat > dow.txt
Hope this helps.
Is it really that simple, you want to see it on your display and print it? If so, just create a TXT file, actually don't even need do that. Open Notepad, type in what you want and then Print... or do the above post?
We must be missing something here?
What do you really want?
Irv S.
@dysert has a good start. Since most printers now days are connected to a USB port not an LPT: port, in order to send the print from DOS you would have to execute a command such as
NET USE LPT1: \\[Computer Name]\[Printer name] /PERSISTENT:YES
The parameters are dependent on how your printer is attached or shared.
Still nt understanding what you are trying to do and why. Sounds like it must be some kind of meaningless class assignment.
Hi-Thx for responding-Im just trying to figure out how things work in batch files and want to use CHOICE 1-7 for the days of the week-i had %monday% instead of quotes "monday"
I tried using
choose= set /m choice="please enter a number from the following:"
IF Not :"%choose%"=="" set
choice=%choice%:1%~7%
Im guessing the syntax is wrong as choice isnt recognized as internal or external command
May help you,
http://www.computerhope.com/batch.htm
Topic Closed
This topic has been closed to new replies. Please create a new topic instead.
