Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Turning On "File and Print Sharing" Remotely

104 views
Skip to first unread message

RickA

unread,
Feb 12, 2004, 2:52:41 PM2/12/04
to
Is there a way to remotely Turn On the "File and Printer
Sharing" service on specific machines within my
enterprise. Using a Login script is not an option. Any
help would be appreciated.

Thanks.

Dan Lepine

unread,
Feb 12, 2004, 3:58:57 PM2/12/04
to
If you have the snetcfg.exe utility, you could write a
loop in batch with the following syntax...

snetcfg -c s -i MS_Server

>.
>

Torgeir Bakken (MVP)

unread,
Feb 12, 2004, 4:24:06 PM2/12/04
to
Dan Lepine wrote:

> RickA wrote:
> >Is there a way to remotely Turn On the "File and Printer
> >Sharing" service on specific machines within my
> >enterprise. Using a Login script is not an option. Any
> >help would be appreciated.
>

> If you have the snetcfg.exe utility, you could write a
> loop in batch with the following syntax...
>
> snetcfg -c s -i MS_Server

Hi

This will not enable "File and Printer Sharing" if F&PS is already installed
but the checkbox in the GUI is not checked. In that case, you will need to
uninstall F&PS first (with snetcfg.exe), and then install it again.

More here (and download link to snetcfg.exe as well):

http://groups.google.com/groups?selm=3FDCF89F.9FB2A197%40hydro.com


--
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


Torgeir Bakken (MVP)

unread,
Feb 12, 2004, 4:30:49 PM2/12/04
to
RickA wrote:

Hi

You might get something to work with snetcfg.exe...

If you have Active Directory:

You could do it in a computer startup script (with a GPO) that runs as
part of the boot up process (before the user logs in). It runs under the
system context and has admin rights.

To be able to access files (e.g. snetcfg.exe) over the network from the
computer startup script, you could put the file(s) on a network share and
grant read access for the AD group "Domain Computers" to the share.

Alternatively, you could map a drive on the fly, like this:

sDomainUser = "arp.corp\computer_fix"
sPswd = "something"

Set oNetwork = CreateObject("Wscript.Network")

oNetwork.MapNetworkDrive _
"Y:", "\\server\netlogon\some folder",, sDomainUser, sPswd

If you don't have AD, some command line utilities that might work for you:

Take a look at PsExec.exe in the free PsTools suite, found at
http://www.sysinternals.com

PsExec can even automatically copy a file over to the remote computer
before it starts it.


Another freeware program with similar merits to PsExec is Beyondexec.
http://www.beyondlogic.org/consulting/remoteprocess/BeyondExec.htm

Beyondexec also have multiple computer functionality.


More about snetcfg.exe and F&PS here:

Sam Salhi [MSFT]

unread,
Feb 12, 2004, 7:10:17 PM2/12/04
to
use SC.EXE
Built in XP and Win2k3 Server, and in older Resource kits


--
===========================================================
This posting is provided "AS IS" with no warranties and confers no rights
===========================================================


"RickA" <anon...@discussions.microsoft.com> wrote in message
news:f46801c3f1a1$c66d33e0$a001...@phx.gbl...

Torgeir Bakken (MVP)

unread,
Feb 12, 2004, 7:24:39 PM2/12/04
to
"Sam Salhi [MSFT]" wrote:

> RickA wrote:
> > Is there a way to remotely Turn On the "File and Printer
> > Sharing" service on specific machines within my
> > enterprise. Using a Login script is not an option. Any
> > help would be appreciated.
>

> use SC.EXE
> Built in XP and Win2k3 Server, and in older Resource kits

Hi

If the File and Print Sharing is installed on the machine, but is not
checked under MyNetworkPlaces->LocalAreaConnection->File and Print
Sharing for Microsoft Networks, how exactly can you use SC.EXE to get
that check box ticked?

Sam Salhi [MSFT]

unread,
Feb 12, 2004, 7:58:55 PM2/12/04
to
My bad,
I didn't pay attention that this is "File and Print sharing" and not the
Server Service
I will investigate and let you know


--
===========================================================
This posting is provided "AS IS" with no warranties and confers no rights
===========================================================


"Torgeir Bakken (MVP)" <Torgeir.B...@hydro.com> wrote in message
news:402C1947...@hydro.com...

0 new messages