forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Multiple Drive Info...
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code
View previous topic :: View next topic  
Author Message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Aug 02, 2002 10:43 pm    Post subject: Multiple Drive Info... Reply with quote

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
View user's profile Send private message Send e-mail
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sat Aug 03, 2002 11:06 am    Post subject: Reply with quote

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
View user's profile Send private message
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Sat Aug 03, 2002 3:11 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Aug 03, 2002 6:16 pm    Post subject: Reply with quote

Thanks guys, Smile

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 Smile

_________________
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
View user's profile Send private message Send e-mail
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Aug 03, 2002 8:59 pm    Post subject: Reply with quote

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 Smile

_________________
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
View user's profile Send private message Send e-mail
LOBO
Valued Contributor
Valued Contributor


Joined: 14 Mar 2002
Posts: 241
Location: Wilmington, Delaware, USA

PostPosted: Sat Aug 03, 2002 9:42 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Aug 03, 2002 9:46 pm    Post subject: Reply with quote

Thanks Lobo, Smile

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 Smile

_________________
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
View user's profile Send private message Send e-mail
LOBO
Valued Contributor
Valued Contributor


Joined: 14 Mar 2002
Posts: 241
Location: Wilmington, Delaware, USA

PostPosted: Sat Aug 03, 2002 9:54 pm    Post subject: Reply with quote

Yeah it does Mac sorry wasn't even checking the status bar was just testing the drives for you Very Happy

- Mark
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Aug 03, 2002 10:01 pm    Post subject: Reply with quote

Thanks Smile
_________________
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
View user's profile Send private message Send e-mail
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Sat Aug 03, 2002 10:10 pm    Post subject: Reply with quote

Hey Mac!

The program really hates audio CDs sitting in a CDROM drive. Perhaps it does not like my
taste in music ?? Cool

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
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Aug 03, 2002 10:16 pm    Post subject: Reply with quote

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 Smile

_________________
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
View user's profile Send private message Send e-mail
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Aug 03, 2002 10:20 pm    Post subject: Reply with quote

Hiya Dread, Smile

If the CDROM parameter doesn't work, I dunno
how to avoid possible errors. It should be skipping
over CDROMs altogether...

Cheers, Mac Smile

_________________
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
View user's profile Send private message Send e-mail
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Sat Aug 03, 2002 10:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Aug 03, 2002 10:31 pm    Post subject: Reply with quote

AHA! 8O

Mucho gracias El Dread... Wink

I repaired that and added code to show CDROM
and DVDROMs in the lower left, along with the
"Removable" drives...

Thanks again, Mac Smile

_________________
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
View user's profile Send private message Send e-mail
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Sun Aug 04, 2002 9:14 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group