Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

DOS/Other DOS/Other
Search Search
Search for:
Tech Support Guy Forums > > >

Solved: need help writing simple DOS batch file


(!)

mikecarter79's Avatar
Member with 3 posts.
THREAD STARTER
 
Join Date: Jun 2012
Experience: Intermediate
26-Jun-2012, 07:23 PM #1
Solved: need help writing simple DOS batch file
Hello,
I have not messed around with DOS batch files in many years, and I need a simple program that will write the proper firmware to 1 of 3 different types of WD hard drives. The batch file only has to query the user for the hard drive type. Let's call the hard drive types A, B or C. Once the user inputs the hard drive type, an exec program will execute using the proper firmware for that particular drive type. Finally, a second exec file will execute for all 3 hard drive cases.

Here is what I need in laymens terms:

--------------------------------------------------------------------------------------------

query user : are you updating firmware on WD hard drive type A, B or C : (HDtype)
VAR = HDtype

if HDtype = A then execute (WD_download.exe 1tb.bin)
else
if HDtype = B then execute (WD_download.exe 250_500.bin)
else
if HDtype = C then execute (WD_download.exe velociraptor.bin)
endif

wdsspd.exe -a

------------------------------------------------------------------------------------------------

Thanks in advance for your help !!!!
-Mike
Squashman's Avatar
Trusted Advisor with 19,465 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
26-Jun-2012, 09:39 PM #2
I can write this for you when I get back from vacation but you have the general idea of what you need to do. The only two commands you need to use are SET and IF.
At the cmd prompt you can read the help of each command by typing a /? after the command.

This is a pretty basic batch file to implement.

I only have my phone with me while on vacation.
Squashman's Avatar
Trusted Advisor with 19,465 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
26-Jun-2012, 09:48 PM #3
Nevermind. I see you were helped on another forum. Would have been nice of you to come back here and close out this thread if you had an answer on another forum.
mikecarter79's Avatar
Member with 3 posts.
THREAD STARTER
 
Join Date: Jun 2012
Experience: Intermediate
26-Jun-2012, 10:13 PM #4
sorry, I will mark resolved
mikecarter79's Avatar
Member with 3 posts.
THREAD STARTER
 
Join Date: Jun 2012
Experience: Intermediate
26-Jun-2012, 10:18 PM #5
For anyone interested, here is the code I got from another forum:

@echo off

:menu
set "hdType="
set /p "hdType=Are you updating firmware on WD Hard Drive type 'A', 'B' or 'C'? "
if /i "%hdType%" == "A" (start /wait WD_download.exe 1tb.bin&goto ok)
if /i "%hdType%" == "B" (start /wait WD_download.exe 250_500.bin&goto ok)
if /i "%hdType%" == "C" (start /wait WD_download.exe velociraptor.bin&goto ok)
cls
echo Invalid input!
echo Please try again.
echo,
goto menu

k
start wdsspd.exe -a
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