Logo

 

LiveSystem pro

PE Builder

 

User Manual (v.11)

                                  

Version 1.0.5.0 and higher

© www.kare-net.de  2011-2016

 

Created: Feb. 10, 2016

 

 

 

 

 

 

 

 

 

 

Table of Contents

Table of Contents  2

1.              First Steps  4

1.1.    Purpose of WindowsPE  4

1.2.    Building WindowsPE  4

1.3.    Supported Host Computer Systems  4

1.4.    Supported PE Systems  4

2.              Syntax of Commands  5

2.1.    System   5

Convert 5

Echo  5

Exit 6

Halt 6

Math  6

Message  6

Pack 7

Return  7

Run  7

Set 8

Setmacro  8

SetMvar 8

SYSTEM  9

Wait 10

Wim Commands 11

Update  11

2.2.    Programmable Conditions (If Conditions) 12

If,…,Then  12

If,…,Then,…,Else-Block 13

2.3.    Conditions for Directories, Files and Interfaces  13

2.3.1.     Directories  13

DirCopy  13

DirRemove  14

DirMove  14

DirMake  14

2.3.2.     Files  15

2.3.2.1.       Conditions for Files  15

FileCopy  15

FileDelete  15

FileRename  15

FileCreateBlank 15

FileRead  16

FileSetAttrib  16

CopyFile  17

CopyOrExpand  17

Expand  17

ReqFile  18

Require_File  18

Retrieve  18

Search    File  19

SetReqFile  19

ShellExecute  19

Start 20

2.3.2.2.      Word Processing  20

TXTAddLine  20

TXTReplace  20

StrFormat 21

2.3.2.3.      INI Processing  21

IniWrite  21

IniWriteSection  21

IniDeleteSection  22

IniRead  22

IniReadPos 22

IniRenameSection  23

2.3.3.     Interface Processing  23

Interface,Get 23

Interface,Set 23

Interface,State  24

Interface,Update  24

2.4.    Registry Processing  25

Loadhive  25

UnLoadhive  25

RegRead  25

RegWrite  26

RegDelete  27

2.5.    String Processing  27

String      LEFT/RIGHT  27

String      TLeft/TRight 27

String      FIND  28

String      LEN  28

String      MID  28

String      REPLACE  28

String      SPLIT  29

2.6.    Network Commands  29

WebGet 29

2.7.    Loop commands  30

2.7.1.     For / Next - loop  30

2.7.2.     ExitLoop  31

2.8.    Variables (intern) 31

2.9.    Variables (Project) 32

2.10.   System,SetPEInit  34

2.11.   Special Characters  35

2.12.   Shortcuts  36

2.13.   Macros  36

3.              Script Control  38

3.1.    Standard Sections of Scripts  38

3.1.1.     Section [Main] 38

3.1.2.     Section [Interface] 39

3.1.3.     Section [Process] 39

3.2.    Active Script Control  39

3.2.1.     Choosing Windows Source  40

3.2.2.     Script-Select 40

 

 

 

Comment:

Optional commands are written as

 

[Command]          resp.    [<Command>]

 

 

 

1.       First Steps

 

1.1.    Purpose of WindowsPE

 

               Windows PE (Windows PreinstallationEnvironment) is excellent suitable for following range of

               applications:

 

e    Repairing Computers

e    Performing Data Recovery

e    Preparing a reinstallation of Operating System

e    Removing a virus

e    Rebuilding private data (documents and pictures)

e    Restoration of images files

 

               Back to Table of Contents

 

 

1.2.    Building WindowsPE

 

               Video manual in forum LiveSystem-pro.de:

               http://www.livesystem-pro.de/showthread.php?92-Videoanleitung-1-quot-LiveSystem-pro-quot-PE-Builder

 

               Back to Table of Contents

 

 

1.3.    Supported Host Computer Systems

 

               At moment following systems will be supported:

 

               e           Windows XP/2003              ServicePack 3 (32/64-bit)

               e           Windows Vista                    with all ServicePacks (32/64-bit)

               e           Windows 7                          with all ServicePacks (32/64-bit)

               e           Windows 8/8.1                    (32/64-bit w/o ServicePack)

               e           Windows 10                        (32/64-bit w/o ServicePack)

 

 

               Back to Table of Contents

 

 

1.4.    Supported PE Systems

 

               LiveSystempro is available with 4 projects:

 

               e           WinXPE                Windows XP, Windows 2003 (32-bit)

              

               e           Win7PE                Windows Vista (32/64-bit)*

                                                           Windows 2008 (32/64-bit)*

                                                           Windows 7 (32/64-bit)*

                                                           Windows 2010 (32/64-bit)*

                                                           * = all ServicePacks

 

               e           Win8PE                Windows 8 (32/64-bit)

                                                           Windows 8.1 (32/64-bit)

                                                           Windows 2010 R2 (32/64-bit),

                                                           Windows 8.1 Update 1 (32/64-bit)

              

               e           Win10PE              Windows 10 (32/64-bit)

 

              

 

 

               All of them are integrated in LiveSystempro and selectable separately.

 

               Back to Table of Contents

 

 

2.       Syntax of Commands

 

