Re: Enable/Disable File and Printer Sharing

From: Jon (jgarlock_at_jhcohn.com)
Date: 02/27/04

  • Next message: Torgeir Bakken (MVP): "Re: Enable/Disable File and Printer Sharing"
    Date: Thu, 26 Feb 2004 17:38:48 -0800
    
    

    My concern is the 'transportability' of that .reg file.
    In previous testing, some folks at our org ran into BSOD
    issues following this path. I wasn't involved, so some
    of the steps between thier effors and what you describe
    below might be quite different. Still, I will certainly
    test this out again first thing tomorrow morning.

    I've never seen even any hint of a solution to do what
    I'm looking for via a script in any of my searches. I've
    been at it for quite some time now. Maybe it's just that
    I'm lacking search skills, but nothing directly related
    to the specific task before me. Does that mean it can't
    be done via a script, though?

    >-----Original Message-----
    >Jon wrote:
    >
    >> I am looking for a way to enable and disable file and
    >> printer sharing.
    >
    >I have never seen a script resolution for this...
    >
    >
    >> I can install and uninstall the service successfully.
    >> This doesn't help me. Uninstalling file and print also
    >> removes the server service.
    >>
    >> With file and print services installed but disabled,
    the
    >> server service is installed and running. I need this
    >> specific configuration to be successful.
    >
    >After you have removed F&PS e.g. with snetcfg.exe, you
    can
    >install the server service again, this works for me at
    least:
    >
    >Export the registry key
    >HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Lanm
    anServer
    >
    >from a machine where the server service is running as it
    should, to a registry
    >file with e.g. the name Lanmansvr.reg
    >
    >Then, on a computer with no server service installed,
    run the following two
    >command lines from e.g. a batch file (note that the
    rundll32 line will wrap in
    >the newsreader!):
    >
    >%SystemRoot%\system32\rundll32.exe
    setupapi.dll,InstallHinfSection Install.ndi
    >132 %SystemRoot%\Inf\netserv.inf
    >
    >regedit.exe /s "Lanmansvr.reg"
    >
    >
    >--
    >torgeir
    >Microsoft MVP Scripting and WMI, Porsgrunn Norway
    >Administration scripting examples and an ONLINE version
    of the 1328 page
    >Scripting Guide:
    http://www.microsoft.com/technet/scriptcenter
    >
    >
    >.
    >


  • Next message: Torgeir Bakken (MVP): "Re: Enable/Disable File and Printer Sharing"

    Relevant Pages

    • Re: Enable/Disable File and Printer Sharing
      ... Uninstalling file and print also ... > server service is installed and running. ... Export the registry key ... Microsoft MVP Scripting and WMI, ...
      (microsoft.public.win2000.cmdprompt.admin)
    • Re: Server Service
      ... > of my Win2K Pro and Win XP Pro workstations. ... > servers have their server service. ... already, uninstall it, reboot and install it again. ... Microsoft MVP Scripting and WMI, ...
      (microsoft.public.windowsxp.security_admin)
    • Re: Implications of Uninstalling Server Service?
      ... eliminate dependent services, and there are plenty that depend on the Server ... The third reason is attack surface. ... If I review a patch's files and I don't have those files on my system, I don't have to install ... I hope that ripping out the Server service doesn't appear on some ...
      (microsoft.public.windows.server.security)
    • Re: Implications of Uninstalling Server Service?
      ... to reverse effects of netserv.inf install (but doing so only partially, ... dependent services parts) ... Server service and File/Printer sharing. ... However, uninstalling it is untested, unsupported, and not ...
      (microsoft.public.windows.server.security)
    • Re: Server Services
      ... If you need to add the server service back again: ... and reboot, and then install F&PS (it will install ... Export the registry key ... Microsoft MVP Scripting and WMI, ...
      (microsoft.public.windowsxp.security_admin)