Announcement

Collapse
No announcement yet.

Vbscript or batch file to refresh the desktop on your computer

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Vbscript or batch file to refresh the desktop on your computer

    Hi,

    Has anyone got a vbscript, batch file to refresh the desktop on your computer.... I have tried the F5 key vbscript that does not work!!!! Thaaankksss????

    Thanks

    Moe,

  • #2
    Re: Vbscript or batch file to refresh the desktop on your computer

    Title changed to something more appropriate and moved to scripting forum

    Michael
    Michael Armstrong
    www.m80arm.co.uk
    MCITP: EA, MCTS, MCSE 2003, MCSA 2003: Messaging, CCA, VCP 3.5, 4, 5, VCAP5-DCD, VCAP5-DCA, ITIL, MCP, PGP Certified Technician

    ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

    Comment


    • #3
      Re: Vbscript or batch file to refresh the desktop on your computer

      What are you trying to accomplish? Are you wanting to refresh the desktop during different parts of the day or something?
      ** Remember to give credit where credit is due and leave reputation points where appropriate **

      Comment


      • #4
        Re: Vbscript or batch file to refresh the desktop on your computer

        I knew you could do it with the sendkeys method but as I was looking for the right reference for the desktop I found that someone has already written a script to refresh the desktop.

        http://www.computerperformance.co.uk..._your_Desktop_
        Regards,
        Jeremy

        Network Consultant/Engineer
        Baltimore - Washington area and beyond
        www.gma-cpa.com

        Comment


        • #5
          Re: Vbscript or batch file to refresh the desktop on your computer

          Hi,

          Thanks for your reply,,,, i have tried the F5 method and the script on that link but it does not work. The active desktop is set-up on a number of machines but it only displays the desktop when you log in twice??? i cannot get the desktop to appear from the GPO when you login the 1st time!!!!!

          Regards,

          Moe

          Comment


          • #6
            Re: Vbscript or batch file to refresh the desktop on your computer

            Does killing the process 'explorer.exe' refresh the desktop?

            (You may need to do New Task from Task Manager and run explorer.exe to get it to come back)
            Server 2000 MCP
            Development: ASP, ASP.Net, PHP, VB, VB.Net, MySQL, MSSQL - Check out my blog http://tonyyeb.blogspot.com

            ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

            Comment


            • #7
              Re: Vbscript or batch file to refresh the desktop on your computer

              Try what Chris (tonyyeb) suggested but if that doesn't work then maybe you should just change the default user profile.

              http://support.microsoft.com/kb/319974

              And if you want every computer in the domain to use it as the default user profile
              http://windowsitpro.com/article/arti...r-profile.html
              Regards,
              Jeremy

              Network Consultant/Engineer
              Baltimore - Washington area and beyond
              www.gma-cpa.com

              Comment


              • #8
                Re: Vbscript or batch file to refresh the desktop on your computer

                Thanks for everyones replies!!! much appreciated,,, how would i use the same default profile to be copied to all the computers so that the desktop backround is the same??? (GPO MAYBE??)


                Thanks,

                Moe336

                Comment


                • #9
                  Re: Vbscript or batch file to refresh the desktop on your computer

                  My second link shows you have to make a profile the default domain-wide.
                  Here a KB explaining the same thing http://support.microsoft.com/kb/168475
                  Regards,
                  Jeremy

                  Network Consultant/Engineer
                  Baltimore - Washington area and beyond
                  www.gma-cpa.com

                  Comment


                  • #10
                    Re: Vbscript or batch file to refresh the desktop on your computer

                    This is the script I used when joking around with a colleagues desktop! Immature I know but we all do it!

                    Code:
                    'This changes his desktop immediately to a local file (hence change c:\windows\domxp.bmp)
                    
                    Set oShell = CreateObject("WScript.Shell")
                    Set oSHApp = CreateObject("Shell.Application")
                    Set oFSO = CreateObject("Scripting.FileSystemObject")
                    
                    'Set Wallpaper to Path Below
                    sWinDir = oFSO.GetSpecialFolder(0)
                    sWallPaper = "C:\WINDOWS\DOMXP.bmp"
                    
                    ' Update Wallpaper in registry
                    oShell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", sWallPaper
                    wscript.sleep 3000
                    
                    'Refresh Screen
                    oSHApp.ControlPanelItem cstr("desk.cpl")
                    ' alt. oShell.Run "control desk.cpl"
                    
                    Do Until oShell.AppActivate ("Display Properties")
                    Loop
                    oShell.SendKeys "{DOWN}{UP}{TAB 3}~"
                    
                    'Minimise all Windows.
                    oSHApp.MinimizeAll
                    * Shamelessly mentioning "Don't forget to add reputation!"

                    Comment


                    • #11
                      Re: Vbscript or batch file to refresh the desktop on your computer

                      This script maybe?:
                      Code:
                      Dim oShell
                      Set oShell = CreateObject("WScript.Shell")
                      
                      oShell.Run "%WinDir%\System32\RUNDLL32.EXE user32.dll,"_
                        & "UpdatePerUserSystemParameters",1 ,true
                      
                      Set oShell = Nothing
                      wscript.quit
                      \Rems

                      This posting is provided "AS IS" with no warranties, and confers no rights.

                      __________________

                      ** Remember to give credit where credit's due **
                      and leave Reputation Points for meaningful posts

                      Comment

                      Working...
                      X