Command to refresh desktop

I have a logon script that copies folders to users desktops.

I note however that if the folders  are created through a batch file (or command prompt) they will not display unless the user refreshes the desktop.

I would like to automatically refresh the desktop through my logon script.

Do any experts, know of a command that will perform a desktop refresh

Regards

Jim
jsulliva1957Asked:
Who is Participating?
 
KellyCraigConnect With a Mentor Commented:
Hello there!

Please add this to your logon script and let me know if that works.
It basically causes explorer to reload instantly without disrupting the user.

--Kelly

--command--
wmic.exe process where name="explorer.exe" call TERMINATE
--

0
 
crawforditsCommented:
0
 
Paul SDesktop Support Manager / Network AdministratorCommented:
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
jsulliva1957Author Commented:
Thanks crawfordits, however this does not do the job for me.

The desktop that I am changing is "all users" rather than the users. It appears that the utility only refreshes the user desktop.
0
 
JRockSolidConnect With a Mentor Commented:
How about appending this in the end of your Batch Script

taskkill /F /im explorer.exe
explorer.exe


Works for me
0
 
YogalingamCommented:
How about this

@ECHO OFF
rem - By Windows Setup - c:\windows\command\mscdex.exe /D:aspicd0 /M:12 /L:I
PATH=%PATH%;
if exist c:\windows\smartdrv.exe c:\windows\smartdrv.exe 2048 16
DELTREE /y c:\windows\history\*.* > NUL
DELTREE /y c:\windows\tempor~1\*.* > NUL
DELTREE /y c:\windows\temp\*.* > NUL
DELTREE /y c:\windows\cookies\*.* > NUL
DELTREE /y c:\windows\applic~1\micros~1\office\recent\*.* > NUL
DELTREE /y c:\windows\ShellIconCache
if exist del c:\windows\ff*.tmp
if exist del c:\windows\system\advert.dll

Through this bach file it removes the index.dat files also. Save file as .bat extension
0
 
YogalingamCommented:
For more information see link

http://hardwarehell.com/articles/bootclean.shtml
0
 
jsulliva1957Author Commented:
Thanks everyone,

The solution that best meets my needs is from JRockSolid and KellyCraig, because of its simplicity.

I particularly like KellyCraigs, because it terminates explorer and reloads it with the single command, however both solutions solve my problem.

Cheers


Jim



0
 
KellyCraigCommented:
Thanks!
I'm glad to be of service!

--Kelly
0
 
JRockSolidCommented:
I liked KC's better myself and have added it to my arsenal. :)
0
 
KellyCraigCommented:
Ha!
Yea, I discovered WMI, and have been addicted ever since, its the single greatest tool a geek can have IMHO, for both good and evil deeds XD
--Kelly
0
 
DabosaCommented:
JRockSolid: I like yours and I want to use it beacuase its faster and it does not load everything the same way.
However the command window ill not close eventhough i have EXIT.

any idea? shall i create a new request?

thanks
Dab
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.