Modify startnet.cmd? ZCM 2017 Update 2

We are using ZCM 2017 update 2 to let us use WinPE via USB to restore images on some of our newer devices that aren't loading using the PXE/Linux imaging system (like the latest HP x360 G1, or the HP Stream G4).

I have worked with Novell Support (who have been exceptional) on this, and I'm at the point now where booting to a WinPE USB stick works, and I can cancel the Zenworktodo.exe GUI and then use the command line to take/restore images.

All good, but now I want to make it easier, and script a menu like I have under the PXE/Linux system.

Novell support told me that I can remove the 'zenworktodo.exe' file under C:\Program Files (x86)\Novell\ZENworks\share\tomcat\webapps\zenworks\ext\3PIUtils and then when building the WinPE ISO it will stay at the command prompt.

But how can I add a custom menu/batch file to run? I'm not very fluent in WinPE, sorry. My best guess is to create a batch file menu and then convert it from a bat file to a "zenworktodo.exe" file so it will run. But is there an easier way to somehow modify the startnet.cmd file, so that after the 'wpeinit' I have it call a custom bat file?

Labels (1)
Tags (2)
1 Reply

Ok, Google helped me with this one, and I'm replying to my own post in case others need to know:

Create the WinPE ISO as normal per this guide: https://www.novell.com/documentation/zenworks-2017-update-2/pdfdoc/zen_cm_preboot_imaging/zen_cm_preboot_imaging.pdf, page 168. Then use Rufus or similar tool to burn that ISO to a USB.

Then put USB in drive, it becomes a drive letter (E: in my case). Create empty c:\mount folder.
CD to E:\Sources folder.
E:\Sources>DISM /Mount-WIM /WimFile:E:\sources\boot.wim /index:1 /MountDir:c:\mount
Then go into c:\mount folder, go down to Windows\system32 and modify the 'startnet.cmd' file. Leave wpeinit, but I rem'd out zenworktodo and added DOS commands to do what I wanted.
In my case, the simplest part was just adding two lines:
net use z: \\(zcm2017-server-ip-address)\images
img -restore -local z:\imagename.zmg
But could also have added DOS menu commands too.
Then close and save Startnet.cmd, and close out of the windows explorer window otherwise it won't fully unmount.
E:\Sources>dism /unmount-Wim /MountDir:"c:\mount" /commit

Then boot to that WinPE USB stick, and it should skip the GUI and go straight to the DOS commands to restore the image.

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.