write a Vb script to find a whther a selected drive exits.



write a Vb script to find a whther a selected drive exits...

Answer / cnu_thatavarthi

Option Explicit
Dim objFso, objFile,iCount,strDrivers

Set objFso = CreateObject("Scripting.FilesystemObject")
MsgBox objFso.Drives.Count

For iCount = 1 To objFso.Drives.Count

strDrivers = strDrivers & vbNewLine &objFso.Drives.Item(iCount).DriveType

Next
MsgBox strDrivers

If objFso.DriveExists("iTunes") Then
MsgBox "Driver is Exists"
Else
MsgBox "Drive is not exists"

End if

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More VB Script Interview Questions

what is the standards used for writing the script in QTP

0 Answers  


How will you release the memory acquired by an array variable in vbscript?

0 Answers  


How you can call vbscript functions?

0 Answers  


WHAT IS ENVIRONMENT VARIABLES?and where it is used in real time scenario?

2 Answers  


Open Yahoo Login Page in that page Suppose i have 100 mails and i want to delete 10'th mail now give procedure & Coding For that Scenario

4 Answers   AppLabs, IBM,






How to create a function in vbscript?

0 Answers  


how to write validation function for date in vb script

0 Answers  


what is diff b/n these 2 programs 1) for i=5 to 1 step 2 msgbox "pass" next 2_) for i=5 to 1 step -2 msgbox "pass" next

5 Answers   Hexaware,


What's the difference between vbscript and vb.net?

0 Answers  


write a vb script to calculate factorial of a number?

5 Answers  


Which object provide information about a single runtime error in a vbscript?

0 Answers  


How can I get the value of an object property or variable in another frame?

1 Answers   Citi Bank,


Categories