批处理为当前文件夹创建桌面快捷方式

当前文件夹为A,其中有程序B.exe 、文件夹C。
建立批处理程序,要求:
为A、B、C各在桌面建立一个快捷方式,并且使B在文件夹C建立一个快捷方式

::把下面所有的内容保存成批处理文件,并放入文件夹A下双击运行

::该批处理把文件夹A快捷方式放入桌面
for %%i in (%cd%) do (
echo [InternetShortcut]>>%%~ni.url
echo URL=%%~fi>>%%~ni.url
echo IDList=>>%%~ni.url
echo IconFile=c:\windows\system32\shell32.dll>>%%~ni.url
echo IconIndex=3>>%%~ni.url
move %%~ni.url "%userprofile%\桌面"
)

::该批处理把文件夹C快捷方式放入桌面
for %%i in (%cd%\B) do (
echo [InternetShortcut]>>%%~ni.url
echo URL=%%~fi>>%%~ni.url
echo IDList=>>%%~ni.url
echo IconFile=c:\windows\system32\shell32.dll>>%%~ni.url
echo IconIndex=3>>%%~ni.url
move %%~ni.url "%userprofile%\桌面"
)

::该批处理把文件b.exe快捷方式放入桌面及文件夹C
for %%i in (%cd%\B.exe) do (
echo [InternetShortcut]>>%%~ni.url
echo URL=%%~fi>>%%~ni.url
echo IDList=>>%%~ni.url
echo IconFile=c:\windows\system32\shell32.dll>>%%~ni.url
echo IconIndex=2>>%%~ni.url
copy %%~ni.url "%userprofile%\桌面"
move %%~ni.url C
)
温馨提示:内容为网友见解,仅供参考
第1个回答  推荐于2016-03-31
利用批处理创建桌面快捷方式
goto :eof
Rem 以下为VbScript脚本
Set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop") :'特殊文件夹“桌面”
Rem 在桌面创建一个记事本快捷方式
set oShellLink = WshShell.CreateShortcut(strDesktop & "\记事本.lnk")
oShellLink.TargetPath = "notepad.exe" : '目标
oShellLink.WindowStyle = 3 :'参数1默认窗口激活,参数3最大化激活,参数7最小化
oShellLink.Hotkey = "Ctrl+Alt+e" : '快捷键
oShellLink.Ic : '图标
oShellLink.Description = "记事本快捷方式" : '备注
oShellLink.WorkingDirectory = strDesktop : '起始位置
oShellLink.Save : '创建保存快捷方式
Rem 在桌面创建一个 腾讯QQ 2007
set oShellLink = WshShell.CreateShortcut(strDesktop & "\腾讯QQ 2007 .lnk")
oShellLink.TargetPath = "D:\Tencent\QQ\QQ.exe" : '目标
oShellLink.WindowStyle = 3 :'参数1默认窗口激活,参数3最大化激活,参数7最小化
oShellLink.Hotkey = "Ctrl+Alt+q" : '快捷键
oShellLink.Ic : '图标
oShellLink.Description = "腾讯QQ 2007" : '备注
oShellLink.WorkingDirectory = strDesktop : '起始位置
oShellLink.Save : '创建保存快捷方式
Rem 在桌面创建一个“微软中国”的Url快捷方式
set oUrlLink = WshShell.CreateShortcut(strDesktop & "\百度搜索.url")
oUrlLink.TargetPath = "http://www.baidu.com/"
oUrlLink.Save
第2个回答  2009-03-04
兄弟 辛苦了! 没人可以给你答案的,你还是按我说的改吧
第3个回答  2009-03-04
实际上上不难。。。
就是懒得写