|
baomaboy
银牌会员
    
积分 1513
发帖 554
注册 2005-12-30
状态 离线
|
『楼 主』:
桌面图标自动排列→勾选/取消勾选→VBS版
使用 LLM 解释/回答一下
应eech要求做的,跟踪注册表不成功,只有转用快捷键方式了。
晕,eech居然爱好装完系统后精简掉(删)"显示桌面.SCF",^_^
以前写过一个管理快捷方式的小程序正好附带了修复显示桌面.SCF的功能:
新建快捷方式到任意处→VBS版
如果你误删除了快速启动栏的“显示桌面”,发送到中的“我的文档”、“邮件接收者”、“桌面快捷方式”,用此程序都可以修复。
下面改为自动生成.SCF
'''DisktopIcon_AutoArrange.VBS by baomaboy
Dim WshSHell,FSO
On Error Resume Next
Set WshSHell = WScript.CreateObject("WScript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
Set OF = FSO.OpenTextFile(FSO.BuildPath(FSO.GetSpecialFolder(1),"ShowDisktop.SCF"),2,True)
OF.Write(""&vbcrlf&"Command=2"&vbcrlf&"IconFile=explorer.exe,3"&vbcrlf&""&vbcrlf&"command=ToggleDesktop")
OF.Close
if (WshShell.CurrentDirectory = WshShell.SpecialFolders("Desktop")) = "False" then
WshSHell.Run("ShowDisktop.SCF")
end if
WScript.Sleep 500
WshSHell.SendKeys "{F5}+{F10}e"
WshSHell.SendKeys "+{F10}IA"
Set WshSHell = Nothing
Set FSO = Nothing
WScript.Quit
Last edited by baomaboy on 2008-3-24 at 10:19 PM ]
Done as requested by eech, but tracking the registry didn't work, so I had to switch to using the shortcut key method.
Oh, eech actually likes to delete ("remove") "Show Desktop.SCF" after installing the system, ^_^
I once wrote a small program for managing shortcuts that happens to have a function to repair Show Desktop.SCF:
Create Shortcut Anywhere→VBS Version
If you mistakenly deleted "Show Desktop" in the Quick Launch bar, or "My Documents", "Mail Recipient", "Desktop Shortcut" in Send To, this program can repair them.
Now change it to automatically generate.SCF
'''DisktopIcon_AutoArrange.VBS by baomaboy
Dim WshSHell,FSO
On Error Resume Next
Set WshSHell = WScript.CreateObject("WScript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
Set OF = FSO.OpenTextFile(FSO.BuildPath(FSO.GetSpecialFolder(1),"ShowDisktop.SCF"),2,True)
OF.Write(""&vbcrlf&"Command=2"&vbcrlf&"IconFile=explorer.exe,3"&vbcrlf&""&vbcrlf&"command=ToggleDesktop")
OF.Close
if (WshShell.CurrentDirectory = WshShell.SpecialFolders("Desktop")) = "False" then
WshSHell.Run("ShowDisktop.SCF")
end if
WScript.Sleep 500
WshSHell.SendKeys "{F5}+{F10}e"
WshSHell.SendKeys "+{F10}IA"
Set WshSHell = Nothing
Set FSO = Nothing
WScript.Quit
Last edited by baomaboy on 2008-3-24 at 10:19 PM ]
|

好多菩提树,好多明镜台。本来好多物,好多的尘埃。 |
|
2007-5-11 18:35 |
|
|
eech
高级用户
   
积分 906
发帖 346
注册 2006-7-10
状态 离线
|
|
2007-5-11 21:17 |
|
|
ronin
中级用户
  
积分 421
发帖 111
注册 2003-8-29
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
我用了,完全正常,能不能用VBS勾选/取消勾选本地连接的那个 Microsoft网络的文件和打印机共享的那个选项
Last edited by ronin on 2007-5-11 at 10:42 PM ]
I used it, it's completely normal. Can I use VBS to check/uncheck the "Microsoft Network File and Printer Sharing" option in the Local Area Connection?
Last edited by ronin on 2007-5-11 at 10:42 PM ]
|
|
2007-5-11 22:38 |
|
|
baomaboy
银牌会员
    
