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-04 23:53
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Desktop icon automatic arrangement → check/uncheck → VBS version View 3,327 Replies 19
Original Poster Posted 2007-05-11 18:35 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
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 ]
Floor 2 Posted 2007-05-11 21:17 ·  中国 安徽 芜湖 电信
高级用户
★★★
Credits 906
Posts 346
Joined 2006-07-10 09:58
20-year member
UID 58334
Gender Male
Status Offline
Floor 3 Posted 2007-05-11 22:38 ·  中国 广东 梅州 电信
中级用户
★★
Credits 421
Posts 111
Joined 2003-08-29 00:00
22-year member
UID 9153
Gender Male
Status Offline
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 ]
Floor 4 Posted 2007-05-11 22:46 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
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?
Floor 5 Posted 2007-05-11 23:39 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
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
Floor 6 Posted 2007-05-12 17:41 ·  中国 安徽 芜湖 电信
高级用户
★★★
Credits 906
Posts 346
Joined 2006-07-10 09:58
20-year member
UID 58334
Gender Male
Status Offline
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
Floor 7 Posted 2007-05-12 17:44 ·  中国 安徽 芜湖 电信
高级用户
★★★
Credits 906
Posts 346
Joined 2006-07-10 09:58
20-year member
UID 58334
Gender Male
Status Offline
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.
Floor 8 Posted 2007-05-12 17:47 ·  中国 安徽 芜湖 电信
高级用户
★★★
Credits 906
Posts 346
Joined 2006-07-10 09:58
20-year member
UID 58334
Gender Male
Status Offline
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.
Floor 9 Posted 2007-05-12 23:04 ·  中国 安徽 芜湖 电信
高级用户
★★★
Credits 906
Posts 346
Joined 2006-07-10 09:58
20-year member
UID 58334
Gender Male
Status Offline
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
Floor 10 Posted 2007-05-12 23:33 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
To eech
Modified again, you can generate it with batch processing.
Floor 11 Posted 2007-05-12 23:40 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
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 ]
Floor 12 Posted 2007-05-13 00:04 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
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 ]
Floor 13 Posted 2007-05-13 03:40 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline
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.
Floor 14 Posted 2007-05-13 03:45 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
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.
Floor 15 Posted 2007-05-13 03:54 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline
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.
Forum Jump: