I am presently pulling information from a specific text file that has to be
on a floppy (don't ask why...I gave up asking why a long time ago).
The application takes the info from the file stores it in a session array
and all is good from there.

I'm trying to figure a 'nice' way of error trapping and alerting the user
that he hasn't put the disk in or that the file isn't there etc.

I have limited experience with the FileSystemObject so that's why I'm
turning here.
I'd like to alert the user that they have not yet put the disk in and not
let them go on until the correct disk with the correct file is in their
drive.

Anyone have any similar code or can point me in a good direction?

Pejo

Re: Help with File System Object by Joe

Joe
Wed Oct 22 11:45:06 CDT 2003

Hi,

"Pejo" <pottymouthed@hotmail.com> wrote in message
news:sVxlb.5757$XO.761821@news20.bellglobal.com...
| I am presently pulling information from a specific text file that has to
be
| on a floppy (don't ask why...I gave up asking why a long time ago).
| The application takes the info from the file stores it in a session array
| and all is good from there.
|
| I'm trying to figure a 'nice' way of error trapping and alerting the user
| that he hasn't put the disk in or that the file isn't there etc.
|
| I have limited experience with the FileSystemObject so that's why I'm
| turning here.
| I'd like to alert the user that they have not yet put the disk in and not
| let them go on until the correct disk with the correct file is in their
| drive.
|
| Anyone have any similar code or can point me in a good direction?

The following FSO methods should get you there

set oFloppy= _
createobject("scripting.fileSystemObject").getDrive("A:\")
if NOT oFloppy.isReady then ...
if NOT (lcase(oFloppy.volumeName)="...") then ...
if NOT (lcase(oFloppy.serialNumber)="...") then ...

Look them up in the index of the WSH CHM file documentation.

http://www.microsoft.com/downloads/search.aspx?displaylang=en
The MS Download Center (English Language)

http://www.microsoft.com/downloads/results.aspx?productID=478EA476-5552-479E-A200-2C33FFD43F24&freetext=&DisplayLang=en
WSH Updates, Documentation and Utility Downloads (English Language)

http://www.microsoft.com/downloads/details.aspx?FamilyID=01592c48-207d-4be1-8a76-1c4099d7bbb9&DisplayLang=en
Windows Scripting Documentation Download (English Language)

For WSH downloads in languages other than English, click on The MS Download
Center link, then select the desired language and click the Go button in the
Worldwide Downloads drop-down box. Once in the appropriate language, select
the equivalent of the Windows Script category in the Product/Technology
drop-down box, and then click the Go button in that box.

Joe Earnest




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.521 / Virus Database: 319 - Release Date: 09-23-03



Re: Help with File System Object by Joe

Joe
Wed Oct 22 12:41:43 CDT 2003

Sorry, missed part of your question. To just check on the existence of a
specific file, you can simplify the script to something like the following.
File existence is false if no floppy is inserted.

set oFso= createobject("scripting.fileSystemObject")

do until oFso.fileExists("A:\...")
'use the MsgBox Retry-Cancel keys
if (msgbox("message", vbRetryCancel +vbExclamation, _
"title")=vbCancel) then wscript.quit
loop

... 'the remainder of your script

Joe Earnest



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.521 / Virus Database: 319 - Release Date: 09-23-03



Help with File System Object by Bryan

Bryan
Thu Oct 23 15:45:48 CDT 2003

You're looking for the 'IsReady' method for the DRIVE
object. Checkout this sample; I used it to see if the
drive I am looking for is on-line or not. (I happen to
skip the A drive just cause I expect it to be offline but
if you went immediately after the A drive, that would do.
My example even checks the VOLUME NAME on the media to
make sure it's what I wanted.

Set fso = CreateObject
("Scripting.FileSystemObject")
For each drive in fso.Drives
IF (drive.DriveLetter >= "C") and
(drive.IsReady) THEN
IF (drive.VolumeName =
NETDISK_NAME) THEN
GetNetdiskDrive =
Drive.DriveLetter & ":"
Exit For
End if
End if
Next

>-----Original Message-----
>I am presently pulling information from a specific text
file that has to be
>on a floppy (don't ask why...I gave up asking why a long
time ago).
>The application takes the info from the file stores it in
a session array
>and all is good from there.
>
>I'm trying to figure a 'nice' way of error trapping and
alerting the user
>that he hasn't put the disk in or that the file isn't
there etc.
>
>I have limited experience with the FileSystemObject so
that's why I'm
>turning here.
>I'd like to alert the user that they have not yet put the
disk in and not
>let them go on until the correct disk with the correct
file is in their
>drive.
>
>Anyone have any similar code or can point me in a good
direction?
>
>Pejo
>
>
>.
>