mIRC Home    About    Download    Register    News    Help

Print Thread
#75008 12/03/04 10:35 PM
Joined: Oct 2003
Posts: 80
R
Babel fish
OP Offline
Babel fish
R
Joined: Oct 2003
Posts: 80
Im trying to make a script that will detect all drives on the machine. If i was to use a while script to do this I would have to change the number of the var in the while script to a letter. Only way i can think of doing this is making a big long huge list. such as :

alias hd {
if (%hd = 1) set %hd C:
if (%hd = 2) set %hd D:
}

Then point his alias to the while script. however Drives up to M on my network and would like to code this so it would not take up so much room.

Any help?
Thanks


RockHound
#75009 13/03/04 12:01 AM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Assuming you've got mIRC 6.1 or later there's no need to do that. You can loop through $disk() directly with numbers and retrieve the relevant drive letter from $disk(number).path.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
#75010 13/03/04 03:59 AM
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
In addition, the method you were looking for is this.

[color:000099]var %i = $asc(A)
inc %i
echo -a $chr(%i) == B[/color]

However, $disk(%i) where %i = 1 to $disk(0) is a better solution as starbucks mentioned.
Just thought you should know the solution to that puzzle, too.

- Raccoon


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
#75011 14/03/04 04:58 AM
Joined: Oct 2003
Posts: 80
R
Babel fish
OP Offline
Babel fish
R
Joined: Oct 2003
Posts: 80
thanks to both of you


RockHound

Link Copied to Clipboard