MSFN Forum: Scripting and Windows PE - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Scripting and Windows PE Rate Topic: -----

#1 User is offline   EvilGuinness 

  • Newbie
  • Group: Members
  • Posts: 44
  • Joined: 10-March 04

Posted 16 March 2004 - 08:06 AM

Hello,

I'd like to run some scripts written in vbs under Windows PE....I followed a small tutorial, but I have still problems. I've all the files I need, I use regsrv32 to register the dll/ocx files, but...I don't know how to modify the registry keys.

Cscript and wscript are recognized, but I have an error message saying that "there isn't script engine for ".vbs" files".

Anyone to help? Thanks!

PS : I work on the "official" Microsoft Windows PE.


#2 User is offline   likuidkewl 

  • [Centos~]$
  • PipPipPipPipPip
  • Group: Members
  • Posts: 960
  • Joined: 16-September 03

Posted 16 March 2004 - 08:38 AM

Have you added the 5.6 script engine?

#3 User is offline   EvilGuinness 

  • Newbie
  • Group: Members
  • Posts: 44
  • Joined: 10-March 04

Posted 16 March 2004 - 09:09 AM

Oh, it seems I forgot something...I don't find anything about things like this in my docs.

I just have these instructions :

"
1. Copy the contents of the WINPE folder from the Tools CD to your WinPE source folder, say c:\WINPE.
2. Copy the following DLL’s and OCX files from the Windows XP HOME/ PRO cd into your WINPE folder.
vbscript.dll, scrrun.dll, cscript.exe, wscript.exe, wshext.dll, wshom.ocx, dispex.dll, jscript.dll.
3. For localized support, I assume that wshext.dll is the only localized file. It also helps to use the localized versions for all these files. (I should be trying this later).
4. Modify the extra.inf file in the WINPE folder, in order to copy these extra files into the WINPE CD. (for detailed information on the extra.inf file format, please refer to the customizing WINPE whitepaper.
[ExtraFiles.x86]
……
…..

vbscript.dll=1,,,,,,,,0,0,,1,2
scrrun.dll=1,,,,,,,,0,0,,1,2
cscript.exe=1,,,,,,,,0,0,,1,2
wscript.exe=1,,,,,,,,0,0,,1,2
wshext.dll=1,,,,,,,,0,0,,1,2
wshom.ocx=1,,,,,,,,0,0,,1,2
dispex.dll=1,,,,,,,,0,0,,1,2
jscript.dll=1,,,,,,,,0,0,,1,2

<Please note that I have also copied over my scripting files>
recscript.vbs=1,,,,,,,,0,0,,1,2
script.vbs=1,,,,,,,,0,0,,1,2

4. Modify the config.inf to make sure that the appropriate registry keys are populated. (All the INF files are in the attached Zip File.) Make sure to copy the script.inf and scriptkey.inf to the c:\WINPE folder.

; Please note that I have added script.inf
;

[Add Registry New]
software = .\hivesft.inf,AddReg,.\hivecls.inf,AddReg,.\script.inf,AddReg
default = .\hivedef.inf,AddReg

;
; Please note that I have added scriptkey.inf
;

[Add Registry Existing]
setupreg.hiv = .\winpesys.inf,AddReg
software = .\winpesft.inf,AddReg,.\scriptkey.inf,AddReg
default = .\winpedef.inf,AddReg

5. Modify the startnet.cmd to have the following entries. These are needed in order to register the Scripting Dll’s.
REM If there is no networking support, you can skip the netcfgx.dll
regsvr32 /s netcfgx.dll

regsvr32 /s dispex.dll
regsvr32 /s jscript.dll
regsvr32 /s scrrun.dll
regsvr32 /s vbscript.dll
regsvr32 /s wshext.dll
regsvr32 /s wshom.ocx
REM I’m launching the CMDLINE scripting exe.
cscript.exe recscript.vbs
"

I followed these steps, excepting the things related to .inf files....I think there's something wrong, because there is no reference to the "script engine".

Could you say me where I can find doc about the script engine, please? I really don't know where I can search for this. I'm only a beginner in things like that. I've found the solution for PE build with BartPE, but not with the official release.

Thanks!

#4 User is offline   EvilGuinness 

  • Newbie
  • Group: Members
  • Posts: 44
  • Joined: 10-March 04

Posted 16 March 2004 - 09:26 AM

Ok, I've found the script engine on the MS website...I understand a little better the problem.

edit : hum, it seems this script engine contains exactly the same dll's I previously installed on Win PE...

Now I have an other problem (it refuses to install) but I think it would be off-topic :)

