Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

refresh desktop using batch

I need to refresh the desktop ussing batch is this possible?

I have found the following VBscript that refreshes the containing window however, the desktop needs to be refreahed and its not the containing window

anyways around this?

Set WSHShell = CreateObject("WScript.Shell")

WshShell.SendKeys "{F5}"

thx-

like image 635
philip Avatar asked Feb 09 '11 09:02

philip


2 Answers

You may try this:

rundll32 user32.dll,UpdatePerUserSystemParameters  

Or this:

ie4uinit.exe -ClearIconCache

It is, however, version dependent.

like image 149
Dr. belisarius Avatar answered Oct 06 '22 08:10

Dr. belisarius


On Win7 this can be done by calling the function "SHChangeNotify" from "shell32.dll". The problem is that AFAIK this function can't be successfully loaded using "rundll32.exe", so instead use a program that can do it.


Compiled EXE

Use this CLI Refresh Tool from sepago website (32/64 bit images available for download)

AHK (AutoHotKey)

DllCall("Shell32\SHChangeNotify", UInt, 0x08000000, UInt, 0, UIntP, 0, UIntP, 0)

AutoIt

DllCall("shell32.dll", "none", "SHChangeNotify", "long", 0x8000000, "uint", BitOR(0x0, 0x1000), "ptr", 0, "ptr", 0)
like image 36
NiNiX Avatar answered Oct 06 '22 10:10

NiNiX