[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

how do I get format to work from the commandline with no prompts?

Posted on 2005-04-25
8
Medium Priority
?
207 Views
Last Modified: 2010-04-14
Hey guys,
I have written a batch for 2k3 which shutdowns certain services, runs defrag, and then restarts the services once a day. I am trying to accomplish this same thing with 2000. I have run into a variety of problems. First being that defrag is not supported from the commandline in 2k. No biggie. The work around is to simply quick format the raid device (mail spool) however, I cannot seem to get format to go from the batch file without prompting for the volume label and then a yes no answer. How do I accomplish this?

Worth 500 points.

Thanks,
Rick
0
Comment
Question by:richardsimnett
8 Comments
 
LVL 57

Expert Comment

by:Pete Long
ID: 13857137
Hi richardsimnett,
format /q

not work?

PeteL
0
 
LVL 85

Accepted Solution

by:
oBdA earned 1000 total points
ID: 13857245
The volume label can be specified with the /v:VolumeLabel switch; as for the prompt, try to pipe an "echo." to the format command. Specify the file system with /fs:NTFS. So the following line should do what you need:
echo.|format X: /v:VolumeLabel /fs:NTFS /q
On the other hand: a simple
rd /s /q "X:\Mail\Spool\Folder"
should work as well, shouldn't it?
0
 
LVL 12

Assisted Solution

by:Carlo-Giuliani
Carlo-Giuliani earned 1000 total points
ID: 13859044
Hmm....trickier that is sounds at first.  oBdA's suggestion will *almost* work, but
- you have to specify ECHO Y (not ECHO .)
- The volume label must be blank, to avoid having to specify the "old" volume label



0
Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

 
LVL 85

Expert Comment

by:oBdA
ID: 13859130
Well, I could only test it with a floppy (on which it worked), I didn't have a spare partition ...
0
 
LVL 12

Expert Comment

by:Carlo-Giuliani
ID: 13859935
yeah, it will work when formatting a new partition...but then if you run it a second time it expects you to also enter the "old" label for verification (unless it is blan).
0
 
LVL 32

Expert Comment

by:r-k
ID: 13862276
A workaround might be to just delete all files and folders on that drive with a command like:

 del z:\*.* /f/s/q

0
 
LVL 12

Expert Comment

by:Carlo-Giuliani
ID: 13862796
Yes, deleting all the files sounds like a good alternative.
0
 

Author Comment

by:richardsimnett
ID: 13863276
Ok... I have done the following which works:

ECHO Y | format f: /Q
md f:\spool


Just deleting the files and directories wont do it, as it doesnt realign the filesystem. (Ideally I would be able to defrag the raid from the command prompt, but thats not an option in win2k). After a few days of running the raid (SCSI 320) performance drops significantly because of the fragmentation of the file system.

Thanks,
Rick
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
This article will help to fix the below errors for MS Exchange Server 2016 I. Certificate error "name on the security certificate is invalid or does not match the name of the site" II. Out of Office not working III. Make Internal URLs and Externa…
Integration Management Part 2
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question