Page 1 of 1 1
Topic Options
#125503 - 2004-08-24 02:07 PM Check Drive Availability
EveryoneAll Offline
Fresh Scripter

Registered: 2002-11-23
Posts: 16
Loc: Singapore
Halo,

I tried to write a script to check if a particular drive has been used by any machine.

I tried IF EXIST (H:\*.*), but noticed it doesn't flag out cases when the drive is valid but no files in it.

Then I changed to "Dir("H:\*.*")", then check if @ERROR=0 which indicates the drive is available, regardless whether there's file in it or not.

However, I noticed the Dir command will not work on Win9x, as the @ERROR will all be 3, regardless the drive is available or not.

Appreciate anyone's help on the script to check if the Drive H has been used on any machines.

Thks.


Top
#125504 - 2004-08-24 02:31 PM Re: Check Drive Availability
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
a simple
Code:

if exist("H:\")
;do your stuff
endif



would do imo
_________________________



Top
#125505 - 2004-08-24 02:47 PM Re: Check Drive Availability
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, some other comments are needed.
a drive can be used by a machine even though it has no files on it no more.

are you wanting to check if something has changed on the drive or just if someone or something has written or accessed it?
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.056 seconds in which 0.028 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org