Announcement

Collapse
No announcement yet.

vbs: Randomly rotate users desktop wallpaper (was: challange for VBS pros)

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

  • vbs: Randomly rotate users desktop wallpaper (was: challange for VBS pros)

    can you please support me in this issue

    i want the when the user log on to his account an image is displayed from a random set of images stored on the LAN i.e. i will share a folder with all the images

    i prefer to use VBS script so i can use it with the logon scripts . i use win2003 AD

  • #2
    Re: challange for VBS pros

    Do you already made a start?
    With what app do you want to display the images? IE? image viewer? whatever?
    What clients do you have?
    Marcel
    Technical Consultant
    Netherlands
    http://www.phetios.com
    http://blog.nessus.nl

    MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
    "No matter how secure, there is always the human factor."

    "Enjoy life today, tomorrow may never come."
    "If you're going through hell, keep going. ~Winston Churchill"

    Comment


    • #3
      Re: vbs: Randomly rotate users desktop wallpaper (was: challange for VBS pros)

      Originally posted by mohtaw View Post
      when the user log on to his account an image is displayed from a random set of images
      Would a wallpaper do? Google for "vbscript change wallpaper" and you'll get about 100k hits.

      This seems to be good enough: http://www.tech-archive.net/Archive/.../msg00047.html

      The MS Scripting Guy solution seems reasonable as well: http://www.microsoft.com/technet/scr...7/hey0118.mspx

      -vP

      Comment


      • #4
        Re: vbs: Randomly rotate users desktop wallpaper (was: challange for VBS pros)

        Thanks Dumber for replying
        my issue is : i want every time any user of my domain ( they all use XP) logon to his account an image is popped up . the image it self will be stored on a shared folder on the network . the issue it's not one image they are a set of images and i want to open any one of them randomely for at the logon of the user .

        i though of a logon script that will wither
        1- change the wallpaper to be on of the images
        2- just use the XP image viewer to open the image .

        so any advise or new idea i can follow with

        Comment


        • #5
          Re: vbs: Randomly rotate users desktop wallpaper (was: challange for VBS pros)

          thanks vonPryz for passing this link solved the randmization part
          http://www.microsoft.com/technet/scr...7/hey0118.mspx

          the other part is i want to just open the images not change the desktop wallpaper

          any idea ??

          Comment


          • #6
            Re: vbs: Randomly rotate users desktop wallpaper (was: challange for VBS pros)

            FYI, Wallpaper images are in the format *.bmp.
            When a user select an image (i.e. a jpg-file), it will be automatically converted to a bmp file in the appropiate resolution. That is the wallpaper file, the bmp-file will stored by default in the user's folder: "%userprofile%\Local Settings\Application Data\Microsoft\"

            All the walpaper setting are kept in the user's part of the registry, in this key;
            HKEY_CURRENT_USER\Control Panel\Desktop\
            The important valueItems are:
            - TileWallpaper
            - WallpaperStyle
            - Wallpaper

            You can change these registry values by script (batch or vbs).
            For the vbs code to rotate the users wallpaper randomly- See the 2nd link provided by vonPryz.
            After the changes you'll need to refresh the desktop background, you can use this code to do so, http://forums.petri.com/showpost.php...3&postcount=11 .

            Related thread: Batch to change Wallpaper for the logon screen


            Originally posted by mohtaw View Post
            i want to just open the images not change the desktop wallpaper

            any idea ??
            My bad, I had changed your thread title, and it has caused a confusion I guess. I can change it again when I know exactly what it is you want to accomplish. (And please, start with a good title next time).

            How, with what application you want to open the images? What is the user going to see on the screen then.


            \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


            • #7
              Re: vbs: Randomly rotate users desktop wallpaper (was: challange for VBS pros)

              about the title sorry for that it's my first time here and i wanted to get help from as many as possible

              my issue as i said before was to notify any user in the domain when logon by an image first i thought to make it the wallpaper

              then i read the sent links so i thought it will be better to just use the default XP image viewer to display these images for the users

              how ever i the randomization part was solved .

              so how i use VBS now to open the image when the user logon

              and any new idea for this issue is greatly welcomed

              Comment


              • #8
                Re: vbs: Randomly rotate users desktop wallpaper (was: challange for VBS pros)

                Sample how to open an image in the "Picture and Fax Viewer" by using a batch,
                Code:
                @echo off
                
                :: Image file
                Set "sImage=\\UNCpath\share\my images\image1.jpg"
                
                :: Convert path to shortname notation.
                for %%* in ("%sImage%") do Set "sImage=%%~fs*"
                
                :: open image
                Set "sViewer=RunDLL32.exe %SystemRoot%\system32\shimgvw.dll,ImageView_Fullscreen"
                start ""/Max %sViewer% %sImage%
                The above batch converted to VBS,
                Code:
                '# Image file
                sImage= "\\UNCpath\share\my images\image1.jpg"
                
                '# Convert path to shortname notation.
                With CreateObject("Scripting.FileSystemObject")
                  With .GetFile(sImage)
                    sImage = .ShortPath
                End With : End With
                
                '# open image
                With CreateObject("WScript.Shell")
                 .Run "%comspec% /c START /Max rundll32.exe %SystemRoot%\system32\" _
                   & "shimgvw.dll,ImageView_Fullscreen " & sImage, 1, true
                End With
                \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


                • #9
                  Re: vbs: Randomly rotate users desktop wallpaper (was: challange for VBS pros)

                  Dears
                  many thanks for your help
                  i used this code to display a random image for the user at the logon
                  'choose a number from 1 to 6
                  first = 1
                  last =6
                  Randomize
                  intnumber = int ((last-first+1) * Rnd + first)
                  image_name ="imge"&intnumber&".jpg"
                  '# Image file
                  sImage= "path of the images"&image_name

                  '# Convert path to shortname notation.
                  With CreateObject("Scripting.FileSystemObject")
                  With .GetFile(sImage)
                  sImage = .ShortPath
                  End With : End With

                  '# open image
                  With CreateObject("WScript.Shell")
                  .Run "%comspec% /c START /Max rundll32.exe %SystemRoot%\system32\" _
                  & "shimgvw.dll,ImageView_Fullscreen " & sImage, 1, true
                  End With
                  also i got new useful information about how to randome change the dwktop wallpaper from this link http://www.microsoft.com/technet/scr...7/hey0118.mspx

                  Comment

                  Working...
                  X