trtkron

Member
  • Content count

    24
  • Joined

  • Last visited

Community Reputation

0 Neutral

About trtkron

  1. Recopy the wim back onto the drive. I get this every now and then if the file doesn't finish copying (i've gotten in the habit of "safely remove hardware" so it doesn't happen anymore)
  2. Probably whatever libraries are referenced in the project? In the past, I had used comdl32 and comtrl, but I ended up dropping those and just using direct API calls to avoid the extra baggage of missing libraries. Whats the point of slimming down the CD and then stuff a bunch of DLLs and OCXs back in?
  3. You are probably looking for these. wpeutil SetKeyboardLayout wpeutil SetMuiLanguage wpeutil SetUserLocale WPEUtil Command Line Options
  4. That last post reminded me of something... In my code I do this. Check for cable being present. If it is then Check for IP if no IP then Restart network adapters check for IP Public Function CheckForIP() As Boolean 'have IP and have gateway means you have IP. ' 169. triggers as ipenabled so have to check gateway Dim oNetworkAdapterConfigurationSet As WbemScripting.SWbemObjectSet Dim oNetworkAdapterConfiguration As WbemScripting.SWbemObject On Error Resume Next Set oNetworkAdapterConfigurationSet = GetObject("winmgmts:root\CIMV2").ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly) For Each oNetworkAdapterConfiguration In oNetworkAdapterConfigurationSet If Not IsNull(oNetworkAdapterConfiguration.DefaultIPGateway) Then CheckForIP = True End If Next Set oNetworkAdapterConfiguration = Nothing Set oNetworkAdapterConfigurationSet = Nothing Exit Function End Function A a snip on checking if the cable is plugged in. There is a WMI call for checking cable plugged in, but it doesn't work in PE (Or at least didn't last time I checked) FYI, TokenRing doesn't return .Speed, so I have different checks for that... but who else is still using that? After checking for a cable, I restart the card (because I change it's mac address to a specific range, identfying it) then ipconfig /setclassid for a specific dhcp class we use for winpe devices (which, btw does a renew on it's own). Then I check for gateway, no gateway then we use WMI to renew one more time. Set oNetworkAdapterSet = GetObject("winmgmts:root\CIMV2").ExecQuery("SELECT Description, Index, MACAddress, Speed FROM Win32_NetworkAdapter WHERE AdapterTypeID = 0", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly) For Each oNetworkAdapter In oNetworkAdapterSet If IsNull(oNetworkAdapter.Description) Or IsNull(oNetworkAdapter.MACAddress) Or IsNull(oNetworkAdapter.Speed) Then 'bad card Else If Int(Right$(oNetworkAdapter.Speed, 2)) Mod 10 = 0 Then bNetworkCableConnected = True End If End If Next End If Set oNetworkAdapter = Nothing Set oNetworkAdapterSet = Nothing If bNetworkCableConnected Then ShellAndWait "DEVCON RESTART =NET", vbHide ShellAndWait "IPCONFIG /SETCLASSID * WINPE", vbHide Set oNetworkAdapterConfigurationSet = GetObject("winmgmts:root\CIMV2").ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly) For Each oNetworkAdapterConfiguration In oNetworkAdapterConfigurationSet If IsNull(oNetworkAdapterConfiguration.DefaultIPGateway) Then oNetworkAdapterConfiguration.RenewDHCPLease End If Next Set oNetworkAdapterConfiguration = Nothing Set oNetworkAdapterConfigurationSet = Nothing
  5. I meant to always come back and add this, the code to fix an image to work on non-intel CPU's (When the master image was from an Intel. Sysprep doesn't remove CPU information). Public Sub FixNonIntelCPU() 'removes the "intelppm" driver from the registry and the file from sys32\drivers if the CPU is not an intel Dim oProcessorSet As WbemScripting.SWbemObjectSet Dim oProcessor As WbemScripting.SWbemObject Dim sCPUType As String Dim oFileSystem As Scripting.FileSystemObject On Error GoTo Error_ Set oProcessorSet = GetObject("winmgmts:root\CIMV2").ExecQuery("Select Manufacturer from Win32_Processor", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly) For Each oProcessor In oProcessorSet sCPUType = Trim$(oProcessor.Manufacturer) Next Set oProcessor = Nothing Set oProcessorSet = Nothing Select Case sCPUType Case "GenuineIntel" 'do nothing, the setup works for Intel's already Case "AuthenticAMD", "GenuineTMx86", "CentaurHauls" 'AMD, Transmeta, and Via C7M for OQO Set oFileSystem = New Scripting.FileSystemObject If oFileSystem.FileExists("C:\WINDOWS\SYSTEM32\DRIVERS\INTELPPM.SYS") Then oFileSystem.DeleteFile "C:\WINDOWS\SYSTEM32\DRIVERS\INTELPPM.SYS", True End If If oFileSystem.FileExists("W:\WINDOWS\SYSTEM32\DRIVERS\INTELPPM.SYS") Then oFileSystem.DeleteFile "W:\WINDOWS\SYSTEM32\DRIVERS\INTELPPM.SYS", True End If Set oFileSystem = Nothing ShellAndWait "REG LOAD HKLM\PRIOS W:\WINDOWS\SYSTEM32\CONFIG\SYSTEM", vbHide ShellAndWait "REG DELETE HKLM\PRIOS\ControlSet001\Services\intelppm /f", vbHide ShellAndWait "REG DELETE HKLM\PRIOS\ControlSet002\Services\intelppm /f", vbHide ShellAndWait "REG DELETE HKLM\PRIOS\ControlSet003\Services\intelppm /f", vbHide ShellAndWait "REG UNLOAD HKLM\PRIOS", vbHide ShellAndWait "REG LOAD HKLM\ALTOS C:\WINDOWS\SYSTEM32\CONFIG\SYSTEM", vbHide ShellAndWait "REG DELETE HKLM\ALTOS\ControlSet001\Services\intelppm /f", vbHide ShellAndWait "REG DELETE HKLM\ALTOS\ControlSet002\Services\intelppm /f", vbHide ShellAndWait "REG DELETE HKLM\ALTOS\ControlSet003\Services\intelppm /f", vbHide ShellAndWait "REG UNLOAD HKLM\ALTOS", vbHide Case Else 'Unknown CPU dPrint ("Uknown CPU Detected : " & sCPUType) End Select Exit Sub Error_: ReportError Err.Number, Err.LastDllError, Err.Description, Erl, True, "FixNonIntelCPU" End Sub
  6. Here is one more suggestion, it is what I use to check the memory of a device and if its too low, to create a pagefile. Private Declare Sub GlobalMemoryStatus Lib "kernel32" (lpBuffer As MEMORYSTATUS) Private Type MEMORYSTATUS dwLength As Long dwMemoryLoad As Long dwTotalPhys As Long dwAvailPhys As Long dwTotalPageFile As Long dwAvailPageFile As Long dwTotalVirtual As Long dwAvailVirtual As Long End Type Public Sub CheckMemory() Dim MS As MEMORYSTATUS MS.dwLength = Len(MS) GlobalMemoryStatus MS lPhysicalRAM = MS.dwTotalPhys / 1024 ^ 2 If lPhysicalRAM < 320 Then If FolderExists("I:\") Then ShellAndWait "WPEUTIL CreatePageFile /path=I:\pagefile.sys /size=256", vbHide If Not FileExists("I:\pagefile.sys") Then ShellAndWait "WPEUTIL CreatePageFile /path=I:\pagefile.sys", vbHide End If ElseIf FolderExists("H:\") Then ShellAndWait "WPEUTIL CreatePageFile /path=H:\pagefile.sys /size=256", vbHide If Not FileExists("H:\pagefile.sys") Then ShellAndWait "WPEUTIL CreatePageFile /path=H:\pagefile.sys", vbHide End If Else MsgBox "This machine does not meet the minimum memory requirements and a USB device can not be located to create a pagefile.", vbOKOnly + vbCritical, "Critical Error" End If End If End Sub And for freeing up memory, I just stop a couple of services, gives back (if memory serves) about 4MB of RAM. ShellAndWait "WPEUTIL DisableFirewall", vbHide ShellAndWait "NET STOP MPSSVC", vbHide ShellAndWait "NET STOP IKEEXT", vbHide ShellAndWait "NET STOP EVENTLOG", vbHide
  7. This won't fit perfectly for you as-is, but this is part of the script I use for CD stuff. I set the cdrom drive with the cdname "WINPE" to G: If the drive is ready and is a cdrom drive, has a volumename and that name is "WINPE" then {if the drive is not G: but G: exists, then move G: via diskpart to another letter} create a text file selecting the drive via drive letter and assign it to be G:, via diskpart. Set oFileSystem = New Scripting.FileSystemObject For Each vDrive In oFileSystem.Drives If vDrive.IsReady Then If vDrive.DriveType = 4 Then If LenB(vDrive.VolumeName) <> 0 And vDrive.VolumeName = "WINPE" Then If vDrive.DriveLetter <> "G" Then If FolderExists("G:\") Then ShellAndWait "DISKPART /S X:\WINDOWS\SYSTEM32\NU2MENU\REMOVEG.TXT", vbHide End If If (Not FolderExists("G:\")) And LenB(vDrive.DriveLetter) <> 0 Then Dim oFileWrite As TextStream Set oFileWrite = oFileSystem.CreateTextFile("X:\WINDOWS\TEMP\FIXCD.TXT", True) oFileWrite.WriteLine "SELECT VOLUME " & vDrive.DriveLetter oFileWrite.WriteLine "ASSIGN LETTER=G" oFileWrite.Close Set oFileWrite = Nothing ShellAndWait "DISKPART /S X:\WINDOWS\TEMP\FIXCD.TXT", vbHide End If End If End If End If End If Next
  8. You can use peimg /inf=<path> on prep'd images. You don't have to work any magic. It works just fine. As for user interface, my company has two that I developed. The PE batch file calls our "loader" that sets all the drive letters how I want them, discovers cdrom drives, stop services, creates a pagefile if needed and then kicks of the primary frontend. This front end has options for all of our images, has links to the basic utils like regedit and notepad and other stuff like some remote admin tools. It sets mac addresses (still use these), gets ip, finds the closest imaging server and does its bit. Has a lot of guts to it, but works great for us. We have about 15 different PC models in service right now, (Desktop, Laptop and Tablet) and they run from the same wim file that is about 1.1GB. The shell does all the HAL magic, injects drivers based on what model the PC is and also stages applications to the imaged PC to be installed after it comes out of sysprep. It is all just a simple VB6 app, added 0 dll's to the machine to run the app, just "devcon" to better control devices since I like using it better then reinventing the wheel with win32 calls. I think people have some basic UI's out there driven by HTA or other simple GUI's. The loader and shell we use has been in used since about a year ago and it has been an amazing tool versus the old ghost/pqi + maintaing 15+ images.
  9. I know that nonSP1 did not have the Intel NIC driver for these devices (PCI\VEN_8086&DEV_10BD) and SP1 added support since the first sp1 beta of the waik. I have had 0 issues with these models gettting IP on the first try.
  10. Need to load the video hook driver. For me, I have it (raddrv.dll), AdmDll.dll, and r_server.exe in \windows\system32. Only files you need. R_server service never works (r_server /service), but call the application straight up and works fine. This reg file has the system hive loaded to hklm\sys. Just add this. You can have the wpeinit batch file (whatever it is called) just start r_server.exe and it will work for you. Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\sys\ControlSet001\Services\raddrv] "Type"=dword:00000001 "Start"=dword:00000001 "ErrorControl"=dword:00000001 "ImagePath"=hex(2):5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,\ 74,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,72,00,61,\ 00,64,00,64,00,72,00,76,00,2e,00,64,00,6c,00,6c,00,00,00 "DisplayName"="raddrv" [HKEY_LOCAL_MACHINE\sys\ControlSet001\Services\raddrv\Security] "Security"=hex:01,00,14,80,90,00,00,00,9c,00,00,00,14,00,00,00,30,00,00,00,02,\ 00,1c,00,01,00,00,00,02,80,14,00,ff,01,0f,00,01,01,00,00,00,00,00,01,00,00,\ 00,00,02,00,60,00,04,00,00,00,00,00,14,00,fd,01,02,00,01,01,00,00,00,00,00,\ 05,12,00,00,00,00,00,18,00,ff,01,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,\ 20,02,00,00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,0b,00,00,00,00,\ 00,18,00,fd,01,02,00,01,02,00,00,00,00,00,05,20,00,00,00,23,02,00,00,01,01,\ 00,00,00,00,00,05,12,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00 [HKEY_LOCAL_MACHINE\sys\ControlSet001\Services\raddrv\Enum] "Count"=dword:00000000 "NextInstance"=dword:00000000 "INITSTARTFAILED"=dword:00000001
  11. I have the very same model of PC under my desk right now. Sp1 version of PE2 has those drivers integrated already. I'm using build 6001-16659-070916-1443 of PE. With the non sp version, you can always just peimg /inf=path_to_intel_driver path_to_pe
  12. http://msdn2.microsoft.com/en-us/library/ms791349.aspx Turn that on too, so that flushes happen right away, I had an issue once where I was chasing the wrong thing because of when the flush happened (on a certain machine using the unified, I have to pull out usbport.inf, let it go through setup, then put it back in and devcon install the usb ports)
  13. My unified works fine on the M52, but not the M52e. Only PC to date I couldn't get it to load on (works on about 40 other models). The TPM is not the issue at all. I don't have a M52 hooked up to look, is that a ICH7 device? I know on a couple of models of IBM (Lenovo) I had to go get an updated Intel Chipset (just ICH7 and IMSM) to get it working. Turn boot logging on and see if it creates a log file. If it does, problem isn't storage, it is something else. If it doesn't get created ... re -bmsd your master image with updated chipset inf data for that specific model, see if that resolves it.
  14. For machines that I know only have 256, I just keep a handful of old 128-256MB flash drives around that I use to create pagefiles on. A VB script runs to check memory and stops a handful of services and then looks for the flash drive to create the page file, if it doesn't have it... produces a reminder to plug a drive in. I couldn't find any other way around that 256 limit, some machines make it further then others, but all 256's eventually die during some point of the imaging process
  15. After you have made edit's, export the file into a new file. imagex /export /compress maximum boot.wim * boot.new