-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUpdateScreenshotIndex.vbs
24 lines (20 loc) · 1.01 KB
/
UpdateScreenshotIndex.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
Option Explicit
Dim regKey, value, newValue
Const HKEY_CURRENT_USER = &H80000001
Set regKey = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
regKey.GetDWORDValue HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Explorer", "ScreenshotIndex", value
newValue = InputBox("Current ScreenshotIndex value is " & value & ". Please enter the new value:", "Update ScreenshotIndex", value)
If Not IsNull(newValue) And newValue <> "" Then
If IsNumeric(newValue) Then
If CLng(newValue) >= 0 And CLng(newValue) <= 9999999 Then
regKey.SetDWORDValue HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Explorer", "ScreenshotIndex", CLng(newValue)
MsgBox "ScreenshotIndex value has been updated from " & value & " to " & newValue & "."
Else
MsgBox "Invalid input. ScreenshotIndex value must be a number."
End If
Else
MsgBox "Invalid input. ScreenshotIndex value must be a number."
End If
Else
MsgBox "No update made."
End If