Computing.Net > Forums > Disk Operating System > Background-Batch

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Background-Batch

Reply to Message Icon

Name: Jens
Date: August 19, 2002 at 02:48:50 Pacific
Comment:

Hi there,

is it possible to start a batch-program, that
always writes something into a logfile and runs in background, while another application
is running ?
I have to add this job, because an applications crashes sometimes, when there is for 15 minutes nothing to be done. So I want, that a batchjob writes always something in a file to let the harddisk something to do.

Is it possible ?
Or what else can I do ?

Greetinxx
JENS



Sponsored Link
Ads by Google

Response Number 1
Name: as-mohammady
Date: August 19, 2002 at 10:31:46 Pacific
Reply:

hello-thank you for kindness


0

Response Number 2
Name: Secret_Doom
Date: August 19, 2002 at 10:44:17 Pacific
Reply:

That's only possible under Windows, since multitasking isn't possible under DOS.

Here's a sample a batch file which would write a little bit to the hard disk every 60 seconds:

@echo off
echo Type X to exit.
:loop
CHOICE /c-X /n /t-,60 > nul
if errorlevel=2 goto end
dir |REM
goto loop
:end

The amount which is written is very small. You could change that, mayky on the line with the pipe (|). For instance, change that line by "dir/s \ |REM".

That batch will fail under NT system. If you want the batch to make a continuos task, try this second one:

@echo off
echo To exit, hit CTRL+BREAK repeatedly.
:loop
dir/s \|REM
goto loop

About running it on batckground, right-click on the file and select "properties". From there, you'll be able to make it run minimized.

-- Leonardo Pignataro - Secret_Doom --

secret_doom@hotmail.com
www.batch.hpg.com.br


0

Response Number 3
Name: Secret_Doom
Date: August 19, 2002 at 12:51:05 Pacific
Reply:

Ooops, Jens said "15 minutes". So, this script should do it:

@echo off
echo Type X to exit.
set T=
:loop
CHOICE /c-X /n /t-,60 > nul
if errorlevel=2 goto end
set T=.%T%
if not "%T%"=="..............." goto loop
dir/s \ |REM
set T=
goto loop
:end
set T=

That won't work under NT systems.

-- Leonardo Pignataro - Secret_Doom --

secret_doom@hotmail.com
www.batch.hpg.com.br


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Background-Batch

Stop F6 key from stopping batch file? www.computing.net/answers/dos/stop-f6-key-from-stopping-batch-file/7909.html

dos color in batch file? www.computing.net/answers/dos/dos-color-in-batch-file/9720.html

Telnet through batch program. Urgent!!! www.computing.net/answers/dos/telnet-through-batch-program-urgent/10218.html