China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-07 17:52
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Help] Use a script or batch file to remove File and Printer Sharing for Microsoft Networks View 1,316 Replies 9
Original Poster Posted 2007-04-22 23:44 ·  中国 广东 梅州 电信
中级用户
★★
Credits 421
Posts 111
Joined 2003-08-29 00:00
22-year member
UID 9153
Gender Male
Status Offline
By default, XP installs File and Printer Sharing for Microsoft Networks on the local connection. It has a big impact on security and startup speed for home users. I’m planning to use a batch file to deal with the registry issue, so I’d like to see whether anyone has experience with this.
Floor 2 Posted 2007-04-23 00:08 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\RemoteComputer\NameSpace
There’s a print under it, see if that’s it...
If you turn that off, it seems sharing won’t work, right?
If it’s for yourself, try uninstalling the protocol and see whether that works?
Floor 3 Posted 2007-04-23 03:35 ·  中国 广东 梅州 电信
中级用户
★★
Credits 421
Posts 111
Joined 2003-08-29 00:00
22-year member
UID 9153
Gender Male
Status Offline
That should be wrong.
I’m planning to write a batch file to control whether sharing is enabled. If the protocol is uninstalled, that won’t work.
Floor 4 Posted 2007-04-23 04:09 ·  中国 广东 广州 海珠区 电信
银牌会员
★★★
Credits 1,206
Posts 517
Joined 2007-03-25 01:18
19-year member
UID 82819
Gender Male
Status Offline
Just stop a few services...

net stop "the service you want to stop"

nc stop "the service you want to stop“

net start "the service you want to start“

Just a few lines.
知,不觉多。不知,乃求知
Floor 5 Posted 2007-04-24 00:09 ·  中国 甘肃 张掖 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
You might as well just toggle lanmanserver.
Floor 6 Posted 2007-04-24 03:38 ·  中国 广东 梅州 电信
中级用户
★★
Credits 421
Posts 111
Joined 2003-08-29 00:00
22-year member
UID 9153
Gender Male
Status Offline
It has a big impact on startup speed too, it will increase startup time by 67 seconds.
Floor 7 Posted 2007-04-24 04:08 ·  中国 浙江 杭州 电信
银牌会员
★★★
Credits 2,000
Posts 621
Joined 2007-01-01 00:00
19-year member
UID 75212
Gender Male
Status Offline
sc stop Spooler
sc config Spooler start= disabled

You can also turn off the server service

sc stop lanmanserver
sc config lanmanserver start= disabled
Floor 8 Posted 2007-04-29 12:43 ·  中国 安徽 芜湖 电信
高级用户
★★★
Credits 906
Posts 346
Joined 2006-07-10 09:58
20-year member
UID 58334
Gender Male
Status Offline
Originally posted by bjsh at 2007-4-24 04:08:
sc stop Spooler
sc config Spooler start= disabled

还可以把server服务关掉

sc stop lanmanserver
sc config lanmanserver start= disabled


I tested it myself, no!
Floor 9 Posted 2008-03-08 16:48 ·  中国 河南 郑州 联通
新手上路
Credits 14
Posts 8
Joined 2007-03-07 23:15
19-year member
UID 81017
Gender Male
Status Offline
I’ve also been looking for a solution to this problem for a long time, and there still hasn’t been any suitable solution, other than uninstalling it manually!
Floor 10 Posted 2008-03-08 18:06 ·  中国 河南 郑州 联通
新手上路
Credits 14
Posts 8
Joined 2007-03-07 23:15
19-year member
UID 81017
Gender Male
Status Offline
Found it already, but it still needs a bit more work!
Dim WshSHell
On Error Resume Next
Set WshSHell = WScript.CreateObject("WScript.Shell")
WshSHell.Run "control.exe ncpa.cpl"
WScript.Sleep 500
WshSHell.SendKeys "{DOWN}{UP}"
WScript.Sleep 500
WshSHell.SendKeys "%FR"
WScript.Sleep 500
WshSHell.SendKeys "{DOWN}{ }"
WScript.Sleep 500
WshSHell.SendKeys "%U"
WScript.Sleep 500
WshSHell.SendKeys "Y"
WScript.Sleep 10000
WshSHell.SendKeys "{TAB 5}{Enter}"
WScript.Sleep 3000
WshSHell.SendKeys "%FC"
Set WshSHell = Nothing
WScript.Quit

[ Last edited by fhcweb on 2008-3-8 at 06:22 PM ]
Forum Jump: