Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vbscript 循环.ico文件的vbs脚本_Vbscript_Slideshow_Ico - Fatal编程技术网

Vbscript 循环.ico文件的vbs脚本

Vbscript 循环.ico文件的vbs脚本,vbscript,slideshow,ico,Vbscript,Slideshow,Ico,我想弄明白的是,如何让vbs脚本在桌面上循环使用不同的.ico文件。几乎就像不同.ico文件的幻灯片放映一样。可能吗 这是我到目前为止所拥有的,但它没有循环.ico文件 set WshShell = WScript.CreateObject("WScript.Shell") strDesktop = WshShell.SpecialFolders("Desktop") set oShellLink = WshShell.CreateShortcut(strDeskt

我想弄明白的是,如何让vbs脚本在桌面上循环使用不同的.ico文件。几乎就像不同.ico文件的幻灯片放映一样。可能吗

这是我到目前为止所拥有的,但它没有循环.ico文件

     set WshShell = WScript.CreateObject("WScript.Shell")
     strDesktop = WshShell.SpecialFolders("Desktop")
     set oShellLink = WshShell.CreateShortcut(strDesktop & "\Movies Folder.lnk")
     oShellLink.TargetPath = "J:\Movies"
     oShellLink.IconLocation = "C:\MoviesShortcut\Movies.Ico"
     wscript.sleep 500
     oShellLink.IconLocation = "C:\MoviesShortcut\tv1.Ico"
     oShellLink.Description = "movies"
     oShellLink.WorkingDirectory = strDesktop

如果示例代码正常工作,并且确实在5秒钟后更改了图标,那么我认为您需要添加一个“opendo循环”和一个“For”来运行文件夹中的所有文件,例如:

oShellLink.TargetPath = "J:\Movies"

Do
    For Each File in OShellLink.TargetPath
        oShellLink.IconLocation = File.Path
        wscript.sleep 500
    Next
Loop

我的vbs有点生锈,但希望这能为您指明正确的方向。

当您循环浏览它们时,希望它们显示在哪里?当你说幻灯片放映时,你的意思是想让它们全屏显示吗?不只是想让快捷方式循环的图标通过不同的.ico,例如我有movies.ico,现在我想让图标在5秒内变为tv1.ico等等