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 wrong with the following code: <%afname="header.asp"%><!?#include file ="<%=afname%>"?>

1 Answers  


How to return only alpha bate string from an string str = "bibhu@#$%&das&*)(SUndar"

4 Answers   Cap Gemini,


How to select a value from a list box by using Selenium web-driver?

2 Answers   HCL,


i need to sort the data using qtp script for this how i need to write a qtp script

0 Answers  


Suppose by navigation I went from 1 st page to 5 page ,so Write a generic script for coming from any page to the 1st page and by executing where the page may be it will come to 1st page

1 Answers   CybAge,






how to operate webobjects in a webpage using getobject function and then using generic methods?

0 Answers  


what is the function to get the ascii value of the character?

6 Answers   Netxcell, Oracle,


give me any information abou vb script books learn quckly

0 Answers  


What are the 2 ways to pass a value to the function?

0 Answers  


Mention how to create a cookie using vbscript?

0 Answers  


write a vb script to display factorial of a number using function

1 Answers  


There are 5 web pages.write a script to click the button on 4th web page.

0 Answers   Accenture,


Categories