DOS batchfile input question

Hack your OS, customize your GUI, announce great software, and configure, configure, configure...
Post Reply
AndrewB
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
Posts: 2385
Joined: 12/09/01, 12:00 am
Location: USA
Contact:

Post by AndrewB » 12/31/01, 6:31 am

Hey, Im just screwing around with stuff here in DOS since i dont have any *really good* message clients in Linux right now and I've got a question about something:

I'm trying to make a little script here (code follows) that will create a file, ask for user text input, and then update the file using REPLACE. I"ve got it working automatically with the code below, but how would i prompt a user for input and then write that text to disk where it replaces the old version of the file of the same name?

Thanks. Here's the code:

echo off
cls
title Welcome 2 Winblows 2k!

echo Starting application...
echo.
echo Press a key to continue...
pause>null

echo.
echo #######################################
echo.
echo Doing file stuff...
echo filejunk and stuff like that! whoo! (round1) filejunk.junk
mkdir tempdir
cd tempdir
echo filejunk and stuff like that! whooo! (round2) filejunk.junk

cd ..
replace tempdirfilejunk.junk .

AndrewB
BIG GIANT HEAD I Get Free Beer
BIG GIANT HEAD I Get Free Beer
Posts: 2385
Joined: 12/09/01, 12:00 am
Location: USA
Contact:

Post by AndrewB » 12/31/01, 6:33 am

typo: the bottom section should look like this:

echo.
echo Doing file stuff...
echo filejunk and stuff like that! whoo! (round1) >filejunk.junk
mkdir tempdir
cd tempdir
echo filejunk and stuff like that! whooo! (round2) >filejunk.junk

Post Reply