Topic: New PECMD source  (Read 35244 times)

New PECMD source
« on: April 15, 2013, 05:16:34 PM »

Doberman

  • Jr. Chef
  • **
  • Date Registered: Oct 2011
  • Posts: 84
I propose to discuss some of the commands, the translation into other languages, case PECMD.exe.
To start offering a new version of the source code Pecmd.exe (x32x64).
If it is of interest:
The following example will show messages using some commands.

http://www.mediafire.com/?a1qg28w34gzwzbh

Re: New PECMD source
« Reply #1 on: April 26, 2013, 01:02:55 PM »

ohlalavina

  • Apprentice
  • *
  • Date Registered: Apr 2013
  • Posts: 8
Thank your post  :thumbsup:

Re: New PECMD source
« Reply #2 on: April 24, 2015, 01:50:59 PM »

Doberman

  • Jr. Chef
  • **
  • Date Registered: Oct 2011
  • Posts: 84
New English Version (x86,x64).

Contain a built-in Help in English.

http://www.mediafire.com/download/5mlva5wo82gobc5/Pecmd%28Eng%29.7z

Re: New PECMD source
« Reply #3 on: April 29, 2015, 04:22:41 AM »

SIW2

  • Code Baker
  • Chef
  • ***
  • Date Registered: Jul 2012
  • Posts: 197
Latest pecmd x64 english

* PECMDx64-1201.88.05.59.zip (594.86 kB - downloaded 509 times.)

Re: New PECMD source
« Reply #4 on: May 06, 2015, 12:27:00 AM »

SIW2

  • Code Baker
  • Chef
  • ***
  • Date Registered: Jul 2012
  • Posts: 197
88.05.60 new version 5/5/15 en x86 and x64

* pecmds88.05.60-en-5-5-15.zip (1100.93 kB - downloaded 501 times.)

88.00.02 stable en x86 and x64

* pecmd88.00_x86_x64_en.zip (916.01 kB - downloaded 358 times.)
« Last Edit: May 06, 2015, 01:51:04 AM by SIW2 »

Re: New PECMD source
« Reply #5 on: May 09, 2015, 05:50:33 PM »

SIW2

  • Code Baker
  • Chef
  • ***
  • Date Registered: Jul 2012
  • Posts: 197
1. Mount wim with PECMD (needs wimgapi)

MOUN [!] [Wim file name],<Mount directory>,[Image ID],[WimFltr temporary working directory]

e.g mount read only:

PECMD MOUN C:\boot.wim,C:\MOUNT,1

e.g. mount r/w must specify temp directory

PECMD MOUN C:\boot.wim,C:\MOUNT,1,%TEMP%

2. Unmount

Omit Wim file name to unmount, image ID non-zero to save changes , image ID zero to discard changes.

e.g unmount discard changes

PECMD MOUN ,C:\MOUNT,0

e.g. unmount save changes

PECMD MOUN ,C:\MOUNT,1
« Last Edit: May 09, 2015, 05:52:05 PM by SIW2 »

Re: New PECMD source
« Reply #6 on: May 10, 2015, 08:44:38 AM »

Doberman

  • Jr. Chef
  • **
  • Date Registered: Oct 2011
  • Posts: 84
Hi SIW2! :thumbsup:

Is it possible to mount on Imdisk (Read only)?

Re: New PECMD source
« Reply #7 on: May 10, 2015, 06:16:15 PM »

SIW2

  • Code Baker
  • Chef
  • ***
  • Date Registered: Jul 2012
  • Posts: 197
Yes, it should be possible.

Something like this perhaps:

PECMD RAMD ImDisk,L125,NTFS,B:,Ramdisk

Then you can mount read only to B:

Re: New PECMD source
« Reply #8 on: May 11, 2015, 02:52:57 AM »

SIW2

  • Code Baker
  • Chef
  • ***
  • Date Registered: Jul 2012
  • Posts: 197
New version 09/05/15 english

* PECMD88.05.61_x86_x64_en.zip (1100.57 kB - downloaded 418 times.)

Re: New PECMD source
« Reply #9 on: May 18, 2015, 04:27:27 AM »

SIW2

  • Code Baker
  • Chef
  • ***
  • Date Registered: Jul 2012
  • Posts: 197
* pecmd-help-and-demosX64.zip (2776.2 kB - downloaded 401 times.)

Re: New PECMD source
« Reply #10 on: May 20, 2015, 03:47:49 AM »

SIW2

  • Code Baker
  • Chef
  • ***
  • Date Registered: Jul 2012
  • Posts: 197
* pecmd-88.05.61-18-05-15x64.zip (2763.77 kB - downloaded 512 times.)


* pecmd-88.05.61-18-05-15x86.zip (2513.28 kB - downloaded 432 times.)

Re: New PECMD source
« Reply #11 on: May 20, 2015, 07:15:54 AM »

