[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

(500 pts) VBS question How can I itterate through all drives on a server and return drive space skipping the CD ROM

Posted on 2006-04-25
4
Medium Priority
?
274 Views
Last Modified: 2010-04-17
I am trying to do a simple script that will itterate through all drives on a server and then return the capacity, so far i have most of it, but when it gets to the CD rom drive, I get drive not ready.

How can I tell my script to skip the CD rom drive? I tired an if statement like so:
'##########################################################
if oDrive.driveType <> 4 then
for each oDrive in oFSO.Drives
wscript.echo oDrive.DriveLetter & ": " & oDrive.TotalSize/1000000
next
end if

'#########################################################
Please help : )
0
Comment
Question by:sqlagent007
2 Comments
 
LVL 3

Accepted Solution

by:
jphillips247 earned 2000 total points
ID: 16534662
You just put your if in the wrong place
here it is corrected.

for each oDrive in oFSO.Drives
 
if oDrive.driveType <> 4 then
 wscript.echo oDrive.DriveLetter & ": " & oDrive.TotalSize/1000000
end if

next
0
 
LVL 1

Author Comment

by:sqlagent007
ID: 16534736
NICE!!!!!

0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Simple Linear Regression
Screencast - Getting to Know the Pipeline

590 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question