{"id":886,"date":"2013-11-01T03:45:25","date_gmt":"2013-11-01T03:45:25","guid":{"rendered":"http:\/\/www.isunshare.com\/blog\/?p=886"},"modified":"2023-11-24T07:02:56","modified_gmt":"2023-11-24T07:02:56","slug":"detailed-explanation-for-pecmd-in-winpe-pecmd-ini-file-configuration-1","status":"publish","type":"post","link":"https:\/\/www.isunshare.com\/blog\/detailed-explanation-for-pecmd-in-winpe-pecmd-ini-file-configuration-1\/","title":{"rendered":"Detailed Explanation of PECMD in WinPE&#8212;-PECMD.INI File Configuration ( 1 )"},"content":{"rendered":"<p>At present, most domestic WinPE systems are supported by a core software which is pecmd.exe (referred to a command line interpretive program), and there are more than 70 items in it.<br \/>\n1. Command category<br \/>\n1.1 Commonly used command line<br \/>\n1.2 Window controls, subroutine command<br \/>\n1.2.1 System variables<br \/>\nCurDir &#8212;- Current Directory<br \/>\nDesktop &#8212;- Desktop<br \/>\nFavorites &#8212;- Favorites<br \/>\nPersonal &#8212;- My Documents<br \/>\nPrograms &#8212;- Programs<br \/>\nSend To &#8212;- Sent To<br \/>\nStart &#8212;- Start Menu<br \/>\nStartup &#8212;- Automatic Operation<br \/>\nQuick Launch &#8212;- Quick Launch Bar<br \/>\nSystem Driver &#8212;- System Partition<br \/>\nSystem Root &#8212;- System Folder<br \/>\n1.2.2 Commonly used controls<br \/>\nComboBox, Button, Picture, CheckBox, HotKey, PopupMenu, Progress, BarGroup, Static, Timer, Radio, CHEK, Menu, LABE, EDIT, GROU, IMAG, ITEM, MEMO, PBAR, TIME, RADI<br \/>\n1.3 Character string, character control<br \/>\nLPOS, LSTR, MSTR, RPOS, RSTR, STRL<br \/>\n1.4 Window, subroutine sign<br \/>\n_END, _SUB<br \/>\n1.5 Commonly used commands<br \/>\nBROW, CALC, CALL, DATE, DEVI, DISP, EJEC, ENVI, EXEC, EXIT, FBWF, FDIR, FDRV, FEXT, FILE, FIND, FONT, FORX, HELP, HKEY, HOTK, IFEX, INIT, KILL, LINK, LIST, LOAD, LOGO, LOGS, MAIN, MD5C, MENU, MESS, MOUN, NAME, NUMK, PAGE, PATH, RAMD, REGI, RUNS, SEND, SERV, SHEL, SHOW, SHUT, SITE, SUBJ, TEAM, TEMP, TEXT, TIPS, UPNP<\/p>\n<p>[_SUB]<br \/>\nFormat: _SUB &lt;sub-process name&gt; or _SUB &lt;window name&gt;, &lt;window shape&gt;, [window title], [window event], [window icon], [window type]<br \/>\nFunction: define a sub-process or define a window.<br \/>\nParameters:<br \/>\n\u25a0 Sub-procedure name: character string<br \/>\n\u25a0 Window name: character string. Window name should be unique and can not be same as other control names or environment variable names.<br \/>\n\u25a0 Window title: text<br \/>\n\u25a0 Window shape: window position and size. The format is &lt;LTWH&gt;, in which L stands for Left, T for Top, W for Width, H for Hight. And all of them are numerical values. Besides, if the Left and Top are omitted, the window will be centered.<br \/>\n\u25a0 Window event: The command is executed when closing the window. And it must be a command supported by PECMD.EXE.<br \/>\n\u25a0 Window icon: icons in the window title bar and taskbar. Its format is &lt; icon file name # ID&gt;<br \/>\n\u25a0 Window type: [ &#8211; ] [ # ] [ value ]. &#8221; &#8211; &#8221; stands for no title bar, &#8220;# &#8221; for the chromeless window, and value for transparency. Moreover, value higher than 99 is hidden window.<br \/>\nExample:<br \/>\n\u25c6 _SUB DoLoop<br \/>\n\u25c6_SUB Windows1, W360H440, PECMD function demonstration, EXEC $instructions, TXT,%IconFile%#19,20<br \/>\nRemarks :<br \/>\n\u203b The first character of sub-process name or window name can not be a &#8220;$&#8221;. And there must be a space between the command keyword _SUB and the sub-process name or window name.<br \/>\n\u203b If there are multiple _SUB commands, names used for defining the commands can not be repeated and approximated. These names can not be set as environment variables.<br \/>\n\u203b This command must come in pair with _END command. And both of them can not be used in the command line. For other information, please refer to the illustration of _END command and CALL command.<br \/>\n\u203b To set the window title, you can use the &#8220;ENVI @window name=window title&#8221;. Please make reference to the explanation of ENVI command.<\/p>\n<p>[_END]<br \/>\nFormat : _END<br \/>\nFunction: End sub procedure or window definition.<br \/>\nParameters:<br \/>\n\u25a0 No<br \/>\nExample:<br \/>\n\u25c6 _END<br \/>\nRemarks :<br \/>\n\u203b When defining sub-process\u2019s _SUB command and _END command, they must be a separate line. In other words, the FIND, IFEX, TEAM commands can not defined\u00a0 sub-process within them. http:\/\/www.dabaicai.com\/<br \/>\n\u203b The command between _SUB and _END ( i.e. sub-process ) can only be executed by the corresponding CALL command, while the main process will skip these commands.<br \/>\n\u203b _END command must match with _SUB command, and the sub-process can not define sub-process within it.<br \/>\n\u203b The sub-process placed at any position of the configuration file can be called by CALL command in the same configuration file. And it is suggested to put it at the beginning of the file.<br \/>\n\u203b This command and _SUB command can only be used in the configuration file, and can not be used in the command line.<\/p>\n<p>[BROW]<br \/>\nFormat : BROW &lt;variable name&gt;, [[* | &amp;]initial path], [tip text], [extensions]<br \/>\nFunction: Browse disk files and directory.<br \/>\nParameters:<br \/>\n\u25a0 Variable Name: variable name used for saving the browse result<br \/>\n\u25a0 Initial Path: Default the selected files or directory for the browser window. When this parameter is omitted, it will locate to the system default path. Moreover, leading character &#8220;*&#8221; represents directory browse dialog, the leading character &#8220;&amp; &#8221; stands for save file dialog, and omitting the leading character means open file dialog.<br \/>\n\u25a0 Tip Text: It can be omitted. When it is omitted, the default text is the system default tip text.<br \/>\n\u25a0 Extension: Browse the specified file\u2019s extension. If it is omitted, the file represents all files.<br \/>\nExample:<br \/>\n\u25c6 BROW Boot_Ini, C: \\ Windiws \\ BOOT.INI, please select a file, INI<br \/>\n\u25c6 BROW Tag, * C: \\ Windiws, please select a directory<br \/>\nRemarks :<br \/>\n\u203b This command opens a file directory browsing dialog box, allowing users to browse the disk file directory. And the user can select certain file or directory.<br \/>\n\u203b Selection result will be saved in the specified process environment variable. Example 2 can be referenced through the environment variable %Tag%.<br \/>\n\u203b BROW command must be executed after the INIT command or on the desktop .<\/p>\n<p>[CALC]<br \/>\nFormat : CALC [#] &lt;variable 0&gt;&lt;=&gt;&lt;variable 1&gt;&lt;operator&gt; &lt;variable 2&gt;<br \/>\nFunction: Operate &#8220;variable 1&#8221; and &#8220;variable 2&#8221; as &#8220;operator &#8220;, and store the operation result in the &#8220;variable 0&#8221;.<br \/>\nParameters:<br \/>\n\u25a0 Leading character &#8220;#&#8221; indicates that all variables are managed according to int data type. If the leading character is omitted, it indicates that all variables are managed according to double data type.<br \/>\n\u25a0 &#8220;Variable 1&#8221; and &#8220;variable 2&#8243; can be specific values, or existing variables.<br \/>\n\u25a0 &#8221; Operator&#8221; currently only supports four kinds of operations including\u00a0 &#8220;+ &#8220;, &#8221; &#8211; &#8220;, &#8220;* &#8220;, &#8220;\/ &#8220;.<br \/>\nExample:<br \/>\n\u25c6 Add operation: CALC #Sum = 128 + 32 or CALC Sum =%Datum1% +%Datum2%<br \/>\n\u25c6 Multiplication: CALC #Result = 128 * 64 or CALC Result =%Datum1% * %Datum2%<br \/>\nRemarks:<br \/>\n\u203b &#8220;Variable 1&#8221; or &#8220;variable 2&#8221; can be directly set by ENVI command (referred to assignment), or be the result of assignment operated by CALC command.<br \/>\n\u203b When &#8220;variable 1&#8221; or &#8220;variable 2&#8221; has no assignment, it can be processed as value &#8220;0&#8221;. To complete complex four arithmetic operation, you can use a series of CACL commands.<br \/>\n\u203b When CACL command uses double type variables to process data, up to four decimal places can be reserved. Moreover, to compare the numerical size, IFEX command can be used.<\/p>\n<p>[CALL]<br \/>\nFormat : CALL &lt;$DLL name&gt;, [function], [[#]parameter 1], [[#]parameter 2], [[#]parameter 3], [[#]parameter 4] or CALL &lt;process&gt; or CALL &lt;@ window&gt;<br \/>\nFunction : Calling DLL function or subprocess.<br \/>\nParameters:<br \/>\n\u25a0Leading character &#8220;$&#8221; indicates calling DLL functions, specifying DLL path, function name and parameters. If the function name is omitted, &#8220;DllRegisterServer&#8221; will be called, and parameters are defaulted as UNICODE string. If the leading character of parameters is &#8220;#&#8221;, it indicates integer. And up to four function parameters are supported.<br \/>\n\u25a0 Leading character &#8220;@&#8221; indicates calling a window defined by the _SUB command. Don\u2019t execute CALL @another window in the window defined by the _SUB command.<br \/>\n\u25a0If the leading character &#8220;$&#8221; is omitted, it indicates calling sub-process, and the parameters are the names of subprocesses.<br \/>\nExample:<br \/>\n\u25c6 Call DLL function: CALL $ SHELL32.DLL, DllInstall, # 1, U<br \/>\n\u25c6 Call window procedure: CALL @ Window1<br \/>\n\u25c6 Call subprocess: FIND MEM&gt; 127, CALL EXPLORER_SHELL! CALL CMD_SHELL<br \/>\nRemarks :<br \/>\n\u203b Call DLL functions : Functions in DLL must be exported in the way of STDCALL. (If you do not understand what it means, you can take it as no problem.)<br \/>\n\u203b Call window procedure: When using CALL\u2019s leading character &#8220;@ &#8221; to call a window, the execution of the commands after CALL command will be suspended until the window is closed.<br \/>\n\u203bCall subprocess: CALL command can only invoke sub-processes in the same configuration file, and its function of calling sub-process can not be used in the command line. As for other information, please refer to illustration of _SUB and _END commands.<\/p>\n<p>[CHEK]<br \/>\nFormat : CHEK &lt; check box name &gt;, &lt; check box shape &gt;, [ check box title ], [ check box event ], [ check box state ]; Function: Establish a check box control in a window defined by _SUB.<br \/>\nParameters:<br \/>\n\u25a0 Check box name: string. The check box name should be unique, and can not be same as other controls\u2019 names or environment variables\u2019 names.<br \/>\n\u25a0 Check box shape: check box\u2019s location and size. Format : &lt;LTWH&gt;.\u00a0 L stands for Left, T for Top, W for Width, H for Hight. And all of them are numerical values.<br \/>\n\u25a0 Check box Title: It is the text on the check box, and the text is used to describe the check box\u2019s function or description.<br \/>\n\u25a0 Check box event: When clicking the check box, the command executed must be a valid command supported by PECMD.<br \/>\n\u25a0 Check box state: numbers. 1 or -1 stands for checked state, 0, 2 or -2 for not checked state, and less than 0 for gray unavailable state.<br \/>\nExample:<br \/>\n\u25c6 CHEK Check1, L180T336W100H20, writable mount , 1<br \/>\nRemarks :<br \/>\n\u203b CHEK command must locate between _SUB command and _END command. CHEK command located at other places is invalid. Please refer to the descriptions of _SUB and CALL commands.<br \/>\n\u203b Environment variables: %check box name% is the check box title. To set the title, you can use &#8220;ENVI @check box name=check box title&#8221; .<br \/>\n\u203b Use &#8220;ENVI @check box name. Check=numerical value&#8221; to set the check box checked state. If the value is 0, the check box state is not checked state. While non-zero value represents checked state.<br \/>\n\u203b Use &#8220;ENVI @check box name. Enable=numerical value&#8221; to set the check box\u2019s available state. 0 stands for disabled state, while non-zero value represents available state.<\/p>\n<p>[DATE]<br \/>\nFormat : DATE [ variable name ]; Function: Return to the current date and time of system<br \/>\nParameters:<br \/>\n\u25a0 Variable name: save the variable names of system\u2019s current date and time<br \/>\nExample:<br \/>\n\u25c6 DATE SysDate<br \/>\nRemarks :<br \/>\n\u203b The result is saved as &#8221; Year &#8211; Month &#8211; Day | Week | Hour: Minute: Second&#8221; in the specified variable. To remove the &#8221; date&#8221; or &#8220;time&#8221; , please use string processing commands of PECMD (LPOS, RPOS, LSTR, MSTR, RSTR) to deal with.<br \/>\n\u203b If the &#8221; variable names &#8221; is omitted, the result is stored in the environment variable %CurDate%. Then the example results may be &#8220;2008-8-8 | 5 | 20:8:8&#8221;.<\/p>\n<p>[DEVI]<br \/>\nFormat : DEVI [$] &lt;CAB path&gt;<br \/>\nFunction: Find (and install ) driver from a CAB file or the specified folder.<br \/>\nParameters:<br \/>\n\u25a0Specified CAB file path. The leading character &#8220;$&#8221; means installing the driver after extracting driver file. Otherwise, do not install the driver.<br \/>\nExample:<br \/>\n\u25c6 DEVI %SystemRoot% \\ DRV.CAB<br \/>\nRemarks:<br \/>\n\u203b This command uses the custom driven search algorithm (rather than the system\u2019s), which can quickly extract the drive programs that may be used. Therefore , a device can search for multiple drivers.<br \/>\n\u203b In the CAB , put each driver in a separate directory, and ensure that the INF file in CAB is always located at the beginning of the current directory. Meanwhile, the INF file in CAB must be processed. And it is recommended to use matching program XCAB to make.<br \/>\n\u203b INF files are extracted to the &#8220;%SystemRoot%\\INF&#8221; directory, SYS files are extracted to %SystemRoot%\\SYSTEM32\\DRIVERS directory, and other files are extracted to %SystemRoot%\\SYSTEM32 directory.<br \/>\n\u203b If other files need to be extracted to specified directories, you can use &#8220;#&#8221; in the file name to replace directory separators. For example, the file, &#8220;SYSTEM32#WBEM#MOF#XXX.MOF&#8221;, will be extracted to the directory of &#8220;% SystemRoot% \\ SYSTEM32 \\ WBEM \\ MOF \\ XXX.MOF&#8221;.<br \/>\n\u203bAnother function of the command: Search drivers in the local disks. e.g. &#8220;DEVI \\ Windows, Display&#8221;. However, this command is not perfect, and it will prompt driver file dialog box. Therefore, this function temporarily provides no technical support.<\/p>\n<p>[DISP]<br \/>\nFormat : DISP [W horizontal resolution H vertical resolution] [B color depth ] [F refresh rate] [T wait(ms)]<br \/>\nFunction : Set the display parameters.<br \/>\nParameters:<br \/>\n\u25a0 Separately specify screen parameters. If omitted, use the original settings.<br \/>\nExample:<br \/>\n\u25c6 DISP W1024 H768 B32 F70 T5000<br \/>\nRemarks :<br \/>\n\u203b The first three sets of parameters can be used alone. For example, to set the refresh rate as 75 , you can use DISP F75 .<\/p>\n<p>[EDIT]<br \/>\nFormat : EDIT &lt; edit box name &gt;, &lt; edit box shape &gt;, [ edit box content ], [ edit box event ], [ edit box type ]<br \/>\nFunction: Establish a single line text edit box in the window defined by _SUB command.<br \/>\nParameters:<br \/>\n\u25a0 Edit box name: String. Edit box name should be unique, and can not be same as other controls\u2019 names or environment variables\u2019 names.<br \/>\n\u25a0 Edit box shape: edit box\u2019s position and size.\u00a0 Format : &lt;LTWH&gt;.\u00a0 L stands for Left, T for Top, W for Width, H for Hight. And all of them are numerical values.<br \/>\n\u25a0 Edit box contents: string. The text filled when initializing the edit box.<br \/>\n\u25a0 Edit box events: The command which is executed by pressing the Enter key in the edit box. And it must be a valid command supported by PECMD.<br \/>\n\u25a0 Edit box type: number. The default value is 0, representing normal edit box; value greater than 0 indicates password input box; value less than 0 means gray disabled edit box.<br \/>\nExample:<br \/>\n\u25c6 EDIT Edit1, L32T244W240H24, C: \\ Windows, ENVI @ Label1 =% Edit1%<br \/>\nRemarks :<br \/>\n\u203b EDIT command must be located between _SUB command and _END command. EDIT command placed at other locations is invalid. Please refer to illustrations of _SUB and CALL commands.<br \/>\n\u203b To set the text in the edit box, you can use &#8220;ENVI @edit box name = text content&#8221;. Please make reference to explanation of ENVI command.<br \/>\n\u203b Use &#8220;ENVI @edit box name. Enable = numerical value&#8221; to set the edit box\u2019s available state. 0 represents unavailable state and non-zero value stands for available state.<br \/>\n\u203b Use &#8220;ENVI @edit box name. ReadOnly =numerical value &#8221; to set the edit box\u2019s read-only status. 0 means non-read-only status, non-zero value is read-only state.<\/p>\n<p>[EJEC]<br \/>\nFormat : EJEC [C-| U-| R:]<br \/>\nFunction: Remove or eject the specified USB or CD ROM drive. The command\u2019s function is not perfect. http:\/\/www.dabaicai.com\/<br \/>\nParameters:<br \/>\n\u25a0 Parameter &#8220;C-&#8221; will eject all possible CD-ROM discs; parameter &#8220;U-&#8221; will remove all possible USB disks.<br \/>\n\u25a0 Parameter &#8220;R:&#8221; will eject or remove the specified CD-ROM disks or USB devices. If it is omitted, all possible CD-ROM disks or USB devices.<br \/>\nExample:<br \/>\n\u25c6 EJEC<br \/>\n\u25c6 EJEC C-<br \/>\n\u25c6 EJEC U-<br \/>\n\u25c6 EJEC H:<br \/>\nRemarks :<br \/>\n\u203b This command is used in PE whose system tray has no U disk management icon. For PE whose system tray has U disk management icon, it is suggested to use system tray icon.<br \/>\n\u203b This command can not be used in the configuration file. The INIT command with &#8220;I&#8221; parameter will install the command\u2019s function in the tray icon menu.<\/p>\n<p>[ENVI]<br \/>\nFormat : ENVI [$ | @ | *] [ name ] [ [ = ] value ]<br \/>\nFunction: Set or clear environment variables.<br \/>\nParameters:<br \/>\n\u25a0 Specified the name and value of environment variable. If the leading character is omitted and a value is not specified, the environment variable is a variable whose specified name is deleted. .<br \/>\n\u25a0 Leading character &#8221; $ &#8221; means setting system-level environment variable. Without it, the command can only set the program\u2019s internal used environment variable ( process level ).<br \/>\n\u25a0\u00a0 Leading character &#8221; @ &#8221; indicates setting the name or title of window control.<br \/>\n\u25a0 Leading character &#8221; * &#8221; (omitting the name and value) represents writing CD-ROM drive letter as CDROM0, CDROM, CDROM1, CDROM2 in system environment variables.<br \/>\nExample:<br \/>\n\u25c6 ENVI TEMP=%SystemDrive%\\TEMP<br \/>\nRemarks :<br \/>\n\u203b If the program executed by &#8220;EXEC&#8221; is used, the program\u2019s environment variables will be automatically inherited. In other words, if a &#8220;$ &#8221; environment variable is set in the configuration file, it will be effective to the &#8220;EXEC&#8221; program behind.<br \/>\n\u203b Under the command prompt, you can use ENVI command without parameters to refresh environment variables.<br \/>\n\u203b When only parameter &#8220;$&#8221; exists, initialize the user folder. Under the command prompt,\u00a0 environment variables can also be refreshed.<\/p>\n<p>[EXEC]<br \/>\nFormat : EXEC [=] [!] [@] [$] [&amp;] &lt;EXE path&gt; [ parameters ]<br \/>\nFunction: Execute EXE, BAT and CMD procedures.<br \/>\nParameters:<br \/>\n\u25a0 Specified program path and parameters. Leading parameters are as follows: (They can be used simultaneously, regardless of the order.)<br \/>\n\u25a0 Leading character &#8220;=&#8221; means waiting for execution completion; the leading character &#8221; ! &#8221; means executing in hidden manner.<br \/>\n\u25a0 Leading character &#8220;@&#8221; means executing in the background Desktop (WinLogon). The execution is completely hidden and can not interact with the user, but it can be used for registration. e.g. &#8220;EXEC@PECMD.EXE CALL $ SHELL32.DLL, DllInstall, # 1, U&#8221;.<br \/>\n\u25a0Leading character &#8220;&amp;&#8221; indicates modifying process shutdown code (articulating &#8220;ExitWindowsEx&#8221; function). It is advised to execute &#8220;EXEC &amp; EXPLORER.EXE&#8221; to modify SHELL shutdown function. In this way, when executing &#8220;Start -&gt; Shut down the system&#8221;, it will run &#8220;PECMD.EXE SHUT&#8221; command to shut down the computer.<br \/>\n\u25a0Leading character &#8220;$&#8221; denotes executing by ShellExecute function to open non-executable files such as TXT, BMP, etc.<br \/>\nExample:<br \/>\n\u25c6 EXEC =! CMD.EXE \/C &#8220;DEL \/Q \/F% TEMP%&#8221;<br \/>\nRemarks :<br \/>\n\u203b SHELL is also loaded through this command.<\/p>\n<p>[EXIT]<br \/>\nFormat : EXIT<br \/>\nFunction: Exit the current subprocess called by CALL command, or exit the configuration file process invoked by the LOAD command.<br \/>\nParameters:<br \/>\n\u25a0 No<br \/>\nExample:<br \/>\n\u25c6 IFEX $%Val%=10, EXIT! ENVI Val =<br \/>\n\u25c6 FIND $%CancelIt% =YES, EXIT! ENVI CancelIt =<br \/>\nRemarks :<br \/>\n\u203b Example 1 indicates exiting the current process when the numerical value of the numerical variable Val is 10.<br \/>\n\u203b Example 2 indicates exiting the current process when CancelIt environment variable is YES.<\/p>\n<p>[FBWF]<br \/>\nFormat : FBWF [P percentage of available memory] [L minimum value] [H maximum value]<br \/>\nFunction : Set the FBWF cache<br \/>\nParameters:<br \/>\n\u25a0 Maximum value and minimum value are MB.<br \/>\nExample:<br \/>\n\u25c6 FBWF P20 L32 H64<br \/>\nRemarks:<br \/>\n\u203b Three parameters can be used alone. For example, FBWF L64 indicates mandatorily setting FBWF of 64M. Moreover, FBWF command must be used behind MOUN command.<\/p>\n<p>[FDIR]<br \/>\nFormat : FDIR &lt; variable name &gt; &lt;= &gt; &lt; file name &gt;<br \/>\nFunction: Return to the directory name (no &#8221; \\ &#8221; at the last) where the specified \u201cfile name\u201d is.<br \/>\nParameters:<br \/>\n\u25a0 Variable name: variable name used to store directory name<br \/>\n\u25a0 File name: valid file name<br \/>\nExample:<br \/>\n\u25c6 FDIR fPath = C: \\ Windows \\ System32 \\ calc.exe<br \/>\n\u25c6 FDIR aPath =% CurDir% \\ Path1 \\ Path2 \\ FileName<br \/>\nRemarks :<br \/>\n\u203b When the file name is a relative path, the return value result is PECMD.EXE working directory or configuration file\u2019s working directory.<br \/>\n\u203b The result of example 1 is &#8220;C: \\ Windows \\ System32&#8221;.<br \/>\n\u203b The result of example 2 is &#8220;% CurDir% \\ Path1 \\ Path2&#8221;.<br \/>\n[FDRV]<br \/>\nFormat : FDRV &lt; variable name &gt; &lt;=&gt; [ file directory name]<br \/>\nFunction: Return to the partition letter (end with &#8220;:&#8221; and no &#8221; \\ &#8221; at the last) where the specified &#8221; file directory name&#8221; is or all system drive letters.<br \/>\nParameters:<br \/>\n\u25a0 Variable name: variable name used for saving partition letter<br \/>\n\u25a0 File name: legitimate file directory name (It can be omitted. When omitted, it has other meaning. Please refer to the &#8220;Remarks&#8221; explanation.)<br \/>\nExample:<br \/>\n\u25c6 FDRV fDrive=C: \\ Windows \\ System32 \\ calc.exe<br \/>\n\u25c6 FDRV AllDrive=<br \/>\nRemarks :<br \/>\n\u203b When the file name is a relative path, the return value result is the partition letter where the PECMD.EXE working directory or configuration file\u2019s working directory is.<br \/>\n\u203b Return all system drive letter when omitting &#8220;file directory name&#8221;. The return value is in the form of C: | D: | E: | F: | &#8230;<br \/>\n\u203b The result of example 1 is &#8220;C:&#8221;, and the result of example is a list of all system drive letters. (Please note that this list is not fixed and will change at any time.)<\/p>\n<p>[FEXT]<br \/>\nFormat : FEXT &lt; variable name &gt; &lt;= &gt; &lt; file name &gt;<br \/>\nFunction: Return to the extension (without &#8220;.&#8221; ) of the specified file name.<br \/>\nParameters:<br \/>\n\u25a0 Variable name: variable name used for saving the extension name<br \/>\n\u25a0 File name: valid file name<br \/>\nExample:<br \/>\n\u25c6 FEXT fExt = C: \\ Windows \\ System32 \\ calc.exe<br \/>\n\u25c6 FEXT aExt = X: \\ Path1 \\ Path2 \\ FileName<br \/>\nRemarks :<br \/>\n\u203b The result of example 1 is &#8220;exe&#8221;, while the result of example 2 is null value.<br \/>\n\u203b The return value of FDIR, FDRV, FEXT can be detected or compared by using FIND command.<\/p>\n<p>[FILE]<br \/>\nFormat : FILE &lt; file path &gt; [ operator ] [ target path ]<br \/>\nFunction : Operate file or directory<br \/>\nParameters:<br \/>\n\u25a0Specified the source file path and destination path, supporting wildcards. You can manipulate multiple files simultaneously with semicolons. Operator &#8221; -&gt; &#8221; and &#8220;=&gt; &#8221; respectively correspond to move and copy, while no operators means deleting operation.<br \/>\nExample:<br \/>\n\u25c6 FILE% SystemRoot% \\ INF \\ *. INF =&gt;% TEMP%<br \/>\nRemarks :<br \/>\n\u203b If a RAMDISK is used to boot the system, you can delete useless file like a 2M NTOSKRNL.EXE after startup to increase writable space of the RAMDISK.<\/p>\n<p>[FIND]<br \/>\nFormat : FIND &lt; condition &gt; [ Command 1 ] [ ! Command 2 ]<br \/>\nFunction : According to whether the conditional expression is established or not, execute command 1 if it is established; execute command 2 if it is not.<br \/>\nParameters:<br \/>\n\u25a0 Condition: judgment for [ total memory ], [ total disk space ], [ key ], [ environment variables ] or [ memory process ]<br \/>\n\u25a0 Total memory: MEM &lt; comparison operator &gt; value<br \/>\n\u25a0 Total disk space: R: \\ &lt; comparison operator &gt; value. \u201cR:\u201d represents the drive letter .<br \/>\n\u25a0 Keys: KEY &lt; comparison operator &gt; value<br \/>\n\u25a0 Memory process: memory process name<br \/>\n\u25a0 Environment variable: $%environment variable name% &lt; comparison operator &gt; environment variable value. The comparison of environment variables is not case-insensitive.<br \/>\n\u25a0 Comparison operator: Comparison operators include &#8220;&lt;&#8220;, &#8220;&gt;&#8221; and &#8220;=&#8221; which respectively indicates &#8221; less than&#8221;, &#8220;greater than&#8221; and &#8220;equal&#8221;.<br \/>\n\u25a0 Numerical values: values used for comparison. The unit for disk and memory is MB, and the key value is the key code.<br \/>\nExample:<br \/>\n\u25c6 FIND MEM &lt;128, SHEL% SystemRoot% \\ SYSTEM32 \\ XPLORER2.EXE! SHELL% SystemRoot% \\ EXPLORER.EXE<br \/>\n\u25c6 FIND $% OUTSIDE% =, ENVI $ OUTSIDE =% CurDrv% \\ external program<br \/>\nRemarks :<br \/>\n\u203b This command is very powerful and complex. It can be used by nesting FIND or IFEX to judge multiple conditions. The function of IFEX command is similar to this command\u2019s.<br \/>\n\u203b The &#8221; , &#8221; after &lt; conditional expression&gt; can be replaced by &#8221; * &#8220;.<br \/>\n\u203b When this command is nesting FIND or IFEX command, the nested command can not use the &#8221; ! &#8221; separator.<br \/>\n\u203b When the FIND command is used to detect keys, if user presses keys of &#8216;A&#8217; ~ &#8216;Z&#8217; or &#8216;0 &#8216; to &#8216;9 &#8216;, the key result will be stored in the environment variable %PressKey%.<\/p>\n<p>[FONT]<br \/>\nFormat : FONT &lt; font path &gt;, [ initial partition ]<br \/>\nFunction : Register font or external font.<br \/>\nParameters:<br \/>\n\u25a0 font file path and the initial partition<br \/>\nExample:<br \/>\n\u25c6 FONT% CurDrv% \\ external program \\ FONT<br \/>\n\u25c6 FONT \\ WINDOWS<br \/>\n\u25c6 FONT \\ WINDOWS, C:<br \/>\nRemarks :<br \/>\n\u203b When commanding the first character as &#8221; \\ &#8220;, this command will start from the specified initial partition to search all fonts under all partitions\u2019 Windows \\ Fonts directory, then install and register. Defining the initial partition can avoid searching existing floppy drives of the computer. If the initial partition is omitted, all partitions in the computer will be searched, including floppy disks.<\/p>\n<p>[FORX]<br \/>\nFormat : FORX [@] [[!] \\] &lt; File &gt;, &lt; variable &gt; , [ value ] , &lt; command &gt; [ parameter, parameter &#8230; ] &lt;% variable% &gt; [ , parameter, parameter &#8230; ] [ , &#8230; ]<br \/>\nFunction: matching file directory corresponding command operations, similar to the function of the command for command of CMD.EXE .<br \/>\nParameters:<br \/>\n\u25a0 File : specified the file directory name which can be with wildcards character<br \/>\n\u25a0 Variable: specified variable name. It can not be the existed environment variable or window control name.<br \/>\n\u25a0 Value: It indicates executing command operation of corresponding number to the matching file directory. 0 or &lt; 0 means executing command operation to all existing files.<br \/>\n\u25a0 Command : PECMD.EXE legitimate and valid command. The parameter format and number after the command are decided by it.<br \/>\nExample:<br \/>\n\u25c6 FORX% CurDir% \\ Path1 \\ *. DLL, AnyDLL, 0, CALL% AnyDLL%<br \/>\n\u25c6 FORX \\ auto *. INF, AutoRunVirus, 0, FILE% AutoRunVirus%<br \/>\n\u25c6 FORX! \\ WinPE \\ WinPE.INI, MyIni, 1, LOAD% MyIni%<br \/>\nRemarks :<br \/>\n\u203b This command can search for the file directory with attributes, such as the hidden attribute file directory.<br \/>\n\u203b Leading character &#8221; \\ &#8221; means searching all partitions. &#8221; ! &#8221; indicates making reverse search for all partitions. In the two leading characters &#8221; [ ! ] \\ &#8220;, the &#8221; ! &#8221; can not exist alone.<br \/>\n\u203b Leading character &#8221; @ &#8221; indicates searching only the directory and making corresponding operation. If &#8221; @ &#8221; is omitted, it means searching only the files and operating accordingly.<br \/>\n\u203b Example 1 means registering all DLL in the directory of %CurDir% \\ Path1 \\.<br \/>\n\u203b Example 2 means deleting auto *. INF file in all partition root directories.<br \/>\n\u203b Example 3 means reversely searching for WinPE.INI in all partitions\u2019 WinPE directories. Then use LOAD command to load the the first WinPE.INI.<\/p>\n<p>[GROU]<br \/>\nFormat : GROU &lt; combination panel name &gt;, &lt; combination panel shape &gt; , [ combination panel title ]<br \/>\nFunction: Establish a combination panel in the window defined by _SUB command, for\u00a0\u00a0 explaining the controls function and role in the combination panel.<br \/>\nParameters:<br \/>\n\u25a0 Combination panel name: String. The combination panel name should be unique, and can not be same as other controls names or environment variables names.<br \/>\n\u25a0 Combination panel shape: combination panel location and size. Its format is&lt;LTWH&gt;, in which L stands for Left, T for Top, W for Width, H for Hight. And all of them are numerical values.<br \/>\n\u25a0 Combination panel title: string used to describe the role and function of the combination panel .<br \/>\nExample:<br \/>\n\u25c6 GROU Group1, L8T4W336H400, register WimShExt.DLL<br \/>\nRemarks :<br \/>\n\u203b GROU command must locate between _SUB command _END command. GROU command placed at other locations is invalid. Please refer to illustrations of _SUB and CALL commands.<br \/>\n\u203b To set the combination panel title, you can use &#8220;ENVI @ combination panel name = combination panel title&#8221;. Pleas make reference to the description of ENVI commands. http:\/\/www.dabaicai.com\/<\/p>\n<p>[HELP]<br \/>\nFormat : HELP [ text foreground color ] [ # text background color ]<br \/>\nFunction: Display help information<br \/>\nParameters:<br \/>\n\u25a0 Value ( supporting hexadecimal )<br \/>\nExample:<br \/>\n\u25c6 HELP 0x00EEFF # 0xFF0000<br \/>\nRemarks :<br \/>\n\u203bDirectly executing the program without command line parameters will display help information as well.<\/p>\n<p>[HKEY]<br \/>\nFormat : HKEY [ modifier keys + ] &lt;# virtual key code &gt; , &lt;hotkey command &gt;<br \/>\nFunction : Set the system hotkey and assign the command executed by the hotkey.<br \/>\nParameters:<br \/>\n\u25a0 Auxiliary keys: 4 modifier keys (Alt, Ctrl, Shift and Win) can be represented as string. Use modifier keys &#8220;+ &#8221; to connect the modifier keys.<br \/>\n\u25a0 Key code: A key is represented by a virtual key code. Hexadecimal values is supported.<br \/>\n\u25a0 Hotkey command: It must be valid command supported by PECMD.<br \/>\nExample:<br \/>\n\u25c6 HKEY # 255, SHUT R<br \/>\n\u25c6 HKEY Ctrl + Alt + # 0x41, DISP W800H600B16F75<br \/>\nRemarks :<br \/>\n\u203b HKEY command must locate between _SUB command and _END command. HKEY command placed at other locations is invalid. Please refer to illustrations of _SUB and CALL commands.<br \/>\n\u203b The first example is calling SHUT command to restart when pressing the power button.<br \/>\n\u203b The set hotkey can not be conflict with hot keys of other programs .<\/p>\n<p>[HOTK]<br \/>\nFormat : HOTK [ modifier keys + ] &lt;# virtual key code &gt;, &lt; command &gt;<br \/>\nFunction :\u00a0 Set the system hotkey and assign the command executed by the hotkey. (. EXE or . CMD or . BAT)<br \/>\nParameters:<br \/>\n\u25a0 4 auxiliary keys can be represented by strings, and other keys by virtual key code. Hexadecimal values is supported.<br \/>\nExample:<br \/>\n\u25c6 HOTK # 255, PECMD.EXE SHUT E<br \/>\n\u25c6 HOTK Ctrl + Alt + # 36, PECMD.EXE<br \/>\nRemarks :<br \/>\n\u203b The first example is calling SHUT command of PECMD to shut down the computer when pressing the power button.<br \/>\n\u203b This command can not be used in the command line. It can only be used in the configuration file. PECMD can set up to 8 groups hot keys.<br \/>\n\u203b The register result of hot keys is in the registry\u2019s &#8220;HKEY_LOCAL_MACHINE \\ SOFTWARE \\ PELOGON&#8221;.<br \/>\n\u203b SHEL command must be behind HOTK command.<br \/>\n\u203b Only by using SHEL command to load SHELL, can you register hot keys by use of HOTK command.<\/p>\n<p>&nbsp;<\/p>\n<p>Related Article:<\/p>\n<ul>\n<li><a title=\"Detailed Explanation for PECMD in WinPE\u2014- PECMD.INI File Configuration (2)\" href=\"https:\/\/www.isunshare.com\/blog\/detailed-explanation-for-pecmd-in-winpe-pecmd-ini-file-configuration-2\/\">Detailed Explanation of PECMD in WinPE&#8212;- PECMD.INI File Configuration (2)<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>At present, most domestic WinPE systems are supported by a core software which is pecmd.exe (referred to a&#8230;<\/p>\n","protected":false},"author":2,"featured_media":126377,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[52],"tags":[],"class_list":["post-886","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-windows-pe"],"_links":{"self":[{"href":"https:\/\/www.isunshare.com\/blog\/wp-json\/wp\/v2\/posts\/886","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.isunshare.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.isunshare.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.isunshare.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.isunshare.com\/blog\/wp-json\/wp\/v2\/comments?post=886"}],"version-history":[{"count":5,"href":"https:\/\/www.isunshare.com\/blog\/wp-json\/wp\/v2\/posts\/886\/revisions"}],"predecessor-version":[{"id":6705,"href":"https:\/\/www.isunshare.com\/blog\/wp-json\/wp\/v2\/posts\/886\/revisions\/6705"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.isunshare.com\/blog\/wp-json\/wp\/v2\/media\/126377"}],"wp:attachment":[{"href":"https:\/\/www.isunshare.com\/blog\/wp-json\/wp\/v2\/media?parent=886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.isunshare.com\/blog\/wp-json\/wp\/v2\/categories?post=886"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.isunshare.com\/blog\/wp-json\/wp\/v2\/tags?post=886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}