Atari800xl

  • Code Baker
  • Sr. Chef
  • ****
  • Date Registered: Feb 2013
  • Posts: 827
Thanks for the updates, SIW2. I do appreciate it, even when there's not a lot of reaction.

To be honest, I still don't know exactly how to experiment with PECMD, but I would love to try and do some testing. Let's say I have a fully "clean", unchanged MS PE, from one of the latest kits, what is the best way to incorporate PECMD in something like that? Is there any documentation that describes such a simple (?) and basic step? Does it even work that way?
Also, is there any basic documentation/ promo on what PECMD actually does, and why it's so great? Some entry-level stuff maybe?

Re: New PECMD source
« Reply #12 on: May 20, 2015, 04:13:38 PM »

SIW2

  • Code Baker
  • Chef
  • ***
  • Date Registered: Jul 2012
  • Posts: 197
It is a pre shell,essentially a command interpreter.

Load it first then it can call call winpeshl, create shortcuts,register components,install drivers,etc.
It also provides explorer support and hooks into the start controls to provide shudown/reboot functions.

Typically you replace winpe system hive cmdline entry E.G when building pe if you have loaded winpe system hive as PE_SYS

Code: [Select]
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\PE_SYS\Setup]
"CmdLine"="PECMD.EXE MAIN %Windir%\\system32\\PECMD.INI"


Then pecmd will start up first and carry out the instructions you have put in your winpe %windir%\system32\pecmd.ini.


