Jump to content

How I can use vbscript in WinPE 2.0


Mr.John_Doe

Recommended Posts

Hello,

we want to use imagex with winpe2.0 for deployment of our Windows XP. So I search a solution for the following steps:

1. Ask the dns for the own pc-name (nslookup ip-adress)

2. connect to \\server\folder\pc-name as z:

3. start the deploymentscript in this folder

deploymentscript:

1. partedit using z:\part.cfg

2. running batchfile z:\use_imagex.bat (imagex.exe /apply ...)

3. make c: bootable

4. write in c:\sysprep\sysprep.inf the pc-name (nslookup or maybe input by user)

5. append the runonce-scripts from z:\runaftersetup.cfg to sysprep.inf

6. reboot

I think this hard to script with batch-files so I want to use some vbscript. But how can I use an existing vbscript with winpe2.0?

Can someone tell me this? When I'm done I can show the code here...

Link to comment
Share on other sites


Thanks for your help. It works now...

Now I began to script the whole thing.

The Networkmapping works. But how I can make output to the shell. With wscript.echo he opens me a messagebox with the text...

Execute your script with cscript.exe instead of wscript.exe (default). Example: cscript myscript.vbs

Edited by zorphnog
Link to comment
Share on other sites

Thanks for your hints.

Your script looks very interesting. For now we search a way to bring out the images without any interaction. But after that I will search some kind of graphical interface for us. And it looks great at your script...

But now I have another problem. When I want the make an .wim file with

imagex /capture c:\ z:\test.wim "Drive C"

after 1% he brings me an error like "file not found"...

Z: is an mapped network drive.

Unfortunatly I couldn't see which file is missing. I have tried to make a .wim from a machine which is not syspreped yet. Could this be the error?

Thanks alot

Link to comment
Share on other sites

The .wim file is just a compressed collection of the files and file system structure. Whether its sysprepped or not does not matter. Have you checked the permissions on your network drive? Make sure you can write to it. If the problem persists, post a detailed description of the error.

Link to comment
Share on other sites

I have checked the permission...

I have just write some echo Hello >> test.txt and it works....

What schoul I say. I map the drive with a vbscript as z: and then I start the imagex-process.

Is it possible to look which file or which process makes this error?

Link to comment
Share on other sites

There was no code at the last try...

I have installed an standard windows XP + some Software to an Notebook.

Then I had created a winpe2-CD how descriped in the Tutorial here on the page.

Then I booted from this disk an on prompt I insertet:

net use z: \\server\target

imagex /capture C:\ Z:\test.wim "Drive C"

after a short while he ends and give me only the error

Error imaging drive [C:\] - the system couldn't find the path

So I have tried to make an image from drive c: to the second partition:

imagex /capture c:\ d:\test.wim "Drive C"

The same error occures...

Link to comment
Share on other sites

I had tested some more.

I now tried to backup the single folders.

It seems that he have some problems imaging the folder

c:\dokumente und einstellungen\administrator\lokale einstellungen\temp

the same in english:

c:\documents and settings\administrator\local settings\temp

Unforutnatly I couldn't see all the hidden folders so I couldn't check those.

Edit: It is defintiltly this folder. I have created a seperate exclusion-file and now it works...

I couldn't realy say that that is a critical error...

Edited by Mr.John_Doe
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...