A simple VBScript to update the Screenshot Index value in the Windows Registry.
The Screenshot Index is a value stored in the Windows Registry that is used to keep track of the next number to use when naming screenshots taken using the Print Screen
. This value is stored in the registry key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ScreenshotIndex
.
- Download the
UpdateScreenshotIndex.vbs
file. - Double-click the file to run it.
- Enter the new value for the Screenshot Index.
- The script will update the Screenshot Index value in the Windows Registry.
Note This script is designed to run on Windows operating systems and requires administrative privileges to modify the Windows Registry.
graph TB
A(Get current value of ScreenshotIndex) --> B[Input new value for ScreenshotIndex]
B --> |OK| C{Is new value a number?}
C --> |Yes| D[Is new value between 0 and 9999999?]
D --> |Yes| E[Update ScreenshotIndex to new value]
D --> |No| F(Show Invalid input ScreenshotIndex value must be a number.)
C --> |No| F
E --> G(Show ScreenshotIndex value has been updated.)
B --> |Cancel| H(No update made.)
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
This project is licensed under the 0BSD License.