Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 17th, 2003, 10:06 AM
wyldKard's Avatar
wyldKard wyldKard is offline
aCc-csU™
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: forgotten realms
Posts: 195 wyldKard User rank is Lance Corporal (50 - 100 Reputation Level)wyldKard User rank is Lance Corporal (50 - 100 Reputation Level)wyldKard User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Day 7 h 26 m 9 sec
Reputation Power: 6
Send a message via Yahoo to wyldKard
Question how to assing cdrom in shell

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?

Reply With Quote
  #2  
Old August 17th, 2003, 12:43 PM
nopoints nopoints is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Windsor ON, Canada
Posts: 459 nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 13 h 44 m 22 sec
Reputation Power: 8
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

Reply With Quote
  #3  
Old October 18th, 2003, 11:05 AM
twistedmetal twistedmetal is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: dunno
Posts: 1 twistedmetal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to twistedmetal
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)

Reply With Quote
  #4  
Old October 19th, 2003, 09:25 AM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
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

Reply With Quote
  #5  
Old October 19th, 2003, 11:59 AM
wyldKard's Avatar
wyldKard wyldKard is offline
aCc-csU™
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: forgotten realms
Posts: 195 wyldKard User rank is Lance Corporal (50 - 100 Reputation Level)wyldKard User rank is Lance Corporal (50 - 100 Reputation Level)wyldKard User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Day 7 h 26 m 9 sec
Reputation Power: 6
Send a message via Yahoo to wyldKard
to cleverpig:

thanks hehe... i'll try this out right away...
__________________
Children Of The Night, aCc-csU™
[ CPU-WFA ]

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > how to assing cdrom in shell


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT