本帖最后由 Hello123World 于 2011-8-2 15:18 编辑
vbs调用bat,bat修改墙纸。
vbs:- CreateObject("Wscript.Shell").run "cmd /c ""E:\My Batch\开机切换墙纸.bat""",vbhide
复制代码 batch:- ::需要外部命令,wallpaperchanger.exe。
- @echo off
- for /f "delims=" %%i in (c:\wallpaper.txt) do wallpaperchanger.exe "%%i" & echo %%i>>c:\wallpaper.txt & goto hello
- :hello
- ::开机则更换墙纸
- (for /f "skip=1 delims=" %%i in (c:\wallpaper.txt) do echo %%i)>c:\wallpaper1.txt
- del c:\wallpaper.txt
- ren c:\wallpaper1.txt wallpaper.txt
- ::更新墙纸列表文本
- ::这里不能将上面两句简写为move /y ,因为move /y是合并替换。
复制代码
|