Board logo

标题: 创建刷新排列桌面图标工具 [打印本页]

作者: tvzml     时间: 2008-3-31 16:25    标题: 创建刷新排列桌面图标工具
工作原理:
1 每次修改配种文件ShortCut.ini里的Modified=0为Modified=1,这样达到每次强行覆盖目的。
2 通过转换日期为 2008XXXX,删除ShortCut.exe产生的LOG文件和目录。
3 利用VBS检测当前工作目录是否为桌面,结果为非执行CleanDesktop.SCF切换到桌面。
4 利用VBS的SendKeys模拟一次F5刷新,再模拟鼠标右键I到 T按类型排列,完成桌面图标整理。


Shortcut.bat 内容
@echo off & SetLocal EnableDelayedExpansion
set ShortCut=.\ShortCut\ShortCut.ini
for /f "tokens=2,1" %%a in (%ShortCut%) do (
set /a flag+=1
if !flag! equ 3 (>>n echo Modified=1) else (>>n echo %%a %%b)
)
move /y "n" "%ShortCut%" 2>NUL
Shortcut.exe
set n=%date:~0,4%
set y=%date:~5,2%
set r=%date:~8,2%
set logname=%n%%y%%r%
echo shortcut%logname%.log
echo shortcut20080331.log
del /q ".\Log\shortcut%logname%.log"
if not exist ".\Log\*.log" rd /q ".\Log"
Shortcut.vbs

Shortcut.vbs 内容
On Error Resume Next
Set WshSHell = WScript.CreateObject("WScript.Shell")
if (WshShell.CurrentDirectory = WshShell.SpecialFolders("Desktop")) = "False" then
WshSHell.Run("CleanDesktop.SCF")
end if
WScript.Sleep 500
WshSHell.SendKeys "{F5}+{F10}e"
WshSHell.SendKeys "+{F10}IT"
Set WshSHell = Nothing
Set FSO = Nothing
WScript.Quit

CleanDesktop.scf 内容

Command=2
IconFile=explorer.exe,3

Command=ToggleDesktop

ShortCut.ini 内容

CRC=-1901140355
Modified=0

QQ=10130.ico;"E:\NBMSClient\BarClientView.exe" -Package
个人磁盘=个人磁盘.ico;"E:\NBMSClient\BarClientView.exe" -UDisk
网络游戏=网络游戏.ico;"E:\nbmsclient\BarClientView.exe" -Class

#桌面图标名称=图标文件名称;"执行文件路径" -参数

下载地址
http://upload.cn-dos.net/img/179.rar