Archived from groups: microsoft.public.win2000.setup (
More info?)
"Tim Jones" <tall_man_tim_no_spam_today@hotmail.com> wrote in message
news:%23e4Knf15EHA.3596@TK2MSFTNGP12.phx.gbl...
> Hello,
>
> Does anyone know an easy way to script pushing the file and print service
> onto Windows 2000 Professional?
>
> This is needed for a migration project to run smoothly, so any input would
> be much appreciated!
>
In case anyone googling also needs an answer I managed to carry this out
with a freeware tool available from:
http://www.cadjobs.net/sms/novell.htm
This allows the adding and removing of network services.
The tools is also good for the removal of Client Services for Netware, IPX,
SPX and others.
To add the service:
%LOGONSERVER%\\NETLOGON\snetcfg.exe -v -l " %windir%\Inf\NETSERV.INF -c s -i
MS_Server
and to remove:
%LOGONSERVER%\NETLOGON\snetcfg.exe -v -u MS_Server
The additional issue is that this also required admin access to carry out,
so required RUN AS.
It would be a serious security breach to put the domain admin account into a
batch file, so use AutoIt (http://www.autoitscript.com/), a scripting engine
that allows the script to be wrapped up in an encrypted executeable.
Script as follows:
Dim $UserName, $DomainName, $Password, $RunProgram, $RunPath, $windir
$UserName = "administrator"
$DomainName = "2k3"
$Password = "password"
$windir = envget ("WINDIR")
$logonpath = envget ("LOGONSERVER")
;The line below is to add the service
$RunProgram = $logonpath & "\NETLOGON\snetcfg.exe -v -l " & $windir &
"\Inf\NETSERV.INF -c s -i MS_Server "
;The line below is to remove the service
;$RunProgram = $logonpath & "\NETLOGON\snetcfg.exe -v -u MS_Server "
$RunPath = "c:\"
RunAsSet ( $UserName, $DomainName, $Password )
$val = RunWait($RunProgram, $RunPath, @SW_MINIMIZE)
Hope someone finds this of use!
Tim