ripken204 Posted August 25, 2005 Share Posted August 25, 2005 im pretty sure that this has been asked before but i cant find itwell im going to be using virtual cd drives to test out my xpcd on vmware and how should i go about doing it with autoit. i have a drive f: h: i: j: . and i could possibly use any of them for my install, how can i make it generic to select what drive to install stuff from b/c i will be installing programs from the cd. or to make it easier would you just suggest copying all of the programs to the c: drive, then install them, then delete them? Link to comment Share on other sites More sharing options...
Nologic Posted August 26, 2005 Share Posted August 26, 2005 I'd suggest leaving stuff on the CD\DVD unless there is a really good reason.Older script...MHz has a newer more buff version of this:Global $DriveFunc _FindDrive($type, $name) Local $drvs While Not $Drive $drvs = DriveGetDrive($type) If Not @error Then For $i = 1 To $drvs[0] If DriveStatus($drvs[$i] & "\") = "READY" Then If FileExists($drvs[$i] & "\" & $name) Or DriveGetLabel($drvs[$i]) = $name Then $Drive = $drvs[$i] & "\" Return $Drive EndIf EndIf Next If Not $Drive Then If StringInStr("CDROM|REMOVABLE|NETWORK", $type) Then If StringInStr("CDROM|REMOVABLE", $type) Then If MsgBox(21, "Warning", "Please insert media into a drive now") = 2 Sleep(1000) If MsgBox(36, 'Important', 'Are you sure that you want to exit?') = 6 Then Exit ElseIf $type = "NETWORK" Then If MsgBox(21, "Warning", "Please connect to a network now") = 2 Then Sleep(1000) If MsgBox(36, 'Important', 'Are you sure that you want to exit?') = 6 Then Exit EndIf EndIf Else If MsgBox(36, 'Drive Not Found', 'Drive could not be found would you like to exit?') = 6 Then Exit EndIf Sleep(2000) EndIf EndIf WEndEndFuncBasically use some thing like this then to find the XP isntall disk:_FindDrive( "CDROM" , "WIN51" )Which would then set the global var of $Drive to what ever drive that is....so if it was on say drive Z....then $Drive would equal Z:\So you would then have some thing like this else where in the script RunWait ( $Drive & "SOFTWARE\Tools - CD & DVD\ASPI\ASPI_4.71.2_au3.exe" )To launch an app on the XP CD in a sub folder of "SOFTWARE" Link to comment Share on other sites More sharing options...
ripken204 Posted August 26, 2005 Author Share Posted August 26, 2005 so what code am i suppose to use? do u have an example script of it that i can see? and what im doing is telling it to find the disk with the label "xpcd" or whatever it is called? Link to comment Share on other sites More sharing options...
Nologic Posted August 26, 2005 Share Posted August 26, 2005 Your suppose to use all the code listed above.To find you CD disk labeled "xpcd" you would invoke:_FindDrive( "CDROM" , "xpcd" )Since the $name paramiter of the fuction is good for both looking for the title of the storage unit...or a file on the storage unit.The $type param....is for dictating what type of storage unit to search for. Values availabe are: "ALL", "CDROM", "REMOVABLE", "FIXED", "NETWORK", "RAMDISK", or "UNKNOWN" Link to comment Share on other sites More sharing options...
gunsmokingman Posted August 26, 2005 Share Posted August 26, 2005 (edited) Here is a VBS script that will list all the drive type This Color Is Inactive It checks to see if the check file isthere, remove ' those from before the begining. To Make Active Remove The ' from in front of the text. Add the Sfile to run the check.This Color is the check file it check for, Place in between the " "This can be a full path EG Sfile="\Afolder\Bfolder\WhateverCheck.Exe"This Color Is A Popup that will list each drive this can be removed from the scriptDim Act, Fso, Drv, Sfile, strDriveSet Act = CreateObject("Wscript.shell")Set fso = CreateObject("Scripting.FileSystemObject")'''' Place A Check File Here EG win51Sfile = "" Set Drv = Fso.Drives For Each strDrive in Drv Act.Popup "This Is Drive, " & strDrive & "\", 3, "List Drives", 0 + 32 ' If Fso.FileExists(strDrive & Sfile) Then ''''PLACE IF IT HERE ACTION HERE ' Exit For ' Else ''''PLACE IF IT NOT HERE ACTION HERE ' Exit For ' End If Next Edited August 26, 2005 by gunsmokingman Link to comment Share on other sites More sharing options...
ripken204 Posted August 26, 2005 Author Share Posted August 26, 2005 k, thx, ill be giving it a try in a few days when i get all of my programs able to be silent installs 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