thank you teraplane. It clearly says Perl 5.004 needed to use the Win32::DriveInfo. But I am using Perl 5.003_07, I could not upgrade right now. So please suggest me other ways to find drive information.

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

thanks ahoffmann,
I got the following error message:
String found where operator expected at freespace.pl line 1, near "'c:' 'd:'"
(Missing operator before 'd:'?)
syntax error at freespace.pl line 1, near "'c:' 'd:'"
syntax error at freespace.pl line 6, near "}"
Execution of freespace.pl aborted due to compilation errors.

0

arogyarajxavierAuthor Commented: 2001-07-03

without the foreach loop I put `dir c:`, I got the value "in" in the variable $bytes.

how to I get the total space?. My aim is to find the percentage of available free space. I am getting the free space value in string format. How to get both total and available free space in numeric format. thanks.

0

arogyarajxavierAuthor Commented: 2001-07-04

The following script find the numeric value of the available free space. Please help me to find the total space of the dirve. thanks

I don't know of a tool giving the total size of a drive.
You may try to use fdisk, but I'm not shure if you can pipe the required commands into it.
Another solution might be using dir /c/w and piping the output to script (awk) which counts the used bytes.
'Cause NT's explorer.exe can show the disksize, there is probably an option to get it from command line too.

0

arogyarajxavierAuthor Commented: 2001-07-04

thanks ahoffmann,
The command dir/s produce the following two lines at the end.

34471 File(s) 1,041,144,676 bytes
6,707,159,040 bytes free

using
$x=$lastline[$#lastline];

I can get the 'bytes free'. how to i extract the previous line.?

0

arogyarajxavierAuthor Commented: 2001-07-05

thanks ahoffmann.

The following script solved my problem, It will produce
approximate total space of the drives.