中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-04 22:56
48,038 topics / 350,123 posts / today 0 new / 48,251 members
DOS批处理 & 脚本技术(批处理室) » Desktop icon automatic arrangement → check/uncheck → VBS version
Printable Version  3,326 / 19
Floor1 baomaboy Posted 2007-05-11 18:35
银牌会员 Posts 554 Credits 1,513
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 ]
Floor2 eech Posted 2007-05-11 21:17
高级用户 Posts 346 Credits 906
Floor3 ronin Posted 2007-05-11 22:38
中级用户 Posts 111 Credits 421
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 ]
Floor4 baomaboy Posted 2007-05-11 22:46
银牌会员 Posts 554 Credits 1,513
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?
Floor5 baomaboy Posted 2007-05-11 23:39
银牌会员 Posts 554 Credits 1,513
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
Floor6 eech Posted 2007-05-12 17:41
高级用户 Posts 346 Credits 906
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
Floor7 eech Posted 2007-05-12 17:44
高级用户 Posts 346 Credits 906
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.
Floor8 eech Posted 2007-05-12 17:47
高级用户 Posts 346 Credits 906
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.
Floor9 eech Posted 2007-05-12 23:04
高级用户 Posts 346 Credits 906
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
Floor10 baomaboy Posted 2007-05-12 23:33
银牌会员 Posts 554 Credits 1,513
To eech
Modified again, you can generate it with batch processing.
Floor11 baomaboy Posted 2007-05-12 23:40
银牌会员 Posts 554 Credits 1,513
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 ]
Floor12 baomaboy Posted 2007-05-13 00:04
银牌会员 Posts 554 Credits 1,513
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 ]
Floor13 lxmxn Posted 2007-05-13 03:40
版主 Posts 4,938 Credits 11,386
Originally posted by baomaboy at 2007-5-13 00:04:


Can you try running control Netcpl.cpl to open "Network Connections"? It doesn't open here.

Forget it, let's take a roundabout way.


You can directly run start ncpa.cpl to open "Network Connections", tested and passed on XP SP2.
Floor14 baomaboy Posted 2007-05-13 03:45
银牌会员 Posts 554 Credits 1,513
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.
Floor15 lxmxn Posted 2007-05-13 03:54
版主 Posts 4,938 Credits 11,386
Re baomaboy:

If you forget which cpl, you can type at the command line to view all cpl files in the system directory, which is convenient for finding.

ps Drifted away, heh heh.
1 2  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023