找回密码
 加入
搜索
查看: 2421|回复: 6

[AU3基础] 如何判断所创建的快捷方式是否存在,有则创建,没有则不创建

  [复制链接]
发表于 2011-1-22 19:47:11 | 显示全部楼层 |阅读模式
  如果使用FileCreateShortcut(@ProgramFilesDir & "\QQ\Bin\QQ.exe", @DesktopDir & "\腾讯QQ.lnk")这样创建快捷方式,不管目标\QQ\Bin\QQ.exe这个程序是否存在也创建,这样如果这个程序不存在会变成如图片中的那样,那可不可以判断这个程序是否存在,存在就创建,不存在就不创建呢?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2011-1-22 19:53:04 | 显示全部楼层
If FileExists(@ProgramFilesDir & "\Tencent\QQ\Bin\QQ.exe") Then FileCreateShortcut(@ProgramFilesDir & "\Tencent\QQ\Bin\QQ.exe", @DesktopDir & "\腾讯QQ.lnk")
发表于 2011-1-22 20:16:50 | 显示全部楼层
楼上正解:If FileExists(@ProgramFilesDir & "\Tencent\QQ\Bin\QQ.exe") Then FileCreateShortcut(@ProgramFilesDir & "\Tencent\QQ\Bin\QQ.exe", @DesktopDir & "\腾讯QQ.lnk")
,意思为:如果@ProgramFilesDir & "\Tencent\QQ\Bin\QQ.exe"存在,就执行【FileCreateShortcut(@ProgramFilesDir & "\Tencent\QQ\Bin\QQ.exe", @DesktopDir & "\腾讯QQ.lnk")】
发表于 2011-1-23 04:39:34 | 显示全部楼层
发表于 2011-1-23 07:43:14 | 显示全部楼层
楼上也是正解
发表于 2011-1-23 08:35:06 | 显示全部楼层
新版的QQ由于不可将安装后的程序复制到别的地方运行, 所以,你只需要在注册表中找到QQ的安装路径,然后按这个路径创建快捷方式就不会出现这个问题 。
发表于 2011-1-23 15:30:51 | 显示全部楼层
FileExists
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-21 14:38 , Processed in 0.089712 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表