Thanks a lot!

#5 User is offline   likuidkewl 

  • [Centos~]$
  • PipPipPipPipPip
  • Group: Members
  • Posts: 960
  • Joined: 16-September 03

Posted 16 March 2004 - 03:32 PM

EvilGuinness, on Mar 16 2004, 09:26 AM, said:

Ok, I've found the script engine on the MS website...I understand a little better the problem.

edit : hum, it seems this script engine contains exactly the same dll's I previously installed on Win PE...

Now I have an other problem (it refuses to install) but I think it would be off-topic :)

Thanks a lot!

Sorry man, looks like it is time start from scratch.

#6 User is offline   CuBie 

  • Advanced Member
  • PipPipPip
  • Group: Banned
  • Posts: 364
  • Joined: 21-February 04

Posted 16 March 2004 - 05:05 PM

Yeh.... I agree - weird problem your having tho.....

:)

Later,
Chris.

#7 User is offline   likuidkewl 

  • [Centos~]$
  • PipPipPipPipPip
  • Group: Members
  • Posts: 960
  • Joined: 16-September 03

Posted 16 March 2004 - 05:14 PM

Have you posted your issue here yet?
http://communities.microsoft.com/newsgroup...s.oem.windowsxp

#8 User is offline   EvilGuinness 

  • Newbie
  • Group: Members
  • Posts: 44
  • Joined: 10-March 04

Posted 17 March 2004 - 02:06 AM

I posted all around the net (hum, not "all around" but I posted some questions on several websites), but I don't have any answer....I'll try to post on the Microsoft newgroups in English : my posts on the French newsgroups don't give me anything.

edit : I forgot to say that my PE boots from a RIS server...I don't know if it changes anything.

#9 User is offline   EvilGuinness 

  • Newbie
  • Group: Members
  • Posts: 44
  • Joined: 10-March 04

Posted 17 March 2004 - 03:25 AM

Oh, that's strange! It works now....but I don't know why :)

I installed the dll files just as said in my docs. It didn't work. I downloaded the French version of the script engine (installation of my dll files, but in a different way...). I had some errors...I tried to modify some files, but it didn't change anything.

So I dowloaded the English version of the script engine....and it works. That's strange : I don't have any error whith it, I don't understand. My server is a French version of Win Server 2003, and it works only with the English script engine....it's the same for my PE.

Well, I'm very happy to see it works, I've spent lots of time on this.

Thanks everybody for the help!

#10 User is offline   likuidkewl 

  • [Centos~]$
  • PipPipPipPipPip
  • Group: Members
  • Posts: 960
  • Joined: 16-September 03

Posted 17 March 2004 - 07:31 AM

Glad to see this worked out, that is wierd though.

#11 User is offline   EvilGuinness 

  • Newbie
  • Group: Members
  • Posts: 44
  • Joined: 10-March 04

Posted 18 March 2004 - 03:32 AM

I posted on the Microsoft newsgroups...and I have the solution. Here is the answer :

Hi Romain:

Thanks for your posting.

If you have the SP1 version of the OPK, then adding scripting support is
much simpler.

On the OPKTools (WinPE) CD, there is a VBS script that can be run on the
machine you use to create your winpe images.

BUILDOPTIONALCOMPONENTS.VBS.

You can use it to add Scripting support, database (ADO) connectivity
support and HTA (HTML for applications) support.

The syntax is:

BUILDOPTIONALCOMPONENTS.VBS /s:(OS_CDROM) /d:(destination_dir) /WSH (or
/ADO or /HTA)

/s: points to the source drive letter where the OS CD rom is located (XP
Pro SP1 OS or better)
/d: points to the destination "root" destination directory where the winpe
image is stored (e.g. the same folder name as used with MKIMG)

There is a batch file that needs to be added to
(winpe_image)\i386\system32\STARTNET.CMD. It's called OC.BAT, so you can
add using:

STARTNET.CMD
---------------------------
CALL OC.BAT <---- registers dlls for scripting host
(etc)

Regards,

Todd~SBST

That was easy....but I didn't fond any doc about this. Maybe I searched in the wrong places.

Edit : it works perfectly...I'm waiting for the next problem :)

This post has been edited by EvilGuinness: 18 March 2004 - 03:55 AM


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy