Registry Toolkit Scripts

Registry Toolkit scripts are used to perform automated operations. Scripts are ASCII text files that are created manually with a text editor. Scroll below to see a sample script. Also see Alternate Script Form for how to specify multiple search/replace strings within a key.

A script file must be passed to the program via the command line or batch file) syntax using the form like:

RegTkt.exe scriptfilename

Specify the complete path to RegTkt.exe (default is c:\tools\regtkt) if regtkt.exe is not in the current active path. Also specify a complete path to the script file if it is not in the current active path. Enclose paths & filenames that have spaces with " characters.

Scripts may use any file name extension except .reg. Comment lines are prefaced by # characters.

To run the program silently, disable confirmation prompts with the Prompts=1 switch and disable the progress meter with the No Progress=1 switch.

Two example scripts are included with the program: 'script.srt' demonstrates some basic actions and 'export.srt ' demonstrates an export via a script.

See 'Export via a script' for more information on exports.

Important Note: The behavior of the "Output/Undo File=" switch in a script changed with version 3.0. Users of earlier versions should read through this section and the Output File section. For script operations, output can be directed to a specific .reg file via the 'Output/Undo File=' switch. Alternatively, if you omit the 'Output/Undo File=' switch or leave it unspecified, the program writes multiple undo .reg file(s) in the last path used by the program when it was run interactively. During interactive use the path for output files is specified in the 'Write Undo .REG to' field in the Replace tab of the Search / Replace dialog.

# Registry Toolkit Script File Sample

# Version 3.4
# Funduc Software, Inc.
# Copyright 1998-2002

# http://www.funduc.com

# Format of Script Files

# The # character in column 1 is the comment character.
# These must go in column 1.
# All switches must start in column 1.

# Scripts are divided into [Action ] sections that are
# numbered sequentially, e.g, [Action01], [Action02],
# [Action03], .... They can be in any order in the
# script but are processed sequentially by number.

# Scripts can also have an optional [Default] section.
# [Default] can be used to specify switches that are to
# be used in all [Action ] that do not have that same switch
# specified. A switch specified in an [Action ] always
# overrides the counterpart (if any) from [Default].

# All scripts MUST have at least one [Action ] section.
# For a single action script, DO NOT USE a [Default]
# section. Use [Action1] instead.

# If your script has multiple actions and if you are
# using output file(s), use a different Output/Undo File=
# specification for each [Action ]. File writes to the
# output file are 'overwrite', not 'append'.

# NOTE: See [Action3] below for an example of how to specify
# multiple s/r's within a single [Action ].
# See Exports via a script for how to set up a script
# to export data.

[Default]

# Use this optional section to specify any switches to be
# applied to all [Action ]'s. We suggest new users
# omit [Default] entirely and specify all switches within
# each [Action ]. You can streamline later if you want by
# making a [Default].

[Action1]

# *** HIVE/HEY TO SEARCH ***
# Specify a top level key name to begin the operation from.
# When building your script, you may wish to use the
# "Copy Key Name" function from the Context Menu to simplify
# obtaining the key name to use here.

Key=HKEY_CURRENT_USER\Software

# *** SEARCH AND REPLCE STRINGS ***
# It is OK to leave Replace String= blank when conducting
# search-only operations. Results of the search will be
# written to the undo file.
# If you wish to use the undo file to preview the effects
# of a replacement, enter a string in Replace String= and
# specify Replace=0 (see below).

Search String=Funduc
Replace String=Software By Funduc

# *** CASE SENSITIVE OPERATION ***
# 0 = Case Insensitive search
# 1 = Case Sensitive search
# If not specified, Default = 0

Case Sensitive=0

# *** WHOLE WORD OPERATION ***
# 0 = Whole Word matching for the search string off
# 1 = Whole Word matching search string on
# If not specified, Default = 0

Whole Word=0

# *** REGULAR EXPRESSION OPERATION ***
# See Registry Operations - Regular Expressions for more info.
# 0 = Regular Expression mode off
# 1 = Regular Expression mode on
# If not specified, Default = 0

Regular Expression=0

# *** OPERATIONS ON VALUES ***
# 0 = Do not search (or replace) in registry values
# 1 = Search (or replace) in registry values
# If not specified, Default = 0

Values=1

# *** OPERATIONS ON KEYS ***
# 0 = Do not search (or replace) registry keys
# 1 = Search (or replace) registry keys
# If not specified, Default = 0

Keys=1

# *** OPERATIONS ON DATA ***
# 0 = Do not search (or replace) data values
# 1 = Search (or replace) data values
# If not specified, Default = 0

Data=1

# *** OPERATIONS ON STRING DATA ***
# 0 = Do not search (or replace) REG_SZ data types
# 1 = Search (or replace) REG_SZ data types
# If not specified, Default = 0

String=1

# *** OPERATIONS ON EXPANDED STRING DATA ***
# 0 = Do not search (or replace) REG_EXPAND_SZ data types
# 1 = Search (or replace) REG_EXPAND_SZ data types
# If not specified, Default = 0

Expanded String=0

# *** OPERATIONS ON MUTLI LINE STRING DATA ***
# 0 = Do not search (or replace) REG_MULTI_SZ data types
# 1 = Search (or replace) REG_MULTI_SZ data types
# If not specified, Default = 0

Multi String=0

# *** OPERATIONS BINARY DATA ***
# 0 = Do not search REG_BINARY data types
# 1 = Search REG_BINARY data types
# If not specified, Default = 0

Binary=0

# *** PROCESS SUBKEYS OR NOT ***
# By default the program will recurse all subkeys. To
# process values/data only in the immediate key specified
# in the Key= switch above, use the Process Subkeys=0
# switch.
# 0 = Do not process subkeys
# 1 = Process Subkeys

Process Subkeys=1

# *** OUTPUT/UNDO FILE SPECIFICATION ***

# Note: If nothing is specified after the = character or you
# omit this switch completely, the program will create one or
# more undo/output files in the last path for those when the
# program was run interactively.
# You can specify a different output/undo file for each [ActionX]
# section in a multi-step script.
# The Output/Undo File is NOT an append mode write. You may want
# to specify a different Output/Undo File for each step so contents
# are not overwritten by a later step.

Output/Undo File= D:\Scripts\RTOutput1.txt

# *** REPLACEMENT PROMPTING ***

# Note: When confirm is on, you may chose to skip all further
# confirmations in the confirmation dialog after the first prompt
# is offered.
# 0 = No initial replacement confirmation
# 1 = Confirm replacement prompt supplied for first replacement
# If not specified, Default = 0

Prompts=1

# *** PERMIT REPLACEMENTS? ***

# Use this when you have a Replace String specified but just want
# to preview the results of your replace. The preview will be
# listed in the Output/Undo File.
# 0 = No replace
# 1 = Perform a replace
# If not specified, Default = 0

Replace=0

# *** DISPLAY PROGRESS METER ***

# 0 = Standard progress meter
# 1 = No progress meter is displayed
# If not specified, Default = 0

No Progress=0

# *** WRITE REPLACEMENT STRING TO VALUE DATA ***

# To write the replace string where a value is found
# by the search string instead of changing the value
# itself, specify the data type with this switch.
# In most cases you will not use any setting for this
# switch so leave it turned off or omit entirely.
# 1 = REG_SZ
# 2 = REG_EXPAND_SZ
# 3 = REG_BINARY
# 4 = REG_DWORD
# 4 = REG_DWORD_LITTLE_ENDIAN
# 5 = REG_DWORD_BIG_ENDIAN
# 6 = REG_LINK
# 7 = REG_MULTI_SZ
# If not specified, Default=0.

Set Value Data=0

[Action2]

Search String=Test Replace String=Testing Key=HKEY_CURRENT_USER\Software\Test Replace=1
Case Sensitive=1
Whole Word=1
Regular Expression=0
Values=1
Keys=0
Data=0
String=1
Expanded String=0
Multi String=0
Binary=0
Output/Undo File=D:\Scripts\RTOutput2.txt
Prompts=0

# Note: The below Action does several s/r's on the key,
# HKEY_CURRENT_USER\Testing. You must use the numbering
# as modeled below. The first Search String= and
# Replace String= specs have no number. The second (and
# above) begin with the number 2.

[Action3] Key=HKEY_CURRENT_USER\Testing Search String=FindMe

Replace String=Replace with this
Search String2=Another string to find
Replace String2=Replace with this too
Search String3=Locate this
Replace String3=And replace with this
Replace=1
Case Sensitive=1
Whole Word=0
Regular Expression=0
Values=1
Keys=0
Data=0
String=1

Expanded String=O Multi String=O Binary=O

Output/Undo File=D:\Scripts\RTOutput3.txt

Prompts=O