Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Refresh Desktop delay script

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,51186
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Refresh Desktop delay script
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Refresh Desktop delay script - 8/27/2007 4:13:32 AM   
  ZoSoSwiM

 

Posts: 5
Score: 0
Joined: 8/27/2007
Status: offline
Hello everyone! I would greatly appreciate some help..

I need a refresh script to run after windows finishes loading the background.
I have active desktop running on my domain for a couple different groups.
Many times it isn't displayed properly until a screen refresh takes place.

Currently I have this as a code.

WScript.Sleep 10000
Set WshShell = Wscript.CreateObject("WScript.Shell")
WshShell.AppActivate "Program Manager"
WshShell.SendKeys "{F5}"
Set WshShell = Nothing
Wscript.Quit


I would like group policy to load a script when the user logs on and have the timer wait to refresh the desktop. Is this possible? If this can be done better another way please let me know. I'm relatively new at scripting and such so any help is much appreciated!!

-Jon
 
 
Post #: 1
 
 RE: Refresh Desktop delay script - 8/27/2007 6:08:00 AM   
  mikeock


Posts: 124
Score: 1
Joined: 6/8/2006
Status: offline
Try this with your timing code:


      

_____________________________

My sig sucks!

(in reply to ZoSoSwiM)
 
 
Post #: 2
 
 RE: Refresh Desktop delay script - 8/27/2007 11:51:59 PM   
  ZoSoSwiM

 

Posts: 5
Score: 0
Joined: 8/27/2007
Status: offline
Should I just paste that above my refresh code? I tried and it give me a runtime error on oshell.

(in reply to mikeock)
 
 
Post #: 3
 
 RE: Refresh Desktop delay script - 8/28/2007 8:37:35 AM   
  Parabellum


Posts: 222
Score: 0
Joined: 11/12/2006
From: UK
Status: offline
you need to create the oshell object...
the full code should read...


      

basicaly the command.... RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters ......is telling windows to reprocess the HKEY_CURRENT_USER section of the registry.

I have found however that both method's (this one and your send keys) doesn't allways work... for this exact task.. haven't found a 100% fool proof way yet...
but give it a try anyway may work... depending on your machine build, registry permissions, group policies etc.

(in reply to ZoSoSwiM)
 
 
Post #: 4
 
 RE: Refresh Desktop delay script - 8/28/2007 8:42:27 AM   
  mikeock


Posts: 124
Score: 1
Joined: 6/8/2006
Status: offline
Thanks for replying.
I had yanked the code from a script and its been a while since i looked at it!

On my work system, the above code freezes the machine.
On my home pc it works fine.....

_____________________________

My sig sucks!

(in reply to Parabellum)
 
 
Post #: 5
 
 RE: Refresh Desktop delay script - 8/28/2007 8:57:51 AM   
  Parabellum


Posts: 222
Score: 0
Joined: 11/12/2006
From: UK
Status: offline
 just noticed... dont need this line either ... :)

quote:

Set oFSO = CreateObject("Scripting.FileSystemObject")



(in reply to Parabellum)
 
 
Post #: 6
 
 RE: Refresh Desktop delay script - 8/29/2007 1:20:19 AM   
  ZoSoSwiM

 

Posts: 5
Score: 0
Joined: 8/27/2007
Status: offline
So if I set this script as a logon script it will force the refresh? or should I start it a different way.

currently all of my classroom and lab computers are frozen with deepfreeze so putting a startup script on each computer is a bit of a pain. Any ideas?

(in reply to Parabellum)
 
 
Post #: 7
 
 RE: Refresh Desktop delay script - 8/29/2007 1:36:51 AM   
  CaffeineAddiction

 

Posts: 144
Score: 0
Joined: 2/9/2005
From:
Status: offline
Well, if you want it running on all computers on the domain ... your best bet is to put the script in the NETLOGON folder on the DC and setting it as either a startup script for all / some users w/ GP ... or putting its each individual user's startup script on there AD objects

Something you also might want to look at is having the script run as a service ... which would keep it out of the way of the user, however this may cause it to try and refresh the desktop of one of the service accounts instead of the users ... but still ... deff something to look into

_____________________________

Thanks for Answering my Questions ... I hope my Answer to your questions help!

(in reply to ZoSoSwiM)
 
 
Post #: 8
 
 RE: Refresh Desktop delay script - 8/29/2007 4:07:04 AM   
  ZoSoSwiM

 

Posts: 5
Score: 0
Joined: 8/27/2007
Status: offline
Thanks a lot everyone! I'll be trying a few things with this asap. I'll let you all know how it turns out!

(in reply to CaffeineAddiction)
 
 
Post #: 9
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Refresh Desktop delay script Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts