Dessip Posted September 22, 2004 Share Posted September 22, 2004 Hey atm i am creating a cd change so that the user inputs the amunt of cds install that he has, then it will copy all of the files over, and then ask for the next cd, But i was wondering if there is a variable for the current CD Rom drive, as i know that here is %Systemdrive% for the local HDD/HDD partition that the OS was installed to, but im not sure waht the command is for the CD Drive (If there is even one), Or if there isnt then with out useing the IF C:/blah.txt exist then CDROM = C:/ anf having loads of them in your program that will make it look untidy, is there anyother way that anyone can think of.Also does anyone know in VB if there is away to put a application switch in, so if the user puts /1 it will think that there is only 1 CD to install(I will release it once i have finnished)Thanks Dessip Link to comment Share on other sites More sharing options...
Bâshrat the Sneaky Posted September 22, 2004 Share Posted September 22, 2004 No, unfortunately there is no such variable...As you supposed, you need a batch file to do this:TITLE Setting the %settings% variableCLS@ECHO OFFIF EXIST C:\__SETTINGS__ set SETTINGS=C:\__SETTINGS__IF EXIST D:\__SETTINGS__ set SETTINGS=D:\__SETTINGS__IF EXIST E:\__SETTINGS__ set SETTINGS=E:\__SETTINGS__IF EXIST F:\__SETTINGS__ set SETTINGS=F:\__SETTINGS__IF EXIST G:\__SETTINGS__ set SETTINGS=G:\__SETTINGS__IF EXIST H:\__SETTINGS__ set SETTINGS=H:\__SETTINGS__IF EXIST I:\__SETTINGS__ set SETTINGS=I:\__SETTINGS__IF EXIST J:\__SETTINGS__ set SETTINGS=J:\__SETTINGS__IF EXIST K:\__SETTINGS__ set SETTINGS=K:\__SETTINGS__IF EXIST L:\__SETTINGS__ set SETTINGS=L:\__SETTINGS__IF EXIST M:\__SETTINGS__ set SETTINGS=M:\__SETTINGS__IF EXIST N:\__SETTINGS__ set SETTINGS=N:\__SETTINGS__IF EXIST O:\__SETTINGS__ set SETTINGS=O:\__SETTINGS__IF EXIST P:\__SETTINGS__ set SETTINGS=P:\__SETTINGS__IF EXIST Q:\__SETTINGS__ set SETTINGS=Q:\__SETTINGS__IF EXIST R:\__SETTINGS__ set SETTINGS=R:\__SETTINGS__IF EXIST S:\__SETTINGS__ set SETTINGS=S:\__SETTINGS__IF EXIST T:\__SETTINGS__ set SETTINGS=T:\__SETTINGS__IF EXIST U:\__SETTINGS__ set SETTINGS=U:\__SETTINGS__IF EXIST V:\__SETTINGS__ set SETTINGS=V:\__SETTINGS__IF EXIST W:\__SETTINGS__ set SETTINGS=W:\__SETTINGS__IF EXIST X:\__SETTINGS__ set SETTINGS=X:\__SETTINGS__IF EXIST Y:\__SETTINGS__ set SETTINGS=Y:\__SETTINGS__IF EXIST Z:\__SETTINGS__ set SETTINGS=Z:\__SETTINGS_EXITIn this batch the variable "SETTINGS" is made if there's a folder __SETTINGS__ found in the root of a HDD/CD/DVD. Link to comment Share on other sites More sharing options...
Dessip Posted September 22, 2004 Author Share Posted September 22, 2004 Ohhk, well im doing it in VB a nice easy language, and winXP has support for VB6 runtimes. so ill jsut get it to look for the I386 folder and if its there then make that the cd drive.ThanksDessip Link to comment Share on other sites More sharing options...
jdoe Posted September 22, 2004 Share Posted September 22, 2004 In your VB app you can make a registry read of this entryHKLM\Software\Microsoft\Windows\CurrentVersion\Setup\SourcePathSourcePath is the drive used for installing Windows (if install via cd drive then this value is the drive letter of the computer cd) Link to comment Share on other sites More sharing options...
Raja Posted September 22, 2004 Share Posted September 22, 2004 The following will set a variable strCDROM to the CDROM drive letter in a vbscript.Modify to suit your need.Set objDrives = CreateObject("Scripting.FileSystemObject").DrivesFor Each Drive In objDrives If Drive.DriveType = "4" Then strCDROM = Drive.DriveLetter & ":"NextAlso does anyone know in VB if there is away to put a application switch in, so if the user puts /1 it will think that there is only 1 CD to installProvide more details on what you are trying to accomplish, may be able to help you. Link to comment Share on other sites More sharing options...
Dessip Posted September 23, 2004 Author Share Posted September 23, 2004 Hey i have alreay dont it, jsut adding the finaly touches to it now. Then got to test it, Also i would rather Use API then Objects, as i know that API id deffonatly gonig to be installed when i run the EXE.Also i have done the application switch, it was not that hard, just didnt reaklise that i actually knew what i needed to do, Just got to modify it abit.But thank you foryour helpDessip Link to comment Share on other sites More sharing options...
Dessip Posted September 23, 2004 Author Share Posted September 23, 2004 Hey also jdoe i was being dumb when i wrote that post, the simple answer to that is all i need to do is put:start "Copy /y Destination, Source"That way it will copy it for me.Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now