1.

Solve : redirect input?

Answer»

i really blank this time...

@echo off
ver >myver.txt

if "98" appear at myver.txt GOTO 1.bat
if "XP" appear at myver.txt GOTO 2.bat

with my narrow knowledge... i cant use find

can anyone help meQuote

i really blank this time...

@echo off
ver >myver.txt

if "98" appear at myver.txt GOTO 1.bat
if "XP" appear at myver.txt GOTO 2.bat

with my narrow knowledge... i cant use find

can anyone help me


use find : eg

ver | find "Windows XP"

then check for %errorlevel%: eg

IF %errorlevel% EQU 0 Goto whateverthanks ghostdog74...

the lines u gave me is working well in XP..

and for win98, the line below should be OK..
but my writing SCRIPT is not very good...
i believed, other people would do this better

@echo off
ver |find "XP" >NUL
IF NOT ERRORLEVEL 0 echo Its 98
IF ERRORLEVEL 0 echo Its XPOr shorter:

@echo off
ver|find "XP">NUL&&echo.It's XP||echo.It's 98


guys...
i'm USING WIN98 (ver 4.10.2222)

i want user to enter the filename.rom... -->(i'm afraid i cant use CHOICE)
i have a list of filename(s).rom in C:\BIOS...
i want to compare user entry with the list of filename(s).rom in C:\BIOS
if exist the entry filename.rom the system will copy content from exist filename.rom in C:\BIOS into the new.rom to be executed for the next stage...

1.user enter filename.rom
2.compare the filename.rom with C:\BIOS
3.if exist the filename.rom in C:\BIOS copy filename.rom into new.rom

please help me... thanks in advance#!/bin/bash

echo "Choose your NEW.ROM.."; ls
read new
cd C:\BIOS
if [-e $new]
CP C:\BIOS\$new C:\NEW.ROM
else
echo "You not enter correctly"

echo "Choose your OLD.ROM.."; ls
read old
cd C:\BIOS
if [-e $old]
cp C:\BIOS\$old C:\OLD.ROM
else
echo "You not enter correctly"

i feel something weird.. but i dont know...
is this OK?woah..it seems like you are using unix bash shell? are you running cygwin or something?...don't confuse yourself.....i really depressed now...

what i really want to do is run this script at the start up MontaVista Linux OS. i believed i have to create the cfg file to receive this variable and to be used for next stage... but i just don't know where to start.

it's really hard to get the OS while not bothering other staff to test the script...i posted at a wrong forum huhu... sorry..

my question would be how i want to check whether file is exist in one folder or not? most challenging part is.. the file name is entered by user

cannot used this
if [ -e "$filename_by_user ]
then
echo Exist
else
echo Not Existyou are doing shell here...which is apparently, the "wrong" forum...

echo "Please key in path"
read userinput
echo "User keyed in $userinput"
if [ ! -e $userinput ] ;then
echo "$userinput does not exist"
exit 1
fi

## continue ....i'm gonna run this at WIN98 DOS...
.bat file..

Quote
you are doing shell here...which is apparently, the "wrong" forum...

echo "Please key in path"
read userinput
echo "User keyed in $userinput"
if [ ! -e $userinput ] ;then
echo "$userinput does not exist"
exit 1
fi

## continue ....

absolutely not Ok for batch file.. above script could only be ran as .bash...

how to do the same script in DOS..

from my understanding, dos 98 can accept user input as choices..
or user have to enter the filename and the variable..
ie test.bat variable
and INSIDE test.bat
@echo off
if %a '==' GOTO exit

please help meXset is very useful!

my problem finally gone..

xset.tripod.comwe have to pay for xset...
other solution is using LMOD..

try this out..
http://home.mnet-online.de/horst.muc/index.html


Discussion

No Comment Found