积分 1513
发帖 554
注册 2005-12-30
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
我这里运行正常啊,难道你的scf文件和rar关联了,你看没看被压缩的是什么?文件夹还是那个scf文件?
It runs normally here. Could it be that your scf file is associated with rar? Did you check what's being compressed? Is it a folder or that scf file?
|

好多菩提树,好多明镜台。本来好多物,好多的尘埃。 |
|
2007-5-11 22:46 |
|
|
baomaboy
银牌会员
    
积分 1513
发帖 554
注册 2005-12-30
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
Originally posted by ronin at 2007-5-11 22:38:
我用了,完全正常,能不能用VBS勾选/取消勾选本地连接的那个 Microsoft网络的文件和打印机共享的那个选项
Last edited by ronin on 2007-5-11 at 10:42 PM ]
理论上可以实现
Originally posted by ronin at 2007-5-11 22:38:
I used it, it works completely. Can VBS be used to check/uncheck the option "Microsoft Network File and Printer Sharing" for the Local Area Connection?
Last edited by ronin on 2007-5-11 at 10:42 PM ]
It is theoretically achievable
|

好多菩提树,好多明镜台。本来好多物,好多的尘埃。 |
|
2007-5-11 23:39 |
|
|
eech
高级用户
   
积分 906
发帖 346
注册 2006-7-10
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
Originally posted by ronin at 2007-5-11 22:38:
我用了,完全正常,能不能用VBS勾选/取消勾选本地连接的那个 Microsoft网络的文件和打印机共享的那个选项
Last edited by ronin on 2007-5-11 at 10:42 PM ]
老兄,想我所想,说出了我的心声,你求baomaboy 兄,再写一个啊,支持你
Originally posted by ronin at 2007-5-11 22:38:
I used it, it works perfectly. Can I use VBS to check/uncheck the option of "Microsoft Network File and Printer Sharing" in the Local Area Connection?
Last edited by ronin on 2007-5-11 at 10:42 PM ]
Dude, you're thinking what I'm thinking. You should ask baomaboy to write another one. Support you
|
|
2007-5-12 17:41 |
|
|
eech
高级用户
   
积分 906
发帖 346
注册 2006-7-10
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
这个脚本无论放在哪里运行,结果弹出一个压缩脚本自身窗口,我卸载RAR再试试
This script pops up a window that compresses the script itself no matter where it is run. I'll try uninstalling RAR and then see.
|
|
2007-5-12 17:44 |
|
|
eech
高级用户
   
积分 906
发帖 346
注册 2006-7-10
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
现在变成了,这个脚本的右键窗口,不知是不是系统问题,我重装一次,再试试
Now it has become, the right-click window of this script. I don't know if it's a system problem. I'll reinstall it and try again.
|
|
2007-5-12 17:47 |
|
|
eech
高级用户
   
积分 906
发帖 346
注册 2006-7-10
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
一个建议,能否在脚本加上{WIN+d},这样脚本在任意目录下都可以生效了,
现在的脚本,我放在桌面上运行才行
A suggestion, can you add {WIN+d} in the script, so that the script can take effect in any directory, currently the script only works when placed on the desktop
|
|
2007-5-12 23:04 |
|
|
baomaboy
银牌会员
    
积分 1513
发帖 554
注册 2005-12-30
状态 离线
|
|
2007-5-12 23:33 |
|
|
baomaboy
银牌会员
    
