Incroyable HULK Posted November 29, 2004 Author Share Posted November 29, 2004 @zbetaDo you think it is possible to have all my command into one single file using AutoIT? What I mean is for now I have to create a batch file for every program I want to install silently (with switches). I would be great if I could store all theses commands into one single file and triger the proper command from my HTML Front-end...Also, where do you get those cool set of icon like the one you sent me? Link to comment Share on other sites More sharing options...
BritishBulldog Posted November 29, 2004 Share Posted November 29, 2004 But what happens to the script two threads above if i have two or even three CD Drives?my install CD is in the second? That routine only finds the first drive.Dont work for me it keeps telling me my Hard Drive is a CDROM.............ooops my mistake changed the cmd to CDROM.cmd this would work better, but it will only work if you have a cd.txt document in the root of the CD.echo offmode con: cols=55 lines=2title CdVarcolor 9f> Cd.vbs echo Dim ts >> Cd.vbs echo Set fso = CreateObject("Scripting.FileSystemObject")>> Cd.vbs echo For Each objDrive In fso.Drives>> Cd.vbs echo If objDrive.DriveType = "4" And objDrive.IsReady Then>> Cd.vbs echo If fso.FileExists(objDrive ^& "\cd.txt") Then strDriveLetter = objDrive>> Cd.vbs echo End If>> Cd.vbs echo Next>> Cd.vbs echo Set ts = fso.CreateTextFile("cd.cmd", True, False)>> Cd.vbs echo ts.WriteLine "set " ^& Left(WScript.ScriptName, InStr(WScript.ScriptName, ".") - 1) ^& "=" ^& strDriveLetter>> Cd.vbs echo ts.Closeping -n 2 127.0.0.1>nulstart wscript.exe Cd.vbsping -n 2 127.0.0.1>nulcall Cd.cmdclsmode con: cols=55 lines=5color 2becho.echo Your Cd Is %CD%echo.echo set cdrom=%CD%echo.ping -n 3 127.0.0.1>nulexit Link to comment Share on other sites More sharing options...
gunsmokingman Posted November 29, 2004 Share Posted November 29, 2004 (edited) This one will you what the cd without a batch fileDim CDdrv, Fso 'As Scripting.FileSystemObjectConst CDROM = 4On Error Resume NextSet Fso = CreateObject("Scripting.FileSystemObject")strDriveLetter = ""For intDriveLetter = Asc("D") To Asc("Z")Err.ClearIf Fso.GetDrive(Chr(intDriveLetter)).DriveType = CDROM ThenIf Err.Number = 0 ThenstrDriveLetter = Chr(intDriveLetter)CDdrv = strDriveLetterExit ForEnd IfEnd IfNextL=MsgBox ("Your Cd Is: " & CDdrv,0 + 48,"The Cd Is: " & CDdrv)wscript.quit Edited January 5, 2006 by gunsmokingman Link to comment Share on other sites More sharing options...
BritishBulldog Posted November 29, 2004 Share Posted November 29, 2004 it still only finds the first cd rom drive.. Link to comment Share on other sites More sharing options...
gunsmokingman Posted November 29, 2004 Share Posted November 29, 2004 (edited) I dont Know if this will work. I Have Only One CD Drive,I added loop to the code.Dim CDdrv, Counter , Fso, RBoxCounter = 0Const CDROM = 4 Do Until RBox = vbcancel On Error Resume Next Set Fso = CreateObject("Scripting.FileSystemObject") strDriveLetter = "" For intDriveLetter = Asc("A") To Asc("Z") Err.Clear If Fso.GetDrive(Chr(intDriveLetter)).DriveType = CDROM Then If Err.Number = 0 Then strDriveLetter = Chr(intDriveLetter) CDdrv = strDriveLetter Exit For End If End IfNext Do Until Counter = 10 Counter = Counter + 1 RBox = MsgBox("Your Cd Is: " & CDdrv & vbCrLf & "Press Cancel To Quit" & vbCrLf & Counter,1 + 48,"The Cd Is: " & CDdrv) If Counter = 10 Then RBox = vbcancel MsgBox "The Loop Ran 10 Times" & vbCrLf & "Preparing To Exit Script", 0 + 32,"End Loop" End If Exit Do Loop Loop Edited January 5, 2006 by gunsmokingman 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