猿问

自己写了一个实现动态桌面的vbs文件,但是运行使报错下面是详细信息

on error resume next
Set fso = CreateObject("Scripting.FileSystemObject")
pt="C:\Users\mr.j\Pictures\gif" '存放图片的文件夹
setbmpfol=fso.getfolder(pt)
for each files in bmpfol.files
iffso.GetExtensionName(files.path)="bmp" Then bmppt = bmppt&files.path&"|"
next
bmppt = left(bmppt,len(bmppt) - 1)
ifbmppt = ""then
mesfbox"您选择的目录中不含有BMP图片,程序将退出!",64
wscript.quit
end if
bmpar = split(bmppt,"|")
Set ws = CreateObject("WScript.Shell")
for i = 0 to ubound(bmpar)
pt = bmpar(i)
ws.RegWrite"HKEY_CURRENT_USER\ControlPanel\Desktop\Wallpaper","0","REG_SZ"
ws.RegWrite"HKEY_CURRENT_USER\ControlPanel\Desktop\WallpaperStyle","2","REG_SZ"
ws.RegWrite"HKEY_CURRENT_USER\SoftWare\MicroSoft\Windos\CurrentVersion\Explorer\Advanced\ListviewShadow","1","REG_DWORD"
ws.run"gpupdata/force",0
ws.run"RunDll32.exe USER32.DLL,UpdatePerUserSystemParaMeters"
wscript.sleep 100 '更换壁纸的时间
if i = ubound(bmper) then i = -1
next


落子鸢
浏览 2326回答 1
1回答

qq_尚晨_03700611

第六行,if和fso变量之间没有空格,你的if不能识别为关键字
随时随地看视频慕课网APP
我要回答