Navbar

  Elite Fitness Bodybuilding, Anabolics, Diet, Life Extension, Wellness, Supplements, and Training Boards
  Chat & Conversation
  Batch Files..MS dos

Post New Topic  
profile | register | preferences | faq | search

Author Topic:   Batch Files..MS dos
barney

Pro Bodybuilder

Posts: 378
From:down under
Registered: Jun 2000

posted December 08, 2000 07:18 AM

Staff Use Only: IP: Logged


can someone help me with this:

James is responsible for a computer used by several people at his work. He is concerned that these people who are computer illiterate might accidentally format the hard drive.
To prevent this happening he has changed the name of Format.com to frmt.com .
He now needs to write a batch file named Format.bat that will ony allow the user to format dirve A: or B:.

Write the batch file for him ,saving it as Format.bat. It should accept a command line parameter, either A; or B:. If correct parameter is entered the batch file should call frmt.com amd commence formatting the floppy disk. If an incorrect command line parameter is entered or the parameter is missing then an appropriate error message should be displyed, advising the user about missing parameters and invalid drives.

ok.....???


Click Here to See the Profile for barney   Click Here to Email barney     Edit/Delete Message      Reply w/Quote
JohnnyO

Moderator

Posts: 2397
From:Houston, TX, USA
Registered: Apr 2000

posted December 08, 2000 11:09 AM

Staff Use Only: IP: Logged


damn this is going way back! i have a book that explains this somewhere.. i don't remember.


Click Here to See the Profile for JohnnyO   Click Here to Email JohnnyO     Edit/Delete Message    UIN: 11976789   Reply w/Quote
barney

Pro Bodybuilder

Posts: 378
From:down under
Registered: Jun 2000

posted December 09, 2000 02:54 AM

Staff Use Only: IP: Logged


how can i modify the answer to this question to apply to the previous, i found this one in aa study guide>>>

Write a batch file called FMT.BAT that will perform an unconditional disk format to the density of the drive by reading the drive as a replaceable parameter. Include a check routine that wil prevent formatting anything but drive A: or B:, and produce appropriate screen prompts. Dont forget a prompt for missing parameters.

Heres the answer:
@echo off
cls
rem This is FMT.BAT
rem
if %1!==! goto prmt
if not %1==A: goto nope
if not %1==a: goto nope
if not %1==B: goto nope
if not %1==b: goto nope
echo.
echo format %1 /u
goto end
:nope
echo.
echo You cant format drive %1
goto end
rmt
echo.
echo Dont forget the drive letter and colon (such as A
:end

is this any help?


Click Here to See the Profile for barney   Click Here to Email barney     Edit/Delete Message      Reply w/Quote

All times are ET (US)

Post New Topic  
Hop to:

Contact Us | Back to Elite Fitness | Privacy Statement

Powered by Infopop www.infopop.com © 2000
Ultimate Bulletin Board 5.45c



HomeArticlesDiscussion BoardsFeatured SitesContact Us� ReportsSupplementsShopping