|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
good day, i'm trying to use shell to run other applications from cdrom. usually it's like shell ("d:/...") but what if my cdrom drive is not d:? how can i assign it?
|
|
#2
|
|||
|
|||
|
is the program you are doing the shell in on cdrom? if so you can use App.Path to get the location of the exe. you can then use that to get to the relative path of the other exe you want to shell.
__________________
Programmer's Corner |
|
#3
|
|||
|
|||
|
Coudl you explain app.path a bit more? i'm a noob programmer and i need to run some programs off a cd, the program si on the cd too. but if you coudl help em then i coudl change it. I need a reply asap (sorry about the typos, i'm ni a rush)
|
|
#4
|
|||
|
|||
|
I think u can get the drives list,and get each drive information to judge whether is CDROM..
Get the drive list: Sub PrepareDriveList() Dim fso As New FileSystemObject Dim drA As Boolean Dim drB As Boolean Dim drC As Boolean Dim drD As Boolean Dim drE As Boolean Dim drF As Boolean Dim drG As Boolean Dim drH As Boolean Dim drI As Boolean Dim drJ As Boolean Dim drK As Boolean Dim drL As Boolean Dim drM As Boolean Dim drN As Boolean Dim drO As Boolean Dim drP As Boolean Dim drQ As Boolean Dim drR As Boolean Dim drS As Boolean Dim drT As Boolean Dim drU As Boolean Dim drV As Boolean Dim drW As Boolean Dim drX As Boolean Dim drY As Boolean Dim drZ As Boolean Set fso = CreateObject("Scripting.FileSystemObject") '-------------------------------------------------------------- ' --------------------|| Get Drives ||------------------------- '-------------------------------------------------------------- drA = fso.DriveExists("a:") drB = fso.DriveExists("b:") drC = fso.DriveExists("c:") drD = fso.DriveExists("d:") drE = fso.DriveExists("e:") drF = fso.DriveExists("f:") drG = fso.DriveExists("g:") drH = fso.DriveExists("h:") drI = fso.DriveExists("i:") drJ = fso.DriveExists("j:") drK = fso.DriveExists("k:") drL = fso.DriveExists("l:") drM = fso.DriveExists("m:") drN = fso.DriveExists("n:") drO = fso.DriveExists("o:") drP = fso.DriveExists("p:") drQ = fso.DriveExists("q:") drR = fso.DriveExists("r:") drS = fso.DriveExists("s:") drT = fso.DriveExists("t:") drU = fso.DriveExists("u:") drV = fso.DriveExists("v:") drW = fso.DriveExists("w:") drX = fso.DriveExists("x:") drY = fso.DriveExists("y:") drZ = fso.DriveExists("z:") ' Add Items lsvDrives.ListItems.Clear If drA = True Then AddDrive lsvDrives, "a:" If drB = True Then AddDrive lsvDrives, "b:" If drC = True Then AddDrive lsvDrives, "c:" If drD = True Then AddDrive lsvDrives, "d:" If drE = True Then AddDrive lsvDrives, "e:" If drF = True Then AddDrive lsvDrives, "f:" If drG = True Then AddDrive lsvDrives, "g:" If drH = True Then AddDrive lsvDrives, "h:" If drI = True Then AddDrive lsvDrives, "i:" If drJ = True Then AddDrive lsvDrives, "j:" If drK = True Then AddDrive lsvDrives, "k:" If drL = True Then AddDrive lsvDrives, "l:" If drM = True Then AddDrive lsvDrives, "m:" If drN = True Then AddDrive lsvDrives, "n:" If drO = True Then AddDrive lsvDrives, "o:" If drP = True Then AddDrive lsvDrives, "p:" If drQ = True Then AddDrive lsvDrives, "q:" If drR = True Then AddDrive lsvDrives, "r:" If drS = True Then AddDrive lsvDrives, "s:" If drT = True Then AddDrive lsvDrives, "t:" If drU = True Then AddDrive lsvDrives, "u:" If drV = True Then AddDrive lsvDrives, "v:" If drW = True Then AddDrive lsvDrives, "w:" If drX = True Then AddDrive lsvDrives, "x:" If drY = True Then AddDrive lsvDrives, "y:" If drZ = True Then AddDrive lsvDrives, "z:" End Sub Get drive information: Option Explicit Private Declare Function GetDriveType Lib "kernel32" _ Alias "GetDriveTypeA" (ByVal nDrive As String) As Long Public Function DriveType(Drive As String) As String Dim sAns as string, lAns as long 'fix bad parameter values If Len(Drive) = 1 Then Drive = Drive & ":\" If Len(Drive) = 2 And Right$(Drive, 1) = ":" _ Then Drive = Drive & "\" lAns = GetDriveType(Drive) Select case lAns Case 2 sAns = "Removable Drive" Case 3 sAns = "Fixed Drive" Case 4 sAns = "Remote Drive" Case 5 sAns = "CD-ROM Case 6 sAns = "RAM Disk" Case Else sAns = "Drive Doesn't Exist End Select DriveType = sAns End Function This is a sample link:sample |
|
#5
|
||||
|
||||
|
to cleverpig:
thanks hehe... i'll try this out right away...
![]()
__________________
Children Of The Night, aCc-csU™ [ CPU-WFA ] |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > how to assing cdrom in shell |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|