W
Ward Horsfall
Hi,
I am wondering if anybody can give me some advice I am trying to create an
automated
procedure that will install IIS on Windows 2000 servers that have already
been installed.
IIS is not installed on them by default. Sorry for the length of this post -
only way of getting
the details across.
I have found the following article:
How to Add or Remove Windows Components with Sysocmgr.exe
http://support.microsoft.com/default.aspx?scid=kb;en-us;222444
Essentially you run a command like:
sysocmgr /i: %windir%\inf\sysoc.inf /u:c:\ocm.txt
I would like to add an option to this that tells where to source the I386
files from or put something
in either the iis.txt file or the sysoc.inf file. The problem is I get
promped for the windows CD unless
I screw around with the registry as specified below. Can it be done with
making a change to the files
I listed above or am I stuck with changing the registry key around.
Thanks in advance,
Ward.
*******************************************************
Here is what I did below a messy work around - (install_iis.vbs uses
iis.txt):
iis.txt file : ------------------------------------
[components]
iis_common = On
iis_doc = On
iis_ftp = Off
iis_htmla = On
iis_inetmgr = On
iis_nntp = Off
iis_nntp_docs = Off
iis_smtp = On
iis_smtp_docs = On
iis_www = On
-------------------------------------------------------------------
install_iis.vbs : --------------------------------------------------
' ------------------------------------------------------------------
' install_iis.vbs:
'
' Reference:
'
' How to Add or Remove Windows Components with Sysocmgr.exe
' http://support.microsoft.com/default.aspx?scid=kb;en-us;222444
'
' ------------------------------------------------------------------
dim save1 ' Save values of install locations
dim save2 ' Save values of install locations
dim install_command
dim i386_path ' Path to i386 files.
Set WshShell = WScript.CreateObject("WScript.Shell")
' Get the current registry key settings for I386 files - save for later.
save1 =
WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\Sourc
ePath")
save2 =
WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\Servi
cePackSourcePath")
i386_path = "\\SRV1\PC_SOURCE" ' Server location for I386 files.
' Reset location for I386 files.
WshShell.RegWrite
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\SourcePath",i386_path
WshShell.RegWrite
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\ServicePackSourcePath"
,i386_path
install_command = "sysocmgr /i:" + chr(34) +
WshShell.ExpandEnvironmentStrings("%windir%")+ "\inf\sysoc.inf" + chr(34) +
" "
install_command = install_command + "/u:" + chr(34) + i386_path + "\iis.txt"
+ chr(34) + " /q"
run_cmd install_command,true ' Configure IIS.
' Set registry keys back to what they were before.
WshShell.RegWrite
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\SourcePath",save1
WshShell.RegWrite
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\ServicePackSourcePath"
,save2
wscript.quit
' -----------------------------------------------------------------
' run_cmd: Run external command.
' -----------------------------------------------------------------
sub run_cmd (cmd,flag)
dim oShell
set oShell = Wscript.CreateObject("WScript.shell")
oShell.Run cmd,0,flag
end sub
I am wondering if anybody can give me some advice I am trying to create an
automated
procedure that will install IIS on Windows 2000 servers that have already
been installed.
IIS is not installed on them by default. Sorry for the length of this post -
only way of getting
the details across.
I have found the following article:
How to Add or Remove Windows Components with Sysocmgr.exe
http://support.microsoft.com/default.aspx?scid=kb;en-us;222444
Essentially you run a command like:
sysocmgr /i: %windir%\inf\sysoc.inf /u:c:\ocm.txt
I would like to add an option to this that tells where to source the I386
files from or put something
in either the iis.txt file or the sysoc.inf file. The problem is I get
promped for the windows CD unless
I screw around with the registry as specified below. Can it be done with
making a change to the files
I listed above or am I stuck with changing the registry key around.
Thanks in advance,
Ward.
*******************************************************
Here is what I did below a messy work around - (install_iis.vbs uses
iis.txt):
iis.txt file : ------------------------------------
[components]
iis_common = On
iis_doc = On
iis_ftp = Off
iis_htmla = On
iis_inetmgr = On
iis_nntp = Off
iis_nntp_docs = Off
iis_smtp = On
iis_smtp_docs = On
iis_www = On
-------------------------------------------------------------------
install_iis.vbs : --------------------------------------------------
' ------------------------------------------------------------------
' install_iis.vbs:
'
' Reference:
'
' How to Add or Remove Windows Components with Sysocmgr.exe
' http://support.microsoft.com/default.aspx?scid=kb;en-us;222444
'
' ------------------------------------------------------------------
dim save1 ' Save values of install locations
dim save2 ' Save values of install locations
dim install_command
dim i386_path ' Path to i386 files.
Set WshShell = WScript.CreateObject("WScript.Shell")
' Get the current registry key settings for I386 files - save for later.
save1 =
WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\Sourc
ePath")
save2 =
WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\Servi
cePackSourcePath")
i386_path = "\\SRV1\PC_SOURCE" ' Server location for I386 files.
' Reset location for I386 files.
WshShell.RegWrite
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\SourcePath",i386_path
WshShell.RegWrite
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\ServicePackSourcePath"
,i386_path
install_command = "sysocmgr /i:" + chr(34) +
WshShell.ExpandEnvironmentStrings("%windir%")+ "\inf\sysoc.inf" + chr(34) +
" "
install_command = install_command + "/u:" + chr(34) + i386_path + "\iis.txt"
+ chr(34) + " /q"
run_cmd install_command,true ' Configure IIS.
' Set registry keys back to what they were before.
WshShell.RegWrite
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\SourcePath",save1
WshShell.RegWrite
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\ServicePackSourcePath"
,save2
wscript.quit
' -----------------------------------------------------------------
' run_cmd: Run external command.
' -----------------------------------------------------------------
sub run_cmd (cmd,flag)
dim oShell
set oShell = Wscript.CreateObject("WScript.shell")
oShell.Run cmd,0,flag
end sub