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

about vb scripting programs this type of all question& answers

0 Answers  


How will you format a number in percetage format in vbscript?

0 Answers  


Which object is used to work with the excel sheets in the vbscript language and what statement is used to create this object?

0 Answers  


If anyone knows abt Test Complete material, Pls let me Know. if u have any material or any documents..... Pls mail me on this mail Id...... This is very Urgent Requirment..... for my Project.....

3 Answers  


What is the equivalent of VBScript?s On Error In Jscript ?

1 Answers   Microsoft,






If a calulator having 3 buttons (of any number)in 3 of them one is not working properly due to which answer is wrong always. write a script to find out which button is not working properly ?

0 Answers  


If we take 2 strings as “good” and “bad” then what will ‘+’ and ‘&’ operators return?

0 Answers  


Whenever I use Wscript.Echo Qtp raising Run time error as 'Object required for Wscript' How I can create object for Wscript

1 Answers  


How will you trim the spaces on the left of a string using vbscript?

1 Answers  


Explain vbscript in detail?

0 Answers  


How to find the font in qtp. Scenario:After entering the username and passwd you will be navigate into the "welcome:Username" page.Now I want to extarct font for this message.

0 Answers   GE, iGate,


How to insert snapshot during manual scripting in QTP?

1 Answers  


Categories