Windows background from server?

bin3

Senior Member
Joined
Jun 22, 2005
Messages
976
I would probably try to map a network drive to the server and then just serve the images as 'local'.
 

PsyWulf

Honorary Master
Joined
Nov 22, 2006
Messages
13,673
I'll need more information

Give an example of the URL
What format is the image
Is the name constant
Is the image generated by the server somehow
 

silentbee

Senior Member
Joined
Jul 15, 2009
Messages
511
If the name is consistent, surely you just need to force Windows to reload the bg image at an interval that is the same as the interval that the image is being refreshed. I dunno how though. You could write a batch file that runs on a schedule to copy the image twice to your local HDD. Then set you desktop to use those images as a slideshow to cycle between the images. It will cycle through identical images until they change. That might work...
 

PsyWulf

Honorary Master
Joined
Nov 22, 2006
Messages
13,673
Ok i hacked something together as I couldn't find any specific app that'd handle this well

It's quick,it's dirty and it works

Requires a few steps so bear with me:

1) Download "John's Background Switcher"
2) Set it to monitor a folder every x minutes for changes - I created a folder called "img" in my c: root
3) Open notepad and put the following code in,save it as background.vbs in the c: root ( remember to change the strFileURL to the IMG URL )
Code:
' Set your settings

Randomize()
randomNumber =Int(1000 * Rnd())

    strFileURL = "http://www.example.com/image.jpg"
    strHDLocation = "c:\img\back" & randomNumber & ".jpg"

' Fetch the file
    Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")

    objXMLHTTP.open "GET", strFileURL, false
    objXMLHTTP.send()

If objXMLHTTP.Status = 200 Then
Set objADOStream = CreateObject("ADODB.Stream")
objADOStream.Open
objADOStream.Type = 1 'adTypeBinary

objADOStream.Write objXMLHTTP.ResponseBody
objADOStream.Position = 0    'Set the stream position to the start

Set objFSO = Createobject("Scripting.FileSystemObject")
If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
Set objFSO = Nothing

objADOStream.SaveToFile strHDLocation
objADOStream.Close
Set objADOStream = Nothing
End if

Set objXMLHTTP = Nothing

4) Open another notepad,this time with the following code,and save it as getter.bat
Code:
c:
cd..
cd..
cd..
cd..
cd..
cd img
del /Q *.*
wscript.exe c:\background.vbs
pause

5) Download bat-to-exe converter from cnet here

6) Convert the batch file to an exe and set it to run invisible and save the exe in the c: root

7) Now add a task using task scheduler to run the newly created exe every x interval

The batch and VBS clears the download folder and downloads the img with a new random file name which John's switcher can pick up and change to,I unfortunately had to use the randomized names because the program doesn't recognize changed files
 

PsyWulf

Honorary Master
Joined
Nov 22, 2006
Messages
13,673
Tsorite,funny enough the constant name was the most difficult part

Windows 7 doesn't support non-programmatic background refreshes so I couldn't just set a batch file to read for changes and apply appropriately
 

PsyWulf

Honorary Master
Joined
Nov 22, 2006
Messages
13,673
Might aswell just make a video widget then :)

Given an hour free time you could just write an applet to do this with refreshes timed down to the millisecond in .Net
 

PsyWulf

Honorary Master
Joined
Nov 22, 2006
Messages
13,673
I've had issues with cd\ in scripts between different versions of windows for no apparent reason,thus the ...
 
Top