PDA

View Full Version : [DOS] Batch file help needed



Trancentral
12-11-01, 06:42 AM
hiya

well I made this so far :

@echo off
path a:\

:begin
cls
cls
echo.
echo.
echo.
echo.
echo ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝH00fdMenuΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
echo Ί Ί
echo Ί N# Keuze : Ί
echo Ί Ί
echo Ί 1 Word Perfect 5.1 Ί
echo Ί Ί
echo Ί 2 Dbase Ί
echo Ί Ί
echo Ί 3 Lotus123 Ί
echo Ί Ί
echo Ί 4 Help Ί
echo Ί Ί
echo Ί 5 programma sluiten. Ί
echo Ί Ί
echo ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝH00fdMenuΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ
echo.
echo.
echo.
echo.
choice Maak nu uw keuze : /c:1234
if errorlevel 4 goto end
if errorlevel 3 goto Gerard
if errorlevel 2 goto Cees
if errorlevel 1 goto Annelies

and I was asking my self :

Is it possible that you can see the time when running the batch?

Tryn
12-11-01, 08:58 AM
Not sure if this will work for you but try

ECHO.|TIME


Hope this helps

Tryn

IHateExcite
01-02-02, 02:40 AM
"time" does get the system time, but then it prompts you to change it. Of course you can just hit enter to not change it, but is there a way to simulate the user hitting enter in a batch file?

I'm a big fan of the debug script type batch file, so I wrote one that assembled a com file that did nothing but output a carriage return (I'm guessing that's what's needed, and not a line feed...). Of course I wasn't thinking though cause batch files execute commands sequentially, and dos waits till the time command is completed (after enter has been hit) before continuing on to my cr.com. That's a bit silly of me eh?

But anyways, is there a way to simulate typing <enter> through a batch file?

-------------This next question is unrelated------------

Also, is there a way to make a batch file automatically close under win9x like it does in winnt? Granted "pause" and closing the window is quicker than having to hit <enter> and closing the window, but automation is the key here right?

Norm
01-04-02, 07:36 PM
Originally posted by IHateExcite
Also, is there a way to make a batch file automatically close under win9x like it does in winnt? Granted "pause" and closing the window is quicker than having to hit <enter> and closing the window, but automation is the key here right? [/B]To close the batch window put these lines at the end of the batch file:

cls
@exit

When the screen is cleared before an exit command, Dos sees no reason to keep it opened.

When using the 'time' command, there is no way to force an [enter] (that I know of) Since the 'time' program is still running (waiting for the user to input a new time), it has to finish before another command can be executed in the batch file, so nope.

IHateExcite
01-07-02, 07:42 PM
Ya know, I didn't think there was a work around for the "time" issue (short of writing your own time function or patching command.com or something).

But thanks a bunch for the cls idea. That's great!