Page 1 of 1 1
Topic Options
#75093 - 2003-05-21 10:51 AM First try with FileSystemObject - read a CD-rom.. need help
masken Offline
MM club member
*****

Registered: 2000-11-27
Posts: 1222
Loc: Gothenburg, Sweden
Played around a bit with the fso thingie here [Wink] What I'm trying to do is read a CD-rom with the help of the fso object.

I'm stuck at trying to get the serial number of the disc in the drive though... anyone with ideas? It seems like the script here gets the serial of the drive unit itself...  -

code:
$objFSO = CreateObject("Scripting.FileSystemObject")
$Drives = $objFSO.Drives
FOR EACH $Drive IN $Drives
IF $Drive.Drivetype=4
? "Drive: " $Drive.Driveletter " is a CD-Rom drive."

IF $Drive.IsReady <> 0 ; strangely, the arg cannot be set to "= 1"..?
? " ...and contains media"
? " Label: " + CHR(34) + $Drive.VolumeName + CHR(34)
? " Serial: " + CHR(34) + $Drive.SerialNumber + CHR(34) ; The FSO returns the decimal serial, in difference to a cmd DIR, which returns the hex...
ENDIF
?
ENDIF
NEXT

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/h tml/jsprofiles.asp

...another thing I'd like to do is inject & eject the drive unit, and read all files.

There's been that "coffee cup holder" script on www-pages recently, so ejecting won't be a prob I guess [Wink]

[ 21. May 2003, 11:35: Message edited by: masken ]
_________________________
The tart is out there

Top
#75094 - 2003-05-21 11:28 AM Re: First try with FileSystemObject - read a CD-rom.. need help
masken Offline
MM club member
*****

Registered: 2000-11-27
Posts: 1222
Loc: Gothenburg, Sweden
Oh, stupid me hehe... the FSO returns a decimal serial, while a cmd DIR returns a hex, it's the correct value indeed [Razz]
_________________________
The tart is out there

Top
#75095 - 2003-05-21 11:44 AM Re: First try with FileSystemObject - read a CD-rom.. need help
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Mats,

interesting !

What do you try to achieve ? Annoying your (l)users ?
_________________________



Top
#75096 - 2003-05-22 12:14 AM Re: First try with FileSystemObject - read a CD-rom.. need help
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
That fso business is getting more interesting each and every day for me ...

While searching for more Info on M$ sites and getting more and more ... *MAD* [Mad]

Is there anyone that can definetly answer the following ?

  • Is MS Windoes Scripting Host thing shipped by default if OS > NT 4 ? (thus no Installation required when wanting to use fso)
  • It is not shipped with NT4 and earlier ?


[ 21. May 2003, 12:14: Message edited by: Jochen ]
_________________________



Top
#75097 - 2003-05-22 12:15 AM Re: First try with FileSystemObject - read a CD-rom.. need help
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Answering meself :

  • Yes, and
  • Yes
[Roll Eyes]

[ 21. May 2003, 12:28: Message edited by: Jochen ]
_________________________



Top
#75098 - 2003-05-22 12:41 AM Re: First try with FileSystemObject - read a CD-rom.. need help
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
that's the reason me does not use it [Big Grin]

no, the reason is that so many dudes use it and say that it's good.
doh.
_________________________
!

download KiXnet

Top
#75099 - 2003-05-21 02:09 PM Re: First try with FileSystemObject - read a CD-rom.. need help
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Maybe able to expand on Ruud's example script -

KiX2001.421\Samples\getdrvs.kix

Even though it is using WMI.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#75100 - 2003-05-21 02:09 PM Re: First try with FileSystemObject - read a CD-rom.. need help
masken Offline
MM club member
*****

Registered: 2000-11-27
Posts: 1222
Loc: Gothenburg, Sweden
@Jochen, I'm trying to automize the indexing of a CD-rom. Thought I'd build a KiXform around it later too [Smile]

Ie; present the CD-rom drives available on the system as buttons. Activate the buttons for the drives there's a CD in. When pressed, scan the CD (I'm interested in the CDR serial & label, it's files, filelocations (like somefolder\somefile.txt), filesizes& filedates. And perhaps the CDR media ATIP information), and when done, eject it.

[ 21. May 2003, 14:13: Message edited by: masken ]
_________________________
The tart is out there

Top
#75101 - 2003-05-21 03:19 PM Re: First try with FileSystemObject - read a CD-rom.. need help
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Cool !

Don't forget to post in kixforms forum archive when finished [Big Grin]
_________________________



Top
#75102 - 2003-05-21 08:35 PM Re: First try with FileSystemObject - read a CD-rom.. need help
masken Offline
MM club member
*****

Registered: 2000-11-27
Posts: 1222
Loc: Gothenburg, Sweden
Danged... the CD-rom ejecter was an OCX.. is this even convertable into KiX ?

code:
<SCRIPT language=VBScript>
<!--

Set oWMP = CreateObject("WMPlayer.OCX.7" )
Set colCDROMs = oWMP.cdromCollection

if colCDROMs.Count >= 1 then
For i = 0 to colCDROMs.Count - 1
colCDROMs.Item(i).Eject
Next ' cdrom
End If

-->
</SCRIPT>

_________________________
The tart is out there

Top
#75103 - 2003-05-21 08:37 PM Re: First try with FileSystemObject - read a CD-rom.. need help
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
it has been coded already.
it was something like "make your boss mad" script...
bet it was in general.
_________________________
!

download KiXnet

Top
#75104 - 2003-05-21 08:38 PM Re: First try with FileSystemObject - read a CD-rom.. need help
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yes, here:
http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=14;t=000243#000000

there is 2 ways.
with shell-object and with wmplayer.
_________________________
!

download KiXnet

Top
#75105 - 2003-05-21 09:17 PM Re: First try with FileSystemObject - read a CD-rom.. need help
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
k, with FileAction() you can do it also:

code:
$cdromeject=fileaction("d:\","eject")

_________________________
!

download KiXnet

Top
#75106 - 2003-05-22 06:39 PM Re: First try with FileSystemObject - read a CD-rom.. need help
masken Offline
MM club member
*****

Registered: 2000-11-27
Posts: 1222
Loc: Gothenburg, Sweden
Yes Lonkero, that works like a charm and is the best solution for this I believe, nice work! [Smile]

It's language specific, but what the heck, that's easily solved with the help of GETFILEVERSION("%WINDIR%\Explorer.exe", "Language") or something [Smile]

[ 22. May 2003, 18:40: Message edited by: masken ]
_________________________
The tart is out there

Top
Page 1 of 1 1


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

Who's Online
1 registered (Allen) and 271 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.073 seconds in which 0.026 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