2) The CPAU command
You will need to download the CPAU 1.10 executable from the official website.
Next, copy the unzipped file (CPAU.exe) into the %systemroot%\system32 folder (normally c:\windows\system32).
CPAU is a command line tool that allows you to start a program and specify the user account and password to use. It will also allow you to encrypt the script in a text file. The following parameters are those that you will need to use:
-u username
-p password
-ex executable name
-file specifies the location and name of the text file that contains the scripts parameters
-enc encodes the script in a txt file
-dec decodes the txt file to be executed in the script
-cwd specifies the working folder
-profile loads the user’s profile
Let’s take a look at the Scandisk application (chkdisk.exe).
The first command you need to input is the following:
Cpau –u administrator –p password –file c:\chkdsk.txt –ex chkdsk.exe –cwd c:\winnt\temp –enc
CPAU will create an encrypted file named checkdsk.txt containing the script information. CPAU will only keep the command, username and password in this command file. If you want to define a working folder (obligatory in certain cases), then you will need to input this when asked for the text file.
If you edit this file with notepad, you will see something like this:

Next, you will need to create another script in notepad:
Cpau –file c:\chkdsk.txt –dec –profile
With a working directory of the following:
Cpau –file c:\chkdsk.txt –dec –profile –cwd c:\winnt\temp
And save it with the .cmd extension.

You can then copy this file to your desktop or to wherever you are going to run the script from.
CPAU also supports UNC names:
Example:
Cpau –u administrator –p password –file \\server\netlogon\chkdsk.txt –ex chkdsk.exe –enc
Cpau – file:\\server\netlogon\chkdsk.txt –dec -profile -cwd c:\winnt\temp
NB: If you execute a CPAU script from a network location (connection script for example), the –cwd command is necessary otherwise it wont work.