Jump to content

WinPE 2.0 GimageX COM based HTA


geezery

Recommended Posts

Solutionone -> I did the code for the disk id, it's a bit tricky, because I have to get that information on a different wmi query.

Bluesol -> Are you running the script from the WinPe X:\Windows\System32 or fromt the network share. If you are running from the share you should check from the shareserver that the file is allowed by windows.

I suggest everyone still using old versions to download the newest 0.32

Edited by geezery
Link to comment
Share on other sites


I am having a problem that I hope someone has already had and fixed it.

I am getting a syntax error on line 46 and on line 366. When I click yes the script continues but i get no drive information or WIM information. If i run imagex.hta from my Vista box I get no errors.

I have made a PE CD, installed the 4 applications, copied the files to mount\windows\system32, and updated the startnet.cmd to map drives.

Any help would be great.

Link to comment
Share on other sites

try installing the WMI package into your PE.

command from memory after you have mounted your *.wim file is

peimg /install=*WMI* c:\%winpe%\mount\windows

%winpe% < where you have your files.

hope that helps

Edited by cirion9999
Link to comment
Share on other sites

I think I have included all the necessary packages in the first post. I think wmi comes if you install scripting support, or am I wrong?

- I have been on holiday and haven't been able to develope this project for three weeks.

- Is there any wishes or functions you guys could need.

Someone suggested to make a function to map network drives based on the subnet. Would it be nice?

Link to comment
Share on other sites

I think I have included all the necessary packages in the first post. I think wmi comes if you install scripting support, or am I wrong?

- I have been on holiday and haven't been able to develope this project for three weeks.

- Is there any wishes or functions you guys could need.

Someone suggested to make a function to map network drives based on the subnet. Would it be nice?

Yeah WMI has to be installed as well as scripting support, if you have a script that does not call any WMI functions (info) then you will be fine else you do need to have the WMI package installed.

the mapping of network shares via ip would be awesome it would allow you to connect into your deployment points very easly.

Link to comment
Share on other sites

Hello.

I test the script and i have the following error.

After the applying is done and i reboot the machine winload.exe is missing or is corrupted.

i know that this is a common error with vista but how can i fix it?

i can repair it using the original vista dvd but i want to know how to eliminate this error.

Thanks

Link to comment
Share on other sites

Have you tried to run "bootsect /nt60 c: /f" from the winpe after applying?

I have only used this script on Windows XP machines, so I don't know about those Vista weirdnesses.

You have to also put that bootsect.exe to your winpe 2 boot.wim.

I can also give you the code needed to automate this, if it works.

Edited by geezery
Link to comment
Share on other sites

I started to make the subnet based network mapper function to the HTA and I have already written the first script. I need some "beta" testers so I can find the problems that might occure. If some of you guys could test this script in real environment and give some feedback for me. There is some modifications you need to be done before testing. You have to put correct UNC-paths and Username/Password witch are able to map share from your server. You have to also change the correct subnets to Select case statement i.e. 192.168.1 etc. You can add multiple records there just follow the sample that is commented out.

Here is the script. Just Copy Paste it to notepad and rename it to netmap.vbs and save. You can also test it on Vista based OS, but testing in XP is not possible, since I removed those checkings from the script, since this is going to be run from the WinPE 2.0. You can ask for more advice if needed.

I'm waiting for Feedback :)

'netmap.vbs by Geezery

Const TemporaryFolder = 2
Const ForAppending = 8
Dim ObjShell : Set ObjShell = CreateObject("WScript.Shell")
Dim Objfso : Set Objfso = CreateObject("Scripting.FileSystemObject")
Dim TmpFile : TmpFile = Objfso.GetSpecialFolder(2) & "/ip.txt"
Dim ThisLine, IP
Set WSHNetwork = CreateObject("Wscript.Network")
ObjShell.run "%comspec% /c ipconfig > " & TmpFile, 0, True
With Objfso.GetFile(TmpFile).OpenAsTextStream
Do While NOT .AtEndOfStream
ThisLine = .ReadLine
'For WinPe v.2.0 Vista Based
If InStr(ThisLine, "IPv4") <> 0 Then IP = Mid(ThisLine, InStr(ThisLine, ":") + 2)
Loop
.Close
End With
'Removes the dummy character from the end.
If IP <> "" Then
If Asc(Right(IP, 1)) = 13 Then IP = Left(IP, Len(IP) - 1)
End If
Dim Array, Subnet
Array = Split(IP, ".", -1, 1)
If Array(2) = "" Then
MsgBox("There is some problems with the network settings!")
End If
Subnet = Array(0) & "." & Array(1) & "." & Array(2)
Set Objfso = Nothing


Dim StrUserName, strPassword

'Username that have rights to shares. Change theselines

strUserName = "Admin"
strPassword = "AdminPassword"

'Here comes the Select Case portion

Select Case Subnet

Case "10.13.58"
WSHNetwork.MapNetworkDrive "j:", "\\Server01\Distribution" ,False, strUsername, strPassword

'Case "10.13.57"
'WSHNetwork.MapNetworkDrive "y:", "\\Server02\Distribution" ,False, strUsername, strPassword

End Select

Edited by geezery
Link to comment
Share on other sites

I re downloaded WAIK and set my batch file to install WMI, now all works, I have made some changes and such to work a little easier for the ppl using it where I work. Thanks for the help guys.

geezery, nice work, this is similar to a project I had begun at my previous employer, when I have my changes comlpete I will email them to you.

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...