如何用批处理为一批应用程序创建桌面快捷方式

来源:百度知道 编辑:UC知道 时间:2024/09/28 14:23:44
打个比方说:D盘下有两个目录GAME 和SOFT,这两个里N个游戏和软件,想用批处理为这里的文件创建快捷方式到桌面~命令是什么?
高手请把批处理代码直接回复~
谢谢帮助菜鸟~
HOHO~~
小弟只有30分,全送你了~
还有"最好是用批处理,可以随意为任何分区下任何目录下的所有EXE文件创建桌面快捷方式
如果没有办法~那么只执行处理D盘也可以~

@echo off
rem 只处理D盘:
for /f "delims=" %%i in ('dir /a/s/b d:\*.exe') do call :createlnk "%%~nxi" "%%i" "%%~dpi"
goto :eof
:createlnk
>c.vbs echo Set WshShell = WScript.CreateObject("WScript.Shell")
>>c.vbs echo strDesktop = WshShell.SpecialFolders("Desktop")
>>c.vbs echo set oShellLink = WshShell.CreateShortcut(strDesktop^&"\"^&%1^&^"^.lnk^")
>>c.vbs echo oShellLink.TargetPath = %2
>>c.vbs echo oShellLink.WindowStyle =1
>>c.vbs echo oShellLink.IconLocation =%2^&",0"
>>c.vbs echo oShellLink.WorkingDirectory = %3
>>c.vbs echo oShellLink.Save
cscript //nologo c.vbs & del c.vbs

全选 复制 点右键,粘贴快捷方式