Help - Search - Members - Calendar
Full Version: how to run script when win pe boot up
The CD Forum > The CD Forum > Windows PE
kcozart
hello
I have a file called start.vbs which has the following data:

strCommand = "regedit /s ultra.reg"
set objWshShell = WScript.CreateObject("WScript.Shell")
intRC = objWshShell.Run(strCommand, 0, TRUE)

which I would like to load before so a program will be registered.
I have tried putting it in the Winpeshl.ini file but win pe 3.0 asks me what
progam I want to run this.

Does anyone know how to do this
thanks

kcozart
I figured one way to do what I was trying to do.

First I made a file called run.vbs with the following
---------------------------------
strCommand = "regedit /s ultra.reg"
set objWshShell = WScript.CreateObject("WScript.Shell")
intRC = objWshShell.Run(strCommand, 0, TRUE)


Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "ultraiso.exe" & Chr(34), 0
Set WshShell = Nothing
-----------------------------------------------------------------
Then I make a file called run.bat
with the following

----------------------------
@echo off
run.vbs
-----------------
Then I made a short cut and put it on the desktop of the desktop in the wim image

target: "X:\PROGRAM FILES (X86)\ULTRAISO\RUN.BAT"


start in: "X:\PROGRAM FILES (X86)\ULTRAISO"

I have not fiqured out how just to make the vbs file ran by itself without using a batch file.
kcozart
I figured it out.
I guess I was making it seem too hard.

I made a run.vbs file which had the following

Set WshShell = WScript.CreateObject("WScript.Shell")
strCommand = "regedit /s ultra.reg"
set objWshShell = WScript.CreateObject("WScript.Shell")
intRC = objWshShell.Run(strCommand, 0, TRUE)


Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "ultraiso.exe" & Chr(34), 0
Set WshShell = Nothing

Then I put this vbs file in the program folder where the exe file was
that I wanted to run.
Then I just created a shortcut to the vbs file and everything works fine
Ed_P
Glad we could help. whistling.gif w00t-x100.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.