Jump to content

Trouble Running VB script in PE 2.0


dkreifus

Recommended Posts

you could use a script to join it to the domain depending on how your domain OU's are set up

for instance based on the computer name "trigram" FINPC1000" this will join my pc to the "fin" OU.

My you could go further and use the bdd and join the machine to the domain based on Mac address name, model or serial number etc.

however there is more setup required for this.

We have SMS 2003 OSD FP for our replace "OS"

RIS/WDS For "F12" pxe boot winpe 2> base image on the machine this then runs a SQL script to get wsname.exe from the bdd database (using sql 2005 but you can use msde) this then fills in the name and drivers for that model and mac address, I also dump al the info from the machine, drivers, serial number, hal, asset, firmware versions etc back to the bdd database so I have all the asset details to make me ITIL compliant.

I can then update SMS so that my base machine gets its LOB Apps (Line of Bussiness Applications) based on the information held in the bdd database.

Its a very good tool i recommend it to any enterprise admin My base wim image is 400MB without the i386 I distro this out to my sites using SMS and DFS Shares.

It does take abit to set set up but all the job aids and doc's are in the install as well as all the sql queries.

Link to comment
Share on other sites

  • 2 months later...

All,

Sorry its taken some time to respond. I wanted to provide an update...

I am stuck still, but at a different aspect.

I currently am using WIM. I change my HP DC 5700 over to Advanced Configuration and Power Interface (ACPI) PC. I rebooted several times to ensure it took.

I sysprepped the system. I wiped the computer, and dropped the image down. (same machine as image was built from).

It completed mini setup perfectly, but then upon reboot, would get stuck in a reboot cycle on the Windows splash screen.

I've been in touch with Johan, the guy that wrote the HAL replacement VB script..but I'm still at a standstill

Link to comment
Share on other sites

  • 4 months later...
I am attempting to run a VB script in WinPE 2.0.

The script does not seem to respond in any way, shape, or form.

When it executes, no error messages pop up, it just displays the command prompt again.

Here is the script I use to create my WinPE image.

The script I am trying to execute is:

	sHalType = oWshShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Enum\Root\ACPI_HAL000\HardwareID")

Check the above line. The HKLM will not work unless unless the following line is added and you will also need another \ after ACPI_HAL:

Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
sHalType = oWshShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Enum\Root\ACPI_HAL\000\HardwareID")

-b0n3z

Link to comment
Share on other sites

  • 4 weeks later...

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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...