Query partitions from batch file

  • Thread starter Thread starter Adrian
  • Start date Start date
A

Adrian

I am trying to mass copy certain files from the
workstations to a network share. On some instances the
client computer has more than one logical drive (C:). Is
there anyway to run the standard commands (i.e. dir,
xcopy, etc.) for all the local drives automatically? Is
there an environmental variable that list the local (non-
removable) drives? Thanks for your help.
Adrian
 
Adrian said:
client computer has more than one logical drive (C:). Is
there anyway to run the standard commands (i.e. dir,
xcopy, etc.) for all the local drives automatically? Is

Assuming NT4/2000, give this a whirl:-

@echo off & setlocal ENABLEEXTENSIONS
for %%a in (c d e f g h i j k l m n o p q r s t u v w x y z) do (
chkntfs %%a: 2>nul>nul && (echo/%%a: is a fixed drive)
)

If is displays the drive letters you expect, then replace the echo
statement with you copy command (use %%a: to refer to the drive).

For XP/2003 you can do something similar with FSUTIL (IIRC)
 
-----Original Message-----
"Adrian" <[email protected]> wrote in
message news:[email protected]...
Assuming NT4/2000, give this a whirl:-

@echo off & setlocal ENABLEEXTENSIONS
for %%a in (c d e f g h i j k l m n o p q r s t u v w x y z) do (
chkntfs %%a: 2>nul>nul && (echo/%%a: is a fixed drive)
)

If is displays the drive letters you expect, then replace the echo
statement with you copy command (use %%a: to refer to the drive).

For XP/2003 you can do something similar with FSUTIL (IIRC)

--
Ritchie, undo for mail


.
Seems not to be working. I also forgot that some of the
worksations may not have NTFS as file system. Any other
ideas. Thanks very much for your help.
Adrian
 
Adrian said:
worksations may not have NTFS as file system. Any other
ideas. Thanks very much for your help.
Adrian

Convert them ASAP ;) or change the target statement to something
like:-

chkntfs d:|find "system" >nul && (echo/%%a: is a fixed drive)
 
Back
Top