Sub refresh()
' Desktop.vbs - to Refresh Icons on the Desktop
' Example VBScript with Sleep and err.number
' Author Jeremy H. & Guy Thomas [url=http://computerperformance.co.uk/]Windows Server 2012, Exchange advice. Help solving computer problems. PowerShell VBScript[/url]
' Version 2.3 - October 2005
' -------------------------------------------------------------'
Dim WSHShell, strDesktop
Set WSHShell = WScript.CreateObject("WScript.Shell")
strDesktop = WSHShell.SpecialFolders("Desktop")
WSHShell.AppActivate strDesktop
WScript.Sleep 500
WSHShell.SendKeys "{F5}"
If Err.Number = 0 Then
MsgBox "Desktop Refreshed "
Else:
MsgBox "Error " & Err.Number
Err.Number = 0
End If
End Sub