hit07 Posted February 7, 2008 Share Posted February 7, 2008 hellowhen i add programs in server2003 64bit it ask for the install cd or the rc2 folder and the amd64 folderi am useing this Script i have found from this web site------------------------------------------------------------------------------------------------------------Dim ws, fs, windir, colDrives, objDrive, strCDSet ws = WScript.CreateObject("WScript.Shell")Set fs = CreateObject("Scripting.FileSystemObject")windir = ws.ExpandEnvironmentStrings ("%SYSTEMROOT%")Set colDrives = fs.DrivesFor Each objDrive in colDrives If fs.FileExists(objDrive.DriveLetter & ":\WIN51") Then strCD = objDrive.DriveLetter & ":"Next'**********************************************************************'** Subroutine; Copy the i386 folder from the source media and make **'** the appropriate registry entries. **'**********************************************************************Sub CopySource Dim strKeyPath strKeyPath = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\" fs.CopyFolder (strCD & "\i386"), (windir & "\i386"),True If fs.FolderExists(windir & "\i386\svcpack") Then fs.DeleteFolder(windir & "\i386\svcpack"),True ws.RegWrite strKeyPath & "SourcePath", "%systemroot%\\i386\\", "REG_SZ" ws.RegWrite strKeyPath & "ServicePackSourcePath", "%systemroot%\\i386\\", "REG_SZ"End Sub'**********************************************************************'** Run Tasks **'**********************************************************************CopySourcebut it still asks for the cd's has anyone had this problem before, or is there any way around thismany thanks Link to comment Share on other sites More sharing options...
jbm Posted February 8, 2008 Share Posted February 8, 2008 Is there a file named WIN51 file on the root of your CD? Link to comment Share on other sites More sharing options...
MHz Posted February 9, 2008 Share Posted February 9, 2008 Perhaps the script could check of the existence of the WIN51 file?Dim ws, fs, windir, colDrives, objDrive, strCD, checkfileSet ws = WScript.CreateObject("WScript.Shell")Set fs = CreateObject("Scripting.FileSystemObject")windir = ws.ExpandEnvironmentStrings ("%SYSTEMROOT%")Set colDrives = fs.Drivescheckfile = FalseFor Each objDrive in colDrives If fs.FileExists(objDrive.DriveLetter & ":\WIN51") Then strCD = objDrive.DriveLetter & ":" checkfile = True Exit For End IfNext'**********************************************************************'** Subroutine; Copy the i386 folder from the source media and make **'** the appropriate registry entries. **'**********************************************************************Sub CopySource Dim strKeyPath strKeyPath = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\" fs.CopyFolder (strCD & "\i386"), (windir & "\i386"),True If fs.FolderExists(windir & "\i386\svcpack") Then fs.DeleteFolder(windir & "\i386\svcpack"),True ws.RegWrite strKeyPath & "SourcePath", "%systemroot%\\i386\\", "REG_SZ" ws.RegWrite strKeyPath & "ServicePackSourcePath", "%systemroot%\\i386\\", "REG_SZ"End Sub'**********************************************************************'** Run Tasks **'**********************************************************************If checkfile Then CopySourceElse MsgBox "No Win51 file found in the root of any drive"End If Link to comment Share on other sites More sharing options...
gunsmokingman Posted February 9, 2008 Share Posted February 9, 2008 I have made a couple of changes to the script. This works like this1:\ Checks to see if the drive is ready2:\ Checks if the drive is a CD or DVD drive3:\ Checks for a filein the i386 folder4:\ If all three are true then it does the copy and reg stuff5:\ Will report if there was no source CD or DVDOption Explicit Dim Act :Set Act = CreateObject("Wscript.Shell") Dim Fso :Set Fso = CreateObject("Scripting.FileSystemObject") Dim WD :WD = Act.ExpandEnvironmentStrings("%SYSTEMROOT%") Dim Key :Key = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\" Dim Chk1, Drv For Each Drv In Fso.Drives If Drv.DriveType = 4 Then If Drv.IsReady Then If Fso.FileExists(Drv & "\i386\Zoneoc.dl_") Then Chk1 = True Fso.CopyFolder (Drv & "\i386"), (WD & "\i386"),True If Fso.FolderExists(WD & "\i386\svcpack") Then Fso.DeleteFolder(WD & "\i386\svcpack"),True Act.RegWrite Key & "SourcePath", "%systemroot%\\i386\\", "REG_SZ" Act.RegWrite Key & "ServicePackSourcePath", "%systemroot%\\i386\\", "REG_SZ" Exit For End If Else Chk1 = False End If End If Next If Chk1 = False Then MsgBox "No CD or DVD Source, was found",4128,"No Source" Else MsgBox "Completed Copy And Reg",4128,"Completed" End If Link to comment Share on other sites More sharing options...
hit07 Posted February 11, 2008 Author Share Posted February 11, 2008 thanks guysi will give that a try 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