View previous topic :: View next topic |
Author |
Message |
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Fri Aug 02, 2002 10:43 pm Post subject: Multiple Drive Info... |
|
|
Here's a utility I made a while back. I still use FAT16
and have drives C-M to keep cluster sizes smaller.
Should work in VDS3 and VDS4...
__________________________________________________________________________________________________________________________
Code: |
%d = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
OPTION SCALE, 96
OPTION DECIMALSEP, "."
TITLE By Mac
DIALOG CREATE, "Hard Drive Info",-1,0,450,300
DIALOG ADD,STYLE,NormText,Courier New,8
DIALOG ADD,STYLE,LineStyle,,,,BLACK
DIALOG ADD,TEXT,Label,0,50,,,"Used Disk Space Full Total MB Free MB Full",,NormText
%a = 0
%b = 0
%y = 1
%x = 1
REPEAT
if @equal(@volinfo(@substr(%d, %x),T),"CD-ROM")
%c = %c@substr(%d, %x)" "
goto Skip
end
rem -- May have to replace "REMOVABLE" with your language
rem -- equivalent for some Windows versions (Windows bug?).
if @equal(@volinfo(@substr(%d, %x),T),"REMOVABLE")
%r = %r@substr(%d, %x)" "
goto Skip
end
if @volinfo(@substr(%d, %x),S)
%f = @volinfo(@substr(%d, %x),F)
%t = @volinfo(@substr(%d, %x),S)
%u = @fsub(%t, %f)
DIALOG ADD,TEXT,Drive%x,@prod(%y, 18),5,,,"Drive "@substr(%d, %x)":"
DIALOG ADD,PROGRESS,ProgBar%x,@prod(%y, 18),50,178,12
%p = @format(@fdiv(%u, %t), .2)
%p = @format(@fmul(%p, 100), .0)
DIALOG SET, ProgBar%x, %p
DIALOG ADD,TEXT,Percent%x,@prod(%y, 18),233,,,%p "%"
DIALOG ADD,TEXT,Total%x,@prod(%y, 18),281,,,@fdiv(%t, 1000)
%a = @fadd(%a, @fdiv(%t, 1000))
DIALOG ADD,TEXT,Free%x,@prod(%y, 18),373,,,@fdiv(%f, 1000)
%b = @fadd(%b, @fdiv(%f, 1000))
%y = @succ(%y)
end
:Skip
%x = @succ(%x)
UNTIL @greater(%x, 26)
DIALOG ADD,TEXT,Line1,@sum(@prod(%y, 18),5),5,440,1,"",,LineStyle
DIALOG ADD,TEXT,Removables,@sum(@prod(%y,18),10),5,,,"Removable: "%r" CD/DVD: "%c
DIALOG ADD,TEXT,GrandTotal,@sum(@prod(%y,18),10),233,,,"Totals"
DIALOG ADD,TEXT,GTotal,@sum(@prod(%y, 18),10),281,,,%a
DIALOG ADD,TEXT,GTotalFree,@sum(@prod(%y,18),10),373,,,%b
WINDOW POSITION,"Hard Drive Info",,,,@sum(@prod(%y, 18), 55)
DIALOG SHOW
:EVLOOP
WAIT EVENT
goto @event()
:CLOSE
EXIT
STOP
|
[EDIT1] Added code to skip CDROM (needed on some systems).
[EDIT2] Added code to check for removable drives.
[EDIT3] Corrected code to check CDROM.
Cheers, Mac _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Last edited by Mac on Thu Aug 29, 2002 9:24 pm; edited 9 times in total |
|
Back to top |
|
|
Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Sat Aug 03, 2002 11:06 am Post subject: |
|
|
You script also added my D: cd-rom player... I think you should make something that if the drive-size is 650/700 MB that it wouldn't get in the drive-list...
Also, if I remove the CD out of the player, Windows gives a warning that there is no CD in the Station... (With the title-bar: Visual DialogScript: vds.exe - No CD) |
|
Back to top |
|
|
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Sat Aug 03, 2002 3:11 pm Post subject: |
|
|
Like in Garrett's example related to this topic, you should be able to use the following
to check for a drive being a CD-ROM drive:
if @equal(@volinfo(<drive letter>,T),CD-ROM) |
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Aug 03, 2002 6:16 pm Post subject: |
|
|
Thanks guys,
Although it ignored my CD and CD/DVDROM drives
if they were empty, apparently it didn't for everyone.
I added code to skip CDROM drives for other systems.
Cheers, Mac _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
|
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Aug 03, 2002 8:59 pm Post subject: |
|
|
OK, this is kinda weird...
Using the "CDROM" parameter didn't change anything
on my system (but I left it in), it still ignores the CDROM
unless there's a CD in it, then it shows the CD drive info.
I also added code to show "REMOVABLE" drives, but it
doesn't show CDROM drives as removable.
Anybody wanna check this on another OS (mine's Win95)?
Cheers, Mac _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
|
|
Back to top |
|
|
LOBO Valued Contributor
Joined: 14 Mar 2002 Posts: 241 Location: Wilmington, Delaware, USA
|
Posted: Sat Aug 03, 2002 9:42 pm Post subject: |
|
|
Mac,
I'm using XP pro and it skips my cd-roms (have 2) unless there are disks in them. If disks are in then it checks them. It does completely skip both of my removable disks (zip and jaz drives) whether a disk is in them or not.
- Mark |
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Aug 03, 2002 9:46 pm Post subject: |
|
|
Thanks Lobo,
Does it show your zip and jaz drive letters in the lower
left as "Removable drives"?
Only my drive A and (external) zip drive (O) shows there...
Cheers, Mac _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
|
|
Back to top |
|
|
LOBO Valued Contributor
Joined: 14 Mar 2002 Posts: 241 Location: Wilmington, Delaware, USA
|
Posted: Sat Aug 03, 2002 9:54 pm Post subject: |
|
|
Yeah it does Mac sorry wasn't even checking the status bar was just testing the drives for you
- Mark |
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Aug 03, 2002 10:01 pm Post subject: |
|
|
Thanks _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
|
|
Back to top |
|
|
Dr. Dread Professional Member
Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Sat Aug 03, 2002 10:10 pm Post subject: |
|
|
Hey Mac!
The program really hates audio CDs sitting in a CDROM drive. Perhaps it does not like my
taste in music ??
Well, anyway it returns a "Non-numeric value" error in this line
Code: | %p = @format(@fdiv(%u, %t), .2) |
Prolly because the audio CD returns a 0 for both %u and %t
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Aug 03, 2002 10:16 pm Post subject: |
|
|
Hmmm... apparently checking for "CDROM" does
nothing. Otherwise the CDROM drive letter would
show up in the lower left with "Removable drives".
The program checks both the "REMOVABLE" and
"CDROM" parameters together (line 14), and (if
true) appends the current drive letter to the "%r"
var...
Cheers, Mac _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
|
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Aug 03, 2002 10:20 pm Post subject: |
|
|
Hiya Dread,
If the CDROM parameter doesn't work, I dunno
how to avoid possible errors. It should be skipping
over CDROMs altogether...
Cheers, Mac _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
|
|
Back to top |
|
|
Dr. Dread Professional Member
Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Sat Aug 03, 2002 10:25 pm Post subject: |
|
|
Hi Mac
Spotted an error:
Code: | if @equal(@volinfo(@substr(%d, %x),T),"CDROM")@equal(@volinfo(@substr(%d, %x),T),"REMOVABLE") |
should be
Code: | if @equal(@volinfo(@substr(%d, %x),T),"CD-ROM")@equal(@volinfo(@substr(%d, %x),T),"REMOVABLE") |
Well, actually the difference is just the dash in CD-ROM
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Aug 03, 2002 10:31 pm Post subject: |
|
|
AHA! 8O
Mucho gracias El Dread...
I repaired that and added code to show CDROM
and DVDROMs in the lower left, along with the
"Removable" drives...
Thanks again, Mac _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
|
|
Back to top |
|
|
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Sun Aug 04, 2002 9:14 am Post subject: |
|
|
Seems to work well, except for my A: diskette drive (if no disk is inserted).
When I launch the program VDS shows a dialog about no disk being inserted
in the A: drive, allowing to choose Cancel, Retry or Ignore.
The A: drive doesn't show up in "Removable drives" either with or without disk
inserted. I'm sure this is caused by my Windows language, in which @VOLINFO(A:,T)
returns "Verwisselbaar" rather than "Removable". So in fact this is a bug in VDS.
It all seems to work perfectly after replacing "Removable" with "Verwisselbaar"
in your script. This is probably the problem Skit encountered too.
BTW, my Windows returns "Vast" instead of "Fixed" and "Netwerk" instead of
"Network". |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|