找回密码
 加入
搜索
查看: 1345|回复: 1

[AU3基础] [已解决]Win_7自动更换壁纸,能用但不明白原理.

[复制链接]
发表于 2016-12-9 20:09:44 | 显示全部楼层 |阅读模式
本帖最后由 q410225 于 2016-12-12 19:12 编辑

原作是VBS写的,然后我改成了AU3的格式,竟然用起来一点问题都没有,自己试着分析了一些,实在搞不明白,有大侠能粗浅的给解释以下不
#cs ____________________________________

NUM = "" '壁纸图片路径

Set sh = CreateObject("Shell.Application")

Set FSO = CreateObject("Scripting.FileSystemObject")

Set f = FSO.GetFile(NUM)

Set vs = sh.NameSpace(f.ParentFolder.Path).ParseName(f.Name).Verbs

For Each v In vs

If v.Name = "设置为桌面背景(&B)" Then v.DoIt

Next

WScript.Sleep 5000

#ce _______________脚本开始_________________

Local $num = ""
Local $sh = ObjCreate("Shell.Application")
Local $fso = ObjCreate("Scripting.FileSystemObject")
Local $f = $fso.GetFile($num)

;~ fFolder = Shell.NameSpace(VDIR)  
;~ PPID = Folder.ParseName(BNAME)//Creates and returns a FolderItem object that represents a specified item.
;~ vVerb = FolderItem.Verbs()//返回 FolderItemVerbs 对象. This object is the collection of verbs that can be executed on the item.
;FolderItemVerb.DoIt()     // Executes a verb on the FolderItem associated with the verb.



Local $vs = $sh.NameSpace($f.ParentFolder.Path).ParseName($f.Name).Verbs
Local $v
For $v In $vs


If $v.Name = "设置为桌面背景(&B)" Then $v.DOIt
Next
Sleep(5000)
发表于 2016-12-12 11:21:25 | 显示全部楼层
Local $vs = $sh.NameSpace($f.ParentFolder.Path).ParseName($f.Name).Verbs
Local $v
For $v In $vs


If $v.Name = "设置为桌面背景(&B)" Then $v.DOIt
Next



关键在这里。。。If $v.Name = "设置为桌面背景(&B)" Then $v.DOIt
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-11-17 04:49 , Processed in 0.074402 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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