Detecting if unformatted drive K: exist?

  • Thread starter Thread starter Matt Adams
  • Start date Start date
M

Matt Adams

Assume the following situation:

I have a new, sometimes connected (external USB) hard disc with a new partition K:
on it. BUT this partition is currently NOT formatted (e.g. with NTFS).

How do I detect from command line (program) if
this hard disc resp. partition is currently connected or not ?

Notice: If the partition would be formatted the
solution is simple:

if exist "K:\" Echo K: is existing

But with an unformatted but existing partition the command above does NOT work.

So again: Is there a detection command line program
which gives me a reliable "yes" (errorlevel=1) or no
on this question?

Maybe I need one of these ResourceKit programs from MS or from other software sources

Matt
 
You'll get answers pertinent to your question if you repost your query in
microsoft.public.win2000.cmdprompt.admin, but here's something to work with.

If you simply change to the K drive in your command Win2K will generate a
different error message when the drive is present and not formatted than if
the drive doesn't exist. You might try issuing the command K: in your .cmd
or .bat file and piping the result to the Find command.
 
Matt Adams said:
Assume the following situation:

I have a new, sometimes connected (external USB) hard disc with a new partition K:
on it. BUT this partition is currently NOT formatted (e.g. with NTFS).

How do I detect from command line (program) if
this hard disc resp. partition is currently connected or not ?

Notice: If the partition would be formatted the
solution is simple:

if exist "K:\" Echo K: is existing

But with an unformatted but existing partition the command above does NOT work.

So again: Is there a detection command line program
which gives me a reliable "yes" (errorlevel=1) or no
on this question?

Maybe I need one of these ResourceKit programs from MS or from other software sources

Matt

I haven't tried this (because I don't happen to have any unformatted
disks lying about) but I suspect that mountvol.exe could be
your answer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top