Typical example pecmd.ini:  ( Have bolded commands so easier to see - can't use codebox for that )

////////////////////////////////////////////////////////////////////////////////////////////////
_SUB OSD
     // set resolution
    DISP W1024 H768 B32 F60
    //pull up a wallpaper during setup phase
     LOGO %Windir%\Web\Wallpaper\Windows\img0.jpg
    //display a message on desktop
     TEXT SIW2 PE3.1x64 WELCOME... L30 T330 R740 B400 $24*
      // call winpeshl.exe      note: winpeshl.ini should contain the line wpeinit
    EXEC winpeshl.exe
     // call ux64.exe (for win7 theme support,ux.exe not needed for win8/10 )
     EXEC Ux64.EXE
     // Tells pecmd to init on taskbar and load usb drives
     INIT I,U 4000
     // shows all drives including hidden and assigns letters automatically
     SHOW -1:-1
     // create shortcuts
    LINK %Desktop%\Backupper,x:\Program Files\Aomei\Backupper.exe
     LINK %StartMenu%\Install\WinNtSetup,x:\Program Files\WinNTSetup_x64.exe
    LINK %Startmenu%\Install\Setup,x:\setup.exe

     // PINT ,Startmenu or ,Taskband for pin to                 
     PINT %SystemRoot%\explorer.exe,Startmenu
     PINT %SystemRoot%\regedit.exe,Startmenu
     PINT %SystemRoot%\system32\notepad.exe,Taskband
    PINT x:\Program Files\QTWeb\QTWeb.exe,Taskband
     PINT x:\Program Files\PENetwork\PENetwork.exe,Taskband

  _END
////////////////////////////////////////////////////////////////////////////////////////////////
_SUB LoadShell
// start network NDISWAN. EXEC =command means wait till it has finished. EXEC !command means execute silenltly.
    EXEC @!=netcfg.exe -e -c p -i MS_NDISWAN
// Shell execute use CALLwith leading $  (similar to regsvr32)     
     CALL $%WinDir%\SysWOW64\Macromed\Flash\*.dll
_END
////////////////////////////////////////////////////////////////////////////////////////////////
_SUB FINSET
// new text on desktop
     TEXT SIW2 Loading Desktop... L430 T30 R740 B400 $24*
     WAIT 300

// TEAM COMMAND1|COMMAND2|COMMAND3     
     TEAM SHEL %SystemRoot%\explorer.exe|WAIT 500|LOGO
     WAIT 300

//Delete a reg entry     
     REGI $HKLM\SOFTWARE\PELOGON\hotkey1!
// Call regedit to merge a reg file     
     EXEC =REGEDIT /S %CurDir%\PECUSTOM.REG
//Delete the annoying ini files on desktop
     FILE %public%\desktop\desktop.ini
    FILE X:\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Internet Explorer.lnk
     FILE X:\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessories
     FILE X:\Users\Default\Desktop\desktop.ini

//start a service     
     SERV MpsSvc
     WAIT 300

//install driver     
     DEVI %WinDir%\inf\hdaudio.inf
     DEVI %WinDir%\inf\net*.inf 
     WAIT 2000

     //Bubble Tip
    TIPS FOR WIRELESS,RUN PENETWORK,,1,,#1
     //wait so tips keep showing for 5 secs
     WAIT 5000
     //Remove message from desktop
     TEXT
_END
////////////////////////////////////////////////////////////////////////////////////////////////
CALL OSD
CALL LoadShell
CALL FINSET
« Last Edit: May 28, 2015, 05:22:21 PM by SIW2 »

Re: New PECMD source
« Reply #13 on: May 20, 2015, 06:49:30 PM »

Atari800xl

  • Code Baker
  • Sr. Chef
  • ****
  • Date Registered: Feb 2013
  • Posts: 827
SIW2, thank you so much for taking the time to describe PECMD in easy to understand terms like you did!
Thinking of PECMD as a "command interpreter" as you said, makes it so much easier for me to understand how this tool actually works.
Thanks for your step-by-step guide as well, I'm looking forward to testing this as soon as possible, looks like a nice summer project as well.


Re: New PECMD source
« Reply #14 on: May 21, 2015, 07:16:14 AM »

Atari800xl

  • Code Baker
  • Sr. Chef
  • ****
  • Date Registered: Feb 2013
  • Posts: 827
SIW2, if I where to do some testing with "bare metal" PE versions (like the ones from the MS kits), is there anything special I should take into account? Or can I use your example for any PE version? Thanks!

Re: New PECMD source
« Reply #15 on: May 21, 2015, 10:55:09 AM »

SIW2

  • Code Baker
  • Chef
  • ***
  • Date Registered: Jul 2012
  • Posts: 197
You would need to look at pecmd.ini.

E.G If explorer.exe is not in the pe, (and it isn't in standard pe supplied by MS ), then you won't get far trying to launch explorer.exe as the shell.

In the above example we launched explorer.exe

TEAM SHEL %SystemRoot%\explorer.exe|WAIT 500|LOGO

If you want to experiment with standard pe, there isn't a great deal that is useful as a shell, cmd.exe, possibly notepad.exe.

You could just drop explorer++.exe in system32 of winre.wim or boot.wim from the dvd.

https://explorerplusplus.com/

TEAM SHEL %Windir%\System32\explorer++.exe|WAIT 500|LOGO





« Last Edit: May 21, 2015, 11:00:26 AM by SIW2 »

Re: New PECMD source
« Reply #16 on: May 21, 2015, 12:43:39 PM »

Atari800xl

  • Code Baker
  • Sr. Chef
  • ****
  • Date Registered: Feb 2013
  • Posts: 827
Aah, so PECMD only supports explorer when it's in the PE. I thought maybe PECMD would take care of explorer integration by itself. So that assumption was wrong (at least I've learned that now).

So then my question would be: Of all the PECMD users, which solution do they use to get the "normal" explorer/ desktop into their PE's?
Is there a "standard" way of doing it, or does PECMD not care at all if you've implemented explorer into your PE or not?

Re: New PECMD source
« Reply #17 on: May 21, 2015, 04:58:31 PM »

SIW2

  • Code Baker
  • Chef
  • ***
  • Date Registered: Jul 2012
  • Posts: 197
They will either build their own winpe by hand, like I do, or they use something like winbuilder.

PECMD does not build winpe for you. It is used to load and control the winpe you have built.

An earlier pecmd is included in the winbuilder projects, though it is only there to provide explorer support ( allows to kill explorer.exe - which refreshes everything) and start menu hooking. I think Chris leaves it up to the end user to configure their own pecmd.ini which you can add instead of the very very very basic one he put in.

PECMD can replace all of these and any other bits and bobs winbuilder has for loading/controlling.

Win7PE.cfg
AU3381.exe
autorun.cmd
Autorun.exe
MountPEmedia.exe
MountPEmedia.ini
MountStorPE.exe
PEnet.exe
PinTool.exe
shortcuts.exe
ShutdownPE.exe
ShutdownPE.ini
StartImDisk.exe
« Last Edit: May 21, 2015, 04:59:05 PM by SIW2 »

Re: New PECMD source
« Reply #18 on: May 21, 2015, 05:50:45 PM »

Atari800xl

  • Code Baker
  • Sr. Chef
  • ****
  • Date Registered: Feb 2013
  • Posts: 827
I appreciate your explanations very much, SIW2!

Re: New PECMD source
« Reply #19 on: May 28, 2015, 12:20:21 AM »

SIW2

  • Code Baker
  • Chef
  • ***
  • Date Registered: Jul 2012
  • Posts: 197
New verison. Included Original and English.

* PECMD88.05.62-26-05-15x64-EN.7z (2290.07 kB - downloaded 351 times.)

* PECMD88.05.62-26-05-15x86-EN.7z (2156.97 kB - downloaded 344 times.)

EDIT: Hold up, Davies has just released another version dated 28/5/15.

As far as I can tell, it is not a "bug" . I think he is fiddling with new functions you are not likely to use - something to do with undeleting gpt partitions,I think. Difficult for me to understand for certain what he is doing.
« Last Edit: May 28, 2015, 05:04:23 PM by SIW2 »

 

Powered by EzPortal