积分 1513
发帖 554
注册 2005-12-30
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
Originally posted by eech at 2007-5-12 23:04:
一个建议,能否在脚本加上{WIN+d},这样脚本在任意目录下都可以生效了,
现在的脚本,我放在桌面上运行才行
本来设计的就不只是在桌面运行,如果只能在桌面运行还用这么多句吗
WshSHell.Run(""""&ShowDisktop&"""")就是在代替 win+d
如果win键我可以send的话,还用的着WshSHell.Run(""""&ShowDisktop&"""")原帖不是说明了吗,至今未知win键如何send。当然不能是Ctrl+Esc,是Win组合键。
Last edited by baomaboy on 2007-5-12 at 11:59 PM ]
Originally posted by eech at 2007-5-12 23:04:
A suggestion, can you add {WIN+d} in the script, so that the script can take effect in any directory.
Now the script only works when placed on the desktop
It was originally designed to not only run on the desktop. Why use so many lines if it can only run on the desktop?
WshSHell.Run(""""&ShowDisktop&"""") is replacing win+d.
If I could send the win key, I wouldn't use WshSHell.Run(""""&ShowDisktop&""""). The original post explained it. Up to now, I don't know how to send the win key. It can't be Ctrl+Esc, it's the Win combination key.
Last edited by baomaboy on 2007-5-12 at 11:59 PM ]
|

好多菩提树,好多明镜台。本来好多物,好多的尘埃。 |
|
2007-5-12 23:40 |
|
|
baomaboy
银牌会员
    
积分 1513
发帖 554
注册 2005-12-30
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
Originally posted by ronin at 2007-5-11 22:38:
我用了,完全正常,能不能用VBS勾选/取消勾选本地连接的那个 Microsoft网络的文件和打印机共享的那个选项
Last edited by ronin on 2007-5-11 at 10:42 PM ]
你可以试一下control Netcpl.cpl运行可以打开“网络连接吗” 我这里打不开
算了还是曲折一点吧
Microsoft 网络的文件和打印机共享→勾选/取消勾选→VBS版
Last edited by baomaboy on 2007-5-13 at 01:12 AM ]
Originally posted by ronin at 2007-5-11 22:38:
I used it, it works completely. Can VBS be used to check/uncheck the "Microsoft Network File and Printer Sharing" option in the local connection?
Last edited by ronin on 2007-5-11 at 10:42 PM ]
You can try running control Netcpl.cpl to open "Network Connections", but it doesn't open here.
Forget it, let's take a roundabout way.
Microsoft Network File and Printer Sharing → Check/Uncheck → VBS Version
Last edited by baomaboy on 2007-5-13 at 01:12 AM ]
|

好多菩提树,好多明镜台。本来好多物,好多的尘埃。 |
|
2007-5-13 00:04 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
|
2007-5-13 03:40 |
|
|
baomaboy
银牌会员
    
积分 1513
发帖 554
注册 2005-12-30
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
Originally posted by lxmxn at 2007-5-13 03:40:
打开“网络连接”可以直接运行 start ncpa.cpl ,xp sp2测试通过。
谢谢兄 是我错记为Netcpl.cpl了。这样可以去处几个sendkeys值了减少出错的机率。
Originally posted by lxmxn at 2007-5-13 03:40:
You can directly run start ncpa.cpl to open "Network Connections", tested and passed on XP SP2.
Thank you brother, I mistakenly remembered it as Netcpl.cpl. In this way, several sendkeys values can be removed to reduce the probability of errors.
|

好多菩提树,好多明镜台。本来好多物,好多的尘埃。 |
|
2007-5-13 03:45 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
Re baomaboy:
如果忘记了哪个cpl,可以在命令行敲入 dir /b/a-d %SystemRoot%\system32\*.cpl
来查看系统目录中所有的cpl文件,这样方面查找些。
ps 扯远了,呵呵。
Re baomaboy:
If you forget which cpl, you can type dir /b/a-d %SystemRoot%\system32\*.cpl
at the command line to view all cpl files in the system directory, which is convenient for finding.
ps Drifted away, heh heh.
|
|
2007-5-13 03:54 |
|