Greetings,
I'm looking for some guidance. I need to be able to refresh my desktop (WinXP & Win7) at times using Winbatch. With a mouse, you simply right-click on the desktop and choose "Refresh". How can I do this using Winbatch?
I found this in the Winbatch tech support database:
http://tinyurl.com/mo5nd3z
However, it looks like this Winbatch tech support file was last updated in 2001. Is there a better way to refresh the desktop than is shown in this article?
Regards,
Jeff
Maybe give this code a try:
http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/tsleft.web+WinBatch/DllCall~Information+Refresh~Everything~By~Telling~Windows~an~Association~has~Changed.txt
Reference
API :http://msdn.microsoft.com/en-us/library/windows/desktop/bb762118(v=vs.85).aspx
MSDN Thread: http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/f9450610-5d0d-40bd-b9f8-d086f39042bc/refresh-desktop-icon-via-shchangenotify-on-windows-8
Not sure what you are looking for in a better way but the shell API function mentioned in the article is still part of the Windows shell so the article's technique should still work as well on Windows 8.1 as it did on NT 4.0.
Another possible technique would be to use the WinBatch/WIL WallPaper function specifying your current desktop wall paper. The WallPaper function calls an underlying shell COM interface method to do the equivalent of f5 on the desktop. I haven't tried this approach so I can't guarantee that it will work but I can't think of a reason why it wouldn't either.
No guarantees of success but here's the one liner
WallPaper(SysParamInfo(115,0,0),0)
Thank you, Deanna & td.
You're link to the Winbatch sample code works perfectly for me!
Regards,
Jeff