2.1.    System

 

 

          Convert

 

            Converts decimal and hexadecimal values

 

                        Syntax:

                    Convert,<%Variable%>,<Method>,<Value>

 

                              Method:                              -              Hex2Dec              converts a hexadecimal value into a decimal one

                                                                          Dec2Hex              converts a decimal value intp a hexadecimal one

                                                                          Dec2chr                converts a decimal value into Ascii code

                                                                                                       (Unicode will be supported)

 

                              Examples:

                              Convert,%Var%,Hex2Dec,401a

                              Allocates to variable %Var% the value  16410 .

 

                              Convert,%Var%,Dec2Hex,16410

                              Allocates to variable %Var% the value  401a .

 

                              Convert,%Var%,Dec2chr,65

                              Allocates to variable %Var% the value  A .

 

               Back to Table of Contents

 

 

          Echo

 

               Shows an information

 

                              Syntax:

                              Echo,<Text>

 

                              Example:

                              Echo,Running script

 

               Back to Table of Contents

 

 

          Exit

 

               Quits the running script

 

                        Syntax:

                    Exit

 

                              Example:

                              If,%Arch%,=,x64,Then,Exit

 

               Back to Table of Contents

 

 

          Halt

 

               Stops accomplishment of build

 

                              Syntax:

                              Halt,[<Text>]

 

                                             Text        -              any text (optionally)

 

                              Example:

                              Halt,Aborted by user

 

               Back to Table of Contents

 

 

          Math

 

               Performs a mathematic counting

 

                              Syntax:

                    Math,<%Variable%>,<Value>,[<PARAMETER>]

 

                                             %Variable%          -              any name

                                             Value                     -              mathematic counting

                                            Parameter            (optional)               -              Round_Up / Round_Down

 

                              Examples:

                              Math,%NewVar%,45+(7*4)

                              Allocates to variable %NewVar% the value of 73 (sum of 45 + 28)

 

                              Math,%NewVar%,16.9-10,Round_Down

                              Allocates to variable %NewVar% thevalue of 6 in round terms

 

               Back to Table of Contents

 

 

          Message

 

               Shows a message box

 

                              Syntax:

                    Message,<Text>,[<Title>],[<Timeout>]

 

                                                            Text        -              Text in message box

                                                           Title        -              Title of message box

                                                                                         Information           shows symbol Information

                                                                                         Confirmation         shows symbol Question mark

                                                                                         Error                     shows symbol Error

                                                                                         Question               shows a button YES/NO

                                                                                         Warning                shows symbol Warning

                                                           Timeout  -              Display duration of box in seconds

 

                              Examples:

                              Message,Hallo World,Information,10

 

                              Message,Continue?,Question

                              If,%Exitcode%,=,Yes,Then,Message,Button YES has been pressed

                              If,%Exitcode%,=,No,Then,Message,Button NO has been pressed

 

               Back to Table of Contents

 

 

          Pack

 

               Compresses or decompresses a file

 

                              Syntax:

                    Pack,<Packcommand>,[<Filter>]

 

                                            Packcommand     -              Compress            for files with extension ‚.zip’ only

                                                                                         Decompress       for files with extension ‚.zip’ and ‚7z’

                                            Filter                      -              available for Packcommand Decompress only.

                                                                                         Using the char * the filter changes to partial search

                                                                                         (similar to a Wildcard function)

 

                              Examples:

                              pack,compress,C:\Test,C:\Test.zip

                              Compresses the folder Test to ZIP file Test.zip.

 

                              pack,decompress,C:\RegConfig.7z,C:\MyFolder,Win8x86 productoptions.reg

                              Decompresses from 7z file RegConfig.7z file Win8x86 and productoptions.reg.

 

                              pack,decompress,C:\Test.7z,C:\Test,*.pdf

                              Decompresses from  7z-file Test.7z all files with extension pdf.

 

               Back to Table of Contents

 

 

          Return

 

               Quits the called section of a script

 

                              Syntax:

                    Return

 

                        Example:

                        Run,%ScriptFile%,MySection

                              Message,%Arch%

 

                              [MySection]

                              If,%Arch%,=,x64,Then,Return

                              Message,Fitting architecture

 

                        The message box Fitting architecture  is available with Architecture x86 only.

 

               Back to Table of Contents

 

 

          Run

 

               Performs a section in the specified script

 

                              Syntax:

                    Run,<%ScriptFile%>,<Section>,[<PARAMETER>]

 

                                             %ScriptFile%        -              a.            Full path of script

                                                                                         b.            Calling a section in the running script typing

                                                                                                        %ScriptFile% is enough

                                             Section   -                            Section to perform in script

                                             PARAMETER      -              9 Parameters to commit (#1 up to #9)

 

                              Example:

                              Run,%ScriptFile%,MySection,Hallo

 

                              [MySection]

                              Message,#1,Information

 

                              In this example a message box will appear with text Hallo.

 

               Back to Table of Contents

 

 

          Set

 

               Allocates a value to a Variable

 

                              Syntax:

                    Set,<%Variable%>,<Value>,[PERMANENT]

 

                                             Value                     -              any value or path

                                             PERMANENT      -              valid for the whole build, stored in project.cfg

                                                                                         in section [variables]

 

                              Examples:

                              Set,%NewVar%,myPE

                              Allocates to variable %NewVar% the value myPE .

 

                              Set,%NewVar%,myPE,PERMANENT

                              Allocates to variable %NewVar% the value myPE , valid for the whole build.

 

               Back to Table of Contents

 

 

          Setmacro

 

               Creates a macro

 

                              Syntax:

                    Setmacro,<Macroname>,<Command>,[PERMANENT]

 

                                             Macroname          -              any name without %%

                                             Command            -              any valid build command

                                             PERMANENT      -              valid for the whole build, stored in project.cfg

                                                                                         in section [Macros]

 

                        Example:

                              Setmacro,require_file,Run,%ProjectDir%\Macro.srt,Process-ReqSys32,#1,PERMANENT

                        Creates the macro  require_file  with command

                        Run,%ProjectDir%\Macro.srt,Process-ReqSys32,#1,PERMANENT

 

               Back to Table of Contents

 

 

          SetMvar

 

               Creates a macrovariable

 

                              Syntax:

                    SetMvar,<%Variable%>,<Value>

 

                              Example:

                              SetMvar,%MyVariable%,myPE

                              Creates a macrovariable with value myPE.

                              The macrovariable is valid in running script only!

 

               Back to Table of Contents

 

 

          SYSTEM

 

               Command for System settings

 

                              Syntax:

                    System,<Systemcommand>,<Systemparameter>

 

                              Systemcommand:              Error                                    Enables / Disables error messages

                                                                          FreeRam                             Shows free RAM

                                                                          TotalRam                             Shows total RAM

                                                                          GetDate                               Shows Date and Time

                                                                          GetEnv                                reads Environment Variables

                                                                                                                                     Temp

                                                                                                                                     ProgramFiles

                                                                                                                                     Number_Of_Processors

                                                                          GetFreeDrive                      Shows the next free available

                                                                                                                      Drive Letter

                                                                          GetFreeSpace                    Shows the available free Space

                                                                          GetDriveType                      Shows medium’s type

                                                                          Log                                      Enables / deactivates writing of LOG file

                                                                          ProcessMode                     Launches the GUI in Process mode

                                                                          SetPEinit                              Writes an entry in Peinit.ini

                                                                                                                      (see section 2.10)

 

                              Systemcommand (x64 systems only):

                                                                          FileRedirect          Turns FileRedirection (Wow64) for

                                                                                                       64-bit systems on or off

                                                                          RegRedirect         Turns RegRedirection (Wow64) for

                                                                                                       64-bit systems on or off

 

                              Systemparameter:             concerning Error                                On | Off

                                                                          concerning FileRedirect                     On | Off

                                                                          concerning FreeRam                         %Variable%

                                                                          concerning TotalRam                        %Variable%

                                                                          concerning GetDate                          Format   -              %yyyy     - Year               (4-digit)

                                                                                                                                                                  %yy        - Year               (2-digit)

                                                                                                                                                                  %mm     - Month     (2-digit)

                                                                                                                                                                  %dd        - Day               (2-digit)

                                                                                                                                                                  %hh        - Hour               (2-digit)

                                                                                                                                                                  %ii          - Minute    (2-digit)

                                                                                                                                                                  %ss        - Second (2-digit)

                                                                          concerning GetFreeDrive                  %Variable%

                                                                          concerning GetFreeSpace                %Variable%

                                                                          concerning GetDriveType                 Return value

                                                                                                                                     1 -           no Root

                                                                                                                                     2 -           portable Device

                                                                                                                                     3 -           Harddisk

                                                                                                                                     5 -           CDROM

                                                                          concerning SetPEinit          %Variable%,[<Section>]

                                                                          concerning Log                                  On | Off

                                                                                                       Log,On,1               Enables writing of LOG file and

                                                                                                                                     deletes an existing LOG file

                                                                          concerning RegRedirect                    64  | Off

 

                              Examples:

                              System,FILEREDIRECT,On

 

                              System,FILEREDIRECT,Off

 

                              System,REGREDIRECT,64

 

                              System,REGREDIRECT,Off

 

                              System,GETDATE,%yyyy,%Var%

                              Allocates to variable %Var% the current year (four-digit)

 

                              System,GETFREEDRIVE,%FreeLetter%

                              Allocates to variable %FreeLetter% the next available free drive letter.

 

                              System,GETFREESPACE,%Drive%,%Size%

                                             Example:

                                            Set,%Txt%,

                                            For,%Var%,65,90

                                                           Convert,%Drive%,Dec2chr,%Var%

                                                           System,GetFreeSpace,%Drive%:\,%Size%

                                                           If,%Size%,>,0,Then,Set,%Txt%,%Txt% %Drive% - %Size%#$x

                                            Next

                                            String,%Txt%,TRight,%Txt%,2

                              Allocates to ariable %Txt% all partitions with current free space.

                              Notation:

                              65 and 90 are the ASCII values of letters A and Z.

 

                              System,GETDRIVETYPE,%Drive%,%Type%

                                            Example:

                                            Set,%Txt%,

                                            For,%Var%,65,90

                                                           Convert,%Drive%,Dec2chr,%Var%

                                                           System,GetDriveType,%Drive%:\,%Type%

                                                           If,%Type%,=,3,Then

                                                                          System,GetFreeSpace,%Drive%:\,%Size%

                                                                          If,%Size%,>,0,Then,Set,%Txt%,%Txt% %Drive% - %Size% MB#$x

                                                           End

                                            Next

                                            String,%Txt%,TRight,%Txt%,2

                              Allocates to variable %Txt% the free space of the chosen type.

 

                              System,GetEnv,%Var%,ProgramFiles

                              Allocates to variable %Var% the full path of %ProgramFiles%.

 

                              System,GetEnv,%Var%,Temp

                              Allocates to variable %Var% the full path of folder %Temp%.

                              (e.g..: C:\Users\<Username>\AppData\Local\Temp

 

                              System,GetEnv,%Var%,Number_Of_Processors

                              Allocates to variable %Var% the number of processors

 

               Back to Table of Contents

 

 

          Wait

 

               Pauses the script by the specified milliseconds

 

                              Syntax:

                    Wait,<Milliseconds>

 

                              Example:

                              Wait,1000

 

                              (1 second = 1000 milliseconds)

 

               Back to Table of Contents

 

 

          Wim Commands

 

               Commands processing Image files

 

                              Syntax:

                              Wim,<Command>

 

                              Available commands:                       Wim,create

                                                                                         Wim,info                                             <,Path to Image>

                                                                                         Wim,infoEdition                   <,Path to Image>

                                                                                         Wim,Extract,File                 <,Path to Image>

                                                                                         Wim,Extract,Image             <,Path to Image>

                                                                                         Wim,Extract,FileList            <,Path to Image>

                                                                                         Wim,Extract,Image             <,Path to Image>

 

 

                              Path to Image:

                              Win8PE+Win10PE:           -              Usage of var  %Installwim%  (compare section 2.9)

                              Win7PE:                              -              Usage of  %SourceDir%\sources\xyz.wim

 

                              Examples:

                              Wim,Create,lzms,%TargetDir%,%Target_CD%\sources\Boot.wim

                              Compresses Boot.wim using compression method lzms.

 

                              Wim,info,%SourceDir%\sources\install.wim,%WIM_Index%,%ProjectDir\project.cfg

                              Reads the WIM Index from install.wim and writes it in project.cfg.

 

                              Wim,infoEdition,,%SourceDir%\sources\install.wim,pScrollBox1,%ProjectDir%\Build\0-PreConfig.srt

                              Writes the Source Edition in file 0-PreConfig.srt.

 

                              Wim,Extract,File,%SourceDir%\sources\install.wim,%WIM_Index%,#1,%InstallSRC%

                              Extracts the file with parameter #1 to %InstallSRC%.

 

                              Wim,Extract,Image,%SourceDir%\sources\install.wim,%WIM_Index%,#1,%InstallSRC%

                              Extracts the content of a determined WIM Index from Install.wim to %InstallSRC%.

 

               Wim,Extract,FileList,%SourceDir%\Sources\Install.wim,%WIM_Index%,%ProjectTemp%\Instwim.txt,%Basedir%\Wim\%OS%%SourceEdition%%arch%%SP%%Distlang%-I\%WIM_Index%

                              Extracts to the target directory files based on the content of Instwim.txt.

 

                              Wim,Extract,Image,f:\boot.wim,f:\test5\

                              Extracts boot.wim to directory test5.

 

               zurück zum Inhaltsverzeichnis

 

 

          Update

 

               Refreshes the variable data memory

 

                        Syntax:

                    Update,<Parameter>,[ScriptDir]

 

                              Parameter:          ProjectVar             all variables from project.cfg, section [variables] will be

                                                                                         loaded into the variable data memory

                                                           InterfaceVar          variables from section [Interface] of any script will be

                                                                                         loaded into the variable data memory

                                                           Project                  all scripts will be loaded again

                                                           Project,ScriptDir                  script directory will be loaded again

 

                              Examples:

                              Update,ProjectVar

                              Update,InterfaceVar

                              Update,Project

                              Update,Project,Apps\%pTextBox111%.srt

 

               Back to Table of Contents

 

 

2.2.    Programmable Conditions (If Conditions)

 

          If,…,Then

 

                              Syntax:

                    If,<Condition>,Then,<Command>

 

                              Negative Syntax:

                    If,Not,<Condition>,Then,<Command>

 

                              Available Conditions:                      ExeRunning

                                                                                         ExistFile

                                                                                         ExistDir

                                                                                         ExistSection

                                                                                         ExistRegKey

                                                                                         ExistWebFile

                                                                                         SrtChecked

                                                                                         =             (equal)

                                                                                         <             (smaller)

                                                                                         >             (bigger)

 

                              Examples:

                              If,%Var%,=,1,Then,Message,Value is equal 1

                              This message will be shown only if value of %Var% is equal 1.

 

                              If,3,>,2,Then,Message,3 is bigger than 2

                              This message will be shown always as 3 is bigger than 2.

 

                              If,ExistFile,%ScriptDir%\test.exe,Then,Message,File does exist

                              This message will be shown only if test.exe does exist.

 

                              If,ExistDir,C:\Programs,Then,Message,Directory does exist

                              This message will be shown only if directory C:\Programs does exist.

 

                              If,Not,ExistDir,C:\Intel,Then,Message,Directory does not exist

                              This message will be shown if directory C:\Intel does NOT exist.

 

                        If,ExistRegKey,HKLM,PE-SYSTEM\ControlSet001\Services\i8042prt\Parameters,EnableWheelDetection,Then,Message,Value exists

                              This message will be shown if value EnableWheelDetection does exist in mentioned key.

 

                              If,ExistSection,%target_win%\TXTSETUP.SIF,SourceDiskFiles,Then,Message,Section does exist

                              This message will be shown if section SourceDiskFiles does exist in file TXTSETUP.SIF .

 

                              If,ExistRegKey,HKLM,PE-SYSTEM\ControlSet001\Services\i8042prt\Parameters,Then,Message,Key exists

                              This message will be shown if the complete RegKey does exist.

 

                              If,EXISTREGKEY,HKLM,PE-SYSTEM\ControlSet001\Services\i8042prt\Parameters,,Then,Message,exists

                              This message will be shown if value (Default) does exist in mentioned key.

 

                              If,SrtChecked,Build\8-HW-pnp.srt,Then,Message,Script is enabled

                              This condition prooves if the script has been enabled.

 

                              If,ExistWebFile,http://www.xyz.com/xyz.zip,Then,Message,File is available

                              This message will be shown only if xyz.zip is available.

 

                              If,ExeRunning,vmware.exe,Then,Message,VMware is already running

                              This message will be shown only if VMware is already running.

 

                              Tip to multiline notation:

                              This notation is also possible:

 

                              If,%Var%,=,1,Then

                                            Message,Value is 1

                              End

 

                              Using this notation the command END is ALWAYS necessary !

 

               Back to Table of Contents

 

 

          If,…,Then,…,Else-Block

 

               All above mentioned conditions can also be used as EITHER – OR Block

 

                              Syntax:

                    If,<Condition>,Then

                              <Command_#1>

                    Else

                              <Command_#2>

                    End

 

                              Examples:

                              If,ExistDir,C:\Intel,Then

                                            Message,Directory does exist

                              Else

                                            Message,Directory does not exist

                              End

                              This condition shows either the first or the second message depending on the result.

 

                              If,%Var%,=,1,Then

                                            Message,Value is equal 1

                              Else

                                            Message,Value is not equal 1

                              End

                              Same result as written above.

 

                              Combination with NOT is also possible.

                              Example:

                              If,Not,%Var%,=,1,Then

                                            Message,Value is unequal 1

                              Else

                                            Message,Value is equal 1

                              End

 

               Back to Table of Contents

 

 

2.3.    Conditions for Directories, Files and Interfaces

2.3.1.           Directories

 

          DirCopy

 

               Copies the content of a folder into another folder

 

                              Syntax:

                        DirCopy,<SourceFolder>,<TargetFolder>

 

                              Example:

                              DirCopy,C:\MyFolderC:\MyOtherFolder

                              Copies the content of C:\MyFolder to C:\MyOtherFolder.

                              If the targetfolder does not exist it will be created.

 

               Back to Table of Contents

 

 

          DirRemove

 

               Deletes a directory

 

                              Syntax:

                    DirRemove,<FolderToDelete>,[recursive]

 

                              Recursive:          1             deletes folders and subfolders

                                                           0             default value, deletes only the subfolders

 

                        Examples:

                              DirRemove,C:\MyFolder,1

                              Deletes the folder C:\MyFolder and all subfolders.

 

                              DirRemove,C:\MyFolder\MySubfolder,0

                              Deletes only the subfolder MySubfolder.

 

                              Possible syntax if no subfolder does exist:

                              DirRemove,C:\MyFolder,0

 

               Back to Table of Contents

 

 

          DirMove

 

               Moves a directory

 

                              Syntax:

                              DirMove,<FolderToMove>,<TargetFolder>

 

                              Example:

                              DirMove,C:\MyFolder,C:\MyOtherFolder

                              Moves the content of C:\MyFolder  to C:\MyOtherFolder.

                              The origin folder will be deleted.

 

               Back to Table of Contents

 

 

          DirMake

 

               Creates a folder

 

                              Syntax:

                    DirMake,<NewFolder>

 

                              Example:

                              DirMake,C:\MyFolder

                        Creates the new folder C:\MyFolder.

 

               Back to Table of Contents

 

 

2.3.2.           Files

            2.3.2.1.        Conditions for Files

 

          FileCopy

 

               Copies a single source file to a specified destination

 

                        Syntax:

                    FileCopy,<SourceFile>,<TargetFolder>

 

                              Example:

                              FileCopy,C:\MyFolder\MyFile.txt,C:\MyOtherFolder

                              Copies the file MyFile.txt from C:\MyFolder  to C:\MyOtherFolder.

                              Wildcards (*.*) are supported.

 

               Back to Table of Contents

 

 

          FileDelete

 

               Deletes a single file

 

                              Syntax:

                    FileDelete,<File>

 

                              Example:

                              FileDelete,C:\MyFolder\MyFiletxt

                              Deletes the specified file.

 

               Back to Table of Contents

 

 

          FileRename

 

               Renames an existing file

 

                              Syntax:

                    FileRename,<OldFilename>,<NewFilename>

 

                              Example:

                              FileRename,C:\MyFolder\MyFile.txt,C:\MyFolder\MyNewFile.txt

                              Renames the file MyFile.txt to MyNewFile.txt

 

               Back to Table of Contents

 

 

          FileCreateBlank

 

               Creates an empty file (an existing same-titled file will be deleted)

 

                              Syntax:

                    FileCreateBlank,<NewFile>,[<CharacterSet>]

 

                                            CharacterSet        (optional)               -              ANSI

                                                                                                                       Unicode

                                                                                                                      UTF-8

 

                              Examples:

                              FileCreateBlank,C:\MyFolder\test.txt

                              Creates in the specified folder the empty file test.txt

 

                              FileCreateBlank,C:\MyFolder\test.txt,utf8

                              Creates in the specified folder the empty file test.txt with charset UTF-8

 

               Back to Table of Contents

 

 

          FileRead

 

               Reads the whole content of a file into a variable

 

                              Syntax:

                    FileRead,<%Variable%,<File>,[Counter]

 

                              Counter:              -              optional parameter (number of chars to read)

 

                              Examples:

                              FileRead,%Var%,C:\MyFolder\test.txt

                              Reads the whole content of test.txt  into variable %Var%.

 

                              FileRead,%Var%,C:\MyFolder\test.txt,20

                              Reads 20 chars of the content of test.txt  into variable %Var%.

 

                              Possible action when cursor is placed undesired at the begin of a blank line:

                              (%Var%=C:\MyFolder\test.txt)

                              String,%Result%,RIGHT,%Var%,2

                              If,%Result%,=,#$x,Then,String,%Var%,TRIGHT,%Var%,2

                              Sets the cursor next to the last existing char.

 

               Back to Table of Contents

 

 

          FileSetAttrib

 

               Changes attributes of a file

 

                              Syntax:

                    FileSetAttrib,<File>,<Attribute>,[<Parameter>]

 

                              Available Attributes:                        R            ReadOnly

                                                                                         A            Archive

                                                                                         S            System

                                                                                         H            Hidden

                                                                                         N            Normal

                                                                                         O            Offline

                                                                                         T             Temporary

 

                              Parameter:                                        1             Recursive

 

                              Using Wildcards (*) is possible.

                              Attributes will be changed by using  +  or 

 

                              Examples:

                              FileSetAttrib,C:\MyFolder\test.exe,+RS

                              FileSetAttrib,C:\MyFolder\*.doc,+RS

                              FileSetAttrib,C:\MyFolder\*.doc,-H

 

                              FileSetAttrib,C:\MyFolder\,+H

                              Changes the attribute of a single folder.

 

                              FileSetAttrib,C:\MyFolder\,+H,1

                              Changes the attribute of a folder with all included subfolders.

 

               Back to Table of Contents

 

 

          CopyFile

                            

               Copies a file from Sourcefolder to Targetfolder.

               This command is suitable for projects Win7PE, Win8PE and Win10PE.

               Note:

                              The command SetReqFile has to be used previously to define directories and parameters

 

                              Syntax:

                    CopyFile,<File>,[Mode]

 

                              Modus                  0             -              w/o .mui file

                                                           1             -              with .mui file + Fallback en-US

                                                           2             -              with .mui file w/o Fallback en-US

 

                              Example:

                              SetReqFile,%boot_sys%,%DistLang%,%target_sys%

                              CopyFile,drivers\acpi.sys,1

                              CopyFile, atmlib.dll

                              Copies the file drivers\acpi.sys to %target_sys%.

                              Copies the file drivers\acpi.sys.mui to %target_sys%\%DistLang%.

                              Copies the file atmlib.dll to %target_sys%.

 

               Back to Table of Contents

 

 

          CopyOrExpand

 

               Copies a file and expands it if neseccary

 

                              Syntax:

                    CopyOrExpand,<File>,<TargetfolderOrTargetname>

 

                              Example:

                              CopyOrExpand,C:\MyFolder\MyFile.txt,C:\MyFolder\MyNewFile.txt

                              In this example CopyOrExpand  will first try to copyC:\MyFolder\MyFile.txt.

                              If the file can’t be found then CopyOrExpand  will try to expand

                              C:\MyFolder\MyFile.tx_ .

 

               Back to Table of Contents

 

 

          Expand

 

               Extracts all files inside a CAB file

 

                              Syntax:

                    Expand,<CAB_File>,<TargetFolder>,[<Filter>]

 

                              Filter                                   Expands a single file or multiple files, separated using char :

 

                              The Targetfolder has to exist and will NOT be created automatically.

 

                              Examples:

                              Expand,C:\MyFolder\MyFile.cab,C:\MyNewFolder

                              Extracts all files inside MyFile.cab  to C:\MyNewFolder.

 

                        Expand,%source_sys%\%SPCabFile%,%target_sys%\drivers,aec.sys:agp440.sys

                        Extracts in Project WinXPE from CAB file (e.g.: SP3.cab) the files

                        aec.sys and agp440.sys to %target_sys%\drivers.

 

                        Expand,%source_sys%\%SPCabFile%,%target_sys%

                        Extracts in Project WinXPE from CAB file (e.g.: SP3.cab) the file

                        bthci.dll to %target_sys%.

 

               Back to Table of Contents

 

 

          ReqFile

 

               Verifies if the file already exists in target. If not so the file will be copied from Sourcefolder to Targetfolder.

               This command is suitable for projects Win7PE, Win8PE and Win10PE.

               Note:

                              The command SetReqFile has to be used previously to define directories and parameters

 

                              Syntax:

                    ReqFile,<File>,[Mode]

 

                              Mode                    0             -              no .mui file

                                                           1             -              with .mui file + Fallback en-US

                                                           2             -              with .mui file w/o Fallback en-US

 

                              Example:

                              SetReqFile,%Install_sys%,%DistLang%,%target_sys%

                              ReqFile,accessibilitycpl.dll,1

                              ReqFile,control.exe

                              Copies the file accessibilitycpl.dll to %target_sys%.

                              Copies the file accessibilitycpl.dll.mui to %target_sys%\%DistLang%

                              Copies the file control.exe to %target_sys%.

 

               Back to Table of Contents

 

 

          Require_File

 

               Verifies if the file already exists in target. If not so the file will be copied from Sourcefolder to Targetfolder.

               This command is used in project WinXPE.

 

                              Syntax:

                    Require_File,<File>

 

                              Example:

                              Require_File,shell32.dll

                              Copies the file shell32.dll  to %target_sys%.

 

               Back to Table of Contents

 

 

          Retrieve

 

               Query of special file informations

 

                              Syntax:

                    Retrieve,<%Variable%,<Parameter>,<FolderOrFile>,[Param2],[Param3]

 

                              Parameter           -              DirSize

                                                                          FileSize

                                                                          FileVersion

                                                                          MD5

                                                                          ResStr                  (Resources string)

                                                                          FileArch                (for EXE files only)

 

                                            ResStr only:                       Param2                 optional [shows LCID (locale identifiers)]

                                                                                         Param3                 optional  [shows resource number]

 

                        Examples:

                              Retrieve,%Var%,DirSize,C:\MyFolder

                        Allocates to variable %Var%  the size of MyFolder .

 

                        Retrieve,%Var%,FileArch,C:\Windows\explorer.exe

                        Allocates to variable %Var%  the architecture of explorer.exe .

                              ONLY EXE files are supported.

 

                        Retrieve,%Var%,MD5,C:\boot.ini

                        Allocates to variable %Var%  the MD5 sum of file boot.ini .

 

                        Retrieve,%Var%,ResStr,C:\Windows\system32\shell32.dll, 00000409,21771

                        Allocates to variable %Var%  the value Documents and Settings .

 

               Back to Table of Contents

 

 

          Search         File

 

               Searches for a file. Wildcards are supported

 

                              Syntax:

                    Search,<%Variable%>,<Parameter>,<Directory>,<Filename>

 

                              Parameter           -              File                        searches in chosen directory for files with same

                                                                                                       file extension

                                                                          FileRec                 recursive search for maximum 2000 files

 

                              Beispiel:

                              [Interface.07]

                              pScrollBox3=,1,0,0,20,270,215,20

                             

                              [Script-Select]

                              search,%Var%,File,%ISODir%,*.iso

                              Interface,set,pScrollBox3,%Var%

                              Searches for an existing chosen file in  %ISODir%  and updates the element

                              pScrollBox3  e.g. with following line:

                              [Interface.07]

                              pScrollBox3=Win7[SP0]_de-DE_x86.iso,1,0,0,20,270,215,20,Win7[SP0]_de-DE_x86.iso

 

               Back to Table of Contents

 

 

          SetReqFile

 

               Defines the directories and parameters for commands Copyfile and Reqfile

 

                              Syntax:

                    SetReqFile,<SourceFolder>,%DistLang%,<TargetFolder>

 

                              SourceFolder     -                            any folder

                              %DistLang%       -                            Directory in System32 with localized language file (MUI)

                              TargetFolder       -                            any folder

 

                              Example:

                              SetReqFile,%boot_sys%,%DistLang%,%target_sys%

                              Defines %boot_sys% as source folder and %target_sys% as target folder.

 

                              (See also the explanations of commands Copyfile and Reqfile)

 

               Back to Table of Contents

 

 

          ShellExecute

 

               Starts a program or a file

 

                              Syntax:

                    ShellExecute,<Action>,<File>,[Parameter],[WorkingDir]

 

                              Action                                 -              Show/Open           Process will be shown

                                                                                         Hide                      Process will be hidden

 

                              Parameter                          -              optional set of switches

 

                              WorkingDir                         -              optional

 

                              Examples:

                              ShellExecute,Show,C:\Windows\system32\cmd.exe

                              This command opens a console window.

 

                              Note:

                              The command ShellExecute  in a script effects the script to wait for the end of the launched

                              file / program. Afterwards the remaining lines in script will be executed.

 

               Back to Table of Contents

 

 

          Start

 

               Starts a program without waiting

 

                              Syntax:

                    Start,<File>,[Parameter],[WorkingDir]

 

                              Example:

                              Start,%Windowsdir%\Notepad.exe,%ScriptFile%,%WindowsDir%

                              This command opens the running script with program Notepad.

 

               Back to Table of Contents

 

 

2.3.2.2.        Word Processing

 

          TXTAddLine

 

               Adds a line inside a file

 

                              Syntax:

                    TXTAddLine,<File>,<Text>,<Parameter>

 

                              Parameter                          -              Top                        adds line as first line

                                                                                         Bottom                  adds line as last line

                                                                                         Line number         (first line = 0)

 

                              Example:

                              TXTAddLine,C:\MyFile.txt,My new Line,Top

                              Adds to MyFile.txt  the line My new Line  as first line.

                              If the file does not exist it will be created.

 

               Back to Table of Contents

 

 

          TXTReplace

 

               Renames an existing text

 

                              Syntax:

                    TXTReplace,<File>,<OldText>,<NewText>

 

                              Example:

                              TXTReplace,C:\MyFile.txt,My old Line,My new Line

                              Replaces in MyFile.txt  the line My old Line  by My new Line.

                              If the file does not exist an empty file will be created.

 

               Back to Table of Contents

 

 

          StrFormat

 

               Returns some parts of a path name

 

                              Syntax:

                    StrFormat,<%Variable%>,<Parameter>,<File>

 

                              Parameter                          -              FILENAME           File name

                                                                                         PATH                    File path

                                                                                         EXT                      File extension

                                                                                         SHORTPATH       Path in format DOS 8.3

 

                              Examples:

                              StrFormat,%Var%,FILENAME,C:\boot.ini

                              Allocates to variable %Var%  the value boot.ini .

 

                              StrFormat,%Var%,PATH,C:\boot.ini

                              Allocates to variable %Var%  the value C: .

 

                              StrFormat,%Var%,EXT,C:\boot.ini

                              Allocates to variable %Var%  the value ini .

 

                              StrFormat,%Var%,SHORTPATH,C:\MyNewFile.txt

                              Allocates to variable %Var%  the value C:\MYNEWF~1.TXT  as far as the file does exist.

 

               Back to Table of Contents

 

 

          2.3.2.3.        INI Processing

 

          IniWrite

 

               Writes a value in a section of an INI file

 

                              Syntax:

                    IniWrite,<File>,<Section>,<Key>,<Value>

 

                              Example:

                              IniWrite,C:\LiveSystempro\LiveSyspro.ini,Main,Project,Win7PE

                              Creates in file LiveSyspro.ini  in section [Main]  the entry Project=Win7PE

 

               Back to Table of Contents

 

 

          IniWriteSection

 

               Creates a new section in an INI file with optional text settings.

               Entries will be written one below the other.

 

                              Syntax:

                    IniWriteSection,<File>,<Section>,[Text]

 

                              Examples:

                              IniWriteSection,C:\LiveSystempro\LiveSyspro.ini,NewSection,

 

                              Creates in file LiveSyspro.ini  the section [NewSection].

                              The final comma is an optional comma, thus this notation is also possible:

                              IniWriteSection,C:\LiveSystempro\LiveSyspro.ini,NewSection

 

                              IniWriteSection,C:\LiveSystempro\LiveSyspro.ini,NewSection,MyKey

                              Creates in file LiveSyspro.ini  the section [NewSection]  with entry

                              MyKey.

 

                              If the INI file does not exist it will be created.

 

               Back to Table of Contents

 

 

          IniDeleteSection

 

               Deletes an existing section inside an INI file

 

                              Syntax:

                    IniDeleteSection,<File>,<Section>

 

                              Example:

                              IniDeleteSection,C:\LiveSystempro\LiveSyspro.ini,NewSection

                              Deletes in file LiveSyspro.ini  the section NewSection.

 

               Back to Table of Contents

 

 

          IniRead

 

               Reads the value of a key from a section inside an INI file

 

                              Syntax:

                    IniRead,<%Variable%>,<File>,<Section>,<Key>

 

                              Example:

                              IniRead,%Var%,C:\LiveSystempro\LiveSyspro.ini,Main,Project

                              Allocates to variable %Var%  the value of Project .

 

               Back to Table of Contents

 

 

          IniReadPos

 

               Reads either the value of a key or the key of a value

 

                        Syntax:

                    IniReadPos,<%Variable%>,<File>,<Section>,<Parameter>,<Position>

 

                              Parameter           Count                    reads the number of defined entries in an INI file

                                                           KeyPos                 reads the Key in a defined line                         (Result=Value)

                                                           Value                     reads the Value                                                 (Result=Key)

                                                           ValuePos              reads the Value in a defined line                       (Result=Key)

 

                              Position                                             line number (ValuePos and KeyPos only)

 

                              Examples:

                              IniReadPos,%Var%,C:\MyFile.ini,MySection,Value,1

                              Allocates to variable %Var%  the Key whose value is 1 .

 

                              IniReadPos,%Var%,C:\MyFile.ini,MySection,ValuePos,2

                              Allocates to variable %Var%  the Key from line 2  .

 

                              IniReadPos,%Var%,C:\MyFile.ini,MySection,KeyPos,2

                              Allocates to variable %Var%  the Value of key from line 2  .

 

                              INI file  C:\Lang.ini  with following content:

                                            [Section]

                                            Key_1=german

                                            Key_2=English

                                            Any text

                                            Key_3=french

                              IniReadPos,%Var%,C:\Lang.ini,Section,count

                              Allocates to variable %Var%  the value  3 (number of defined INI lines)

 

               Back to Table of Contents

 

 

          IniRenameSection

 

               Renames an existing section inside an INI file