that worked like a charm:
' Create explorer command file to toggle desktop window
Set objFSO = CreateObject("Scripting.FileSystemObject")
strFile= objFSO.BuildPath(objFSO.GetSpecialFolder(2), objFSO.GetTempName &".scf")
With objFSO.CreateTextFile(strFile, True)
.WriteLine("[Shell]")
.WriteLine("Command=2")
.WriteLine("[Taskbar]")
.WriteLine("Command=ToggleDesktop")
.Close
End With
' Toggle desktop and send F5 to refresh desktop
With CreateObject("WScript.Shell")
.Run """" & strFile & """"
WScript.Sleep 100
.Sendkeys "{F5}"
End With
' Delete command file
objFSO.DeleteFile strFile
newbie here. How to refresh desktop without minimizing other windows to the taskbar?
ReplyDeletedo they get minimized after you execute the code above?
ReplyDelete