|
Introduction
Quick start
Using the program
|
Using the program: Scripts
General information
Scripts give you the flexibility of adding files, folders, registry values and keys to be automatically cleaned for you. Select scripts you want to be executed during the wash in the "Scripts" page.
Creating, editing and managing scripts
You can manage and create scripts using buttons on the right-side of the scripts list:
|
Button
|
Keyboard shortcut
|
Description
|
| New |
Numpad + |
Create new script. |
| Remove |
Delete |
Remove currently selected script. |
| Run |
Shift + Enter |
Execute currently selected scipt. |
| Reload |
F5 |
Reload scripts list. |
Scripts syntax
Script consists of commands, executed consistently. Script is divided in two parts: header and commands. All lines in script have the followind syntax: statement [arguments]. Comments also can be used in scripts. They begin with double-slash (//) sequence and continue to the end of line.
Header
Following commands can be used in header:
|
Syntax
|
Example
|
Description
|
author [name] |
author John Smith |
Author of the script. When new script is created, current user name is inserted here automatically. |
version [version] |
version 1.00.416 |
Version of the application that has created this script. When new script is created, current PrivacyWatcher version is inserted here automatically. |
description [text] |
description Cleans TEMP folder |
Description of the script. |
Commands
Following command can be used in scripts:
|
Syntax
|
Description
|
file [drive:\][path\][*?] |
Deletes a single file or group of files (wildcards are allowed). For example: file c:\folder1\*.bak will delete c:\folder1\somefile.bak, c:\folder1\another.bak, etc. |
folder [drive:\][path\][*?] |
Deletes a folder or group of folders including all it subfolders (wildcards are allowed). For example: folder c:\folder?? will delete c:\folder01, c:\folder02, etc. |
regval [root_key\][subkey\][*?] |
Deletes a single registry value or group of values (wildcards are allowed). There are a few constants for root registry keys. Please note, under Windows NT (NT4, 2000 and XP) you must have administrator privileges to delete registry entries under other than HKEY_CURRENT_USER root keys. Example: regval HKCU\Software\Val?\ will delete HKEY_CURRENT_USER\Software\ValA, HKEY_CURRENT_USER\Software\ValB, etc. |
regkey [root_key\][subkey\][*?] |
Deletes a single registry key or group of keys (wildcards are allowed). There are a few constants for root registry keys. Please note, under Windows NT (NT4, 2000 and XP) you must have administrator privileges to delete registry entries under other than HKEY_CURRENT_USER root keys. Example: regval HKLM\Software\Subkey?\ will delete HKEY_LOCAL_MACHINE\Software\SubkeyA, HKEY_CURRENT_USER\Software\SubkeyB, etc. |
alert [message] |
Displays a message box. Example: alert This is an example!. |
log [text] |
Prints a line in the log. Example: log Script has started. |
Registry root keys constants
You can use the following constants for registry root keys in scripts:
|
Long name
|
Short name #1
|
Short name #2
|
HKEY_CLASSES_ROOT |
HKCR |
HCR |
HKEY_CURRENT_CONFIG |
HKCC |
HCC |
HKEY_CURRENT_USER |
HKCU |
HCU |
HKEY_DYN_DATA |
HKDD |
HDD |
HKEY_LOCAL_MACHINE |
HKLM |
HLM |
HKEY_PERFORMANCE_DATA |
HKPD |
HPD |
HKEY_USERS |
HKU |
HU |
Wildcards usage
The following table shows the wildcard characters you can use in the scripts, what they mean and where they are applied.
|
Wildcard expression
|
In what commands used
|
Meaning
|
* |
file, folder, regkey, regval |
Zero or more characters. |
? |
file, folder, regkey, regval |
Any single character. |
# |
regkey, regval |
Any single digit. |
[charlist] |
regkey, regval |
Any character in charlist. Examples: [a-z], [0-5], [r], [a-zA-Z0-9]. |
[!charlist] |
regkey, regval |
Any character NOT in charlist. Examples: [!a-z], [!0-5], [!r], [!a-zA-Z0-9]. |
Variables
You can use the following variables in script commands:
|
Variable
|
In what commands used
|
Meaning
|
%name |
file, folder, regkey, regval, log, alert |
Name of the current script. |
%user |
file, folder, regkey, regval, log, alert |
Current user's name. |
%windir |
file, folder, regkey, regval, log, alert |
Windows directory (usually, "C:\Windows"). |
%sysdir |
file, folder, regkey, regval, log, alert |
System directory (usually, "C:\Windows\System" or "C:\Windows\System32"). |
%tempdir |
file, folder, regkey, regval, log, alert |
Windows temporary directory (usually, "C:\Windows\TEMP"). |
%systemdrive |
file, folder, regkey, regval, log, alert |
Drive where Windows is installed (usually, "C:"). |
%programfiles |
file, folder, regkey, regval, log, alert |
Program files directory (usually, "C:\Program Files"). |
%appdata |
file, folder, regkey, regval, log, alert |
Application data directory (in Windows NT, usually, "C:\Documents and Settings\User\Application Data"). |
\n |
alert |
New line character. If you want to display "\n", use "\\n" sequence. |
If you want to use variable name without replacing it with its value, just use additional "%" character before the variable name. For example: alert %%windir is %windir will produce the following message: "%windir is C:\Windows".
|