Jump to content











Photo
- - - - -

Install WinPE to hard drive/usb

usb install pe windows win boot

  • Please log in to reply
5 replies to this topic

#1 life is system32

life is system32
  • Members
  • 7 posts
  •  
    Canada

Posted 11 September 2015 - 06:35 AM

Basically we know all the errors windows can throw at us when trying to boot a system.a

I was wondering if there is a way to install WinPE on a hard drive, meaning all changes are saved as opposed to being erased. So instead of reinstalling on a bad installation, isnt there some way to point out where everything is after it finishes loading? Like let it load the registry of the target drive along with Program Files etc so this way, everything is much faster.



#2 RoyM

RoyM

    Frequent Member

  • .script developer
  • 414 posts
  • Interests:"Booting and Owning".
  •  
    United States

Posted 12 September 2015 - 11:34 PM

 

 

 

I am composing this WordPad doc from such a system:
This is not a tutorial just some hints and tips

on how it can be done, you're mileage may vary.

Build Your %Win7PE%.
Mine= nativeEx_Win7.iso <-- Highly Customized
From 7-zip: extract the contents of Win7PE.iso,
To: Bootable Harddrive, formatted NTFS, grub4Dos Installed.
From 7-zip: Bootable Hardrive\SOURCES\boot.wim\1\*
To: Bootable Harddrive

Menu.lst on Harddrive:
****************** Menu.lst ********************************
title *** THIS IS THE MENU.LST ON Raid1bak(C:) (HD0,0) *****\nPtn1=650M NTFS Label=Raid1bak\n

title NativeEX Flat File Boot * Some persistence *\n If connecting USB HD, connect it now
# This was .ISO un7zipped to ebook, then booted into nativeEx and robocopied to c:
chainloader /BOOTMGR
*************************************************************

Before explorer starts, you must shell out of the boot
process and make some changes. mine= cddrive.cmd
I do it in Shell & Config.script by adding this line:
If,"%Shell%",Equal,"Explorer",If,%pCheckBox5%,Equal,True,TXTAddLine,"%TargetDir%\windows\system32\winpeshl.ini","cddrive.cmd","Append"

I let winpeshel.ini call cddrive.cmd for me,
make my changes, then call explorer.exe

****** Contents winpeshl.ini ********************************
[LaunchApps]
"hiderun SetResolution.exe -hide -abovenormal -vmdetect -rebuild -registry -output"
cddrive.cmd
*************************************************************
************** cddrive.cmd START ****************************

@ECHO OFF
Title "** DON'T CLOSE ME ** - CDDrive.cmd Defines PEDrive "
:: CDDRIVE.CMD; DEFINES CDDRIVE AND PATH VARIABLE, ALSO ADDS REGISTRY SETTINGS, THEN IT CALLS
:: CDREG.CMD, WIN7PELDR, SHORTCUTS.EXE, EXPLORER.EXE
:: *** when win7peldr started first, winpeshl.exe stays in memory
ECHO.
REM -- Prepare the Command Processor --
SETLOCAL ENABLEEXTENSIONS
SETLOCAL DISABLEDELAYEDEXPANSION
REM SET CDTAG1=SOURCES\BOOT.WIM <- ***ORIGINAL CDTAG***
SET HDTAG1=_NATIVEWIMEX
SET CDTAG1=NATIVEWIMEX
SET CDDrive=
SET HDCmd=Windows\System32\HDrive.cmd

@ECHO All
@ECHO Available
@ECHO Drives;
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (if exist %%a:\nul ECHO %%a )

:: If CD Drive Tag \NATIVEWIMEX exists, set CDDrive to that ***
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (if exist %%a:\%CDTAG1% ECHO %%a:\%CDTAG1% EXISTS && SET CDDrive=%%a:)

:: If HD Tag \_NATIVEWIMEX exists ***
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do

:: do lines below ***
(if exist %%a:\%HDTAG1% ECHO %%a:\%HDTAG1% EXISTS && SET HDrive=%%a:)

ECHO Hard Drive Found = %HDrive%
ECHO SETTING HD BOOT DRIVE AS %HDrive%
SETENV -m HDrive %HDrive%

ECHO CDDrive Found = %CDDrive%
SETENV -m CDDrive %CDDrive%

SET SystemDrive=%HDrive%
SETENV -m SystemDrive %SystemDrive%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "SystemDrive" /t REG_SZ /d "%HDrive%" /f

SET SystemRoot=%HDrive%\WINDOWS
SETENV -m SystemRoot %SystemRoot%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "SystemRoot" /t REG_SZ /d "%HDrive%\WINDOWS" /f

SET windir=%HDrive%\WINDOWS
SETENV -m windir %windir%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "windir" /t REG_SZ /d "%HDrive%\WINDOWS" /f

SET ALLUSERSPROFILE=%HDrive%\ProgramData
SETENV -m ALLUSERSPROFILE %ALLUSERSPROFILE%

SET CommonProgramFiles=%HDrive%\Program Files\Common Files
SETENV -m CommonProgramFiles "%CommonProgramFiles%"

SET ProgramData=%HDrive%\ProgramData
SETENV -m ProgramData %ProgramData%

SET ProgramFiles=%HDrive%\Program Files
SETENV -m ProgramFiles "%ProgramFiles%"

SET PUBLIC=%HDrive%\Users\Public
SETENV -m PUBLIC %PUBLIC%

REM SET USERPROFILE=%HDrive%\windows\system32\config\systemprofile

SET USERPROFILE=%HDrive%\Users\Default
SETENV -m USERPROFILE %USERPROFILE%

SET JAVA_HOME=%HDrive%\Programs\Java\jre6
SETENV -m JAVA_HOME %JAVA_HOME%

SET ComSpec=%HDrive%\windows\system32\cmd.exe
SETENV -m ComSpec %ComSpec%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "ComSpec" /t REG_SZ /d "%HDrive%\windows\system32\cmd.exe" /f

SET Path=%HDrive%\windows\system32;%HDrive%\windows;%HDrive%\windows\System32\Wbem;%JAVA_HOME%\bin;%SystemRoot%
SETENV -m Path %Path%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "Path" /t REG_SZ /d =%HDrive%\windows\system32;%HDrive%\windows;%HDrive%\windows\System32\Wbem;%JAVA_HOME%\bin;%SystemRoot%
" /f

SET ALLUSERSPROFILE=%HDrive%\ProgramData
SETENV -m ALLUSERSPROFILE %ALLUSERSPROFILE%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "ALLUSERSPROFILE" /t REG_SZ /d "%HDrive%\ProgramData" /f

SET CommonProgramFiles=%HDrive%\Program Files\Common Files
SETENV -m CommonProgramFiles %CommonProgramFiles%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "CommonProgramFiles" /t REG_SZ /d "%HDrive%\Program Files\Common Files" /f

SET ProgramData=%HDrive%\ProgramData
SETENV -m ProgramData %ProgramData%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "ProgramData" /t REG_SZ /d "%HDrive%\ProgramData" /f

SET ProgramFiles=%HDrive%\Program Files
SETENV -m ProgramFiles %ProgramFiles%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "ProgramFiles" /t REG_SZ /d "%HDrive%\Program Files" /f

SET PUBLIC=%HDrive%\Users\Public
SETENV -m PUBLIC %PUBLIC%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "PUBLIC" /t REG_SZ /d "%HDrive%\Users\Public" /f

REM SET USERPROFILE=%HDrive%\windows\system32\config\systemprofile

SET USERPROFILE=%HDrive%\Users\Default
SETENV -m USERPROFILE %USERPROFILE%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "USERPROFILE" /t REG_SZ /d "%HDrive%\Users\Default" /f

rem System Properties says: %USERPROFILE%\AppData\Local\Temp
SET TMP=%HDrive%\windows\TEMP
SETENV -m TMP %TMP%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "TMP" /t REG_SZ /d "%HDrive%\windows\TEMP" /f

SET TEMP=%HDrive%\windows\TEMP
SETENV -m TEMP %TEMP%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "TEMP" /t REG_SZ /d "%HDrive%\windows\TEMP" /f

SET JAVA_HOME=%HDrive%\Programs\Java\jre6
SETENV -m JAVA_HOME %JAVA_HOME%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "JAVA_HOME" /t REG_SZ /d "%HDrive%\Programs\Java\jre6" /f

rem SET Path=%HDrive%\windows\system32;%HDrive%\windows;%HDrive%\windows\System32\Wbem;%JAVA_HOME%\bin;%SystemRoot%\;%CDDrive%\

SET Path=%HDrive%\windows\system32;%HDrive%\windows;%HDrive%\windows\System32\Wbem;%HDrive%\PROGRAMS\JAVA\JRE6\bin;%SystemRoot%\;%CDDrive%\
SETENV -m Path %Path%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "Path" /t REG_SZ /d "%HDrive%\windows\system32;%HDrive%\windows;%HDrive%\windows\System32\Wbem;%JAVA_HOME%\bin;%SystemRoot%\;%CDDrive%\" /f

)

IF NOT EXIST %HDrive%\%HDTAG1% (
ECHO No HD, SETTING BOOT DRIVE AS CD= %CDDrive%
SET SystemDrive=%CDDrive%
SET SystemRoot=%CDDrive%\WINDOWS
SET windir=%CDDrive%\WINDOWS
SET JAVA_HOME=%CDDrive%\Programs\Java\jre6
SET Path=%CDDrive%\windows\system32;%CDDrive%\windows;%CDDrive%\windows\System32\Wbem;%JAVA_HOME%\bin;%SystemRoot%
SETENV -m CDDrive %CDDrive%
SETENV -m SystemDrive %SystemDrive%
SETENV -m SystemRoot %SystemRoot%
SETENV -m windir %windir%
SETENV -m Path %Path%
SET

PAUSE )

BroadcastEnvChange.exe /broadcast
ECHO " Starting Win7Peldr..."
win7peldr.exe

ECHO " Starting Windows Explorer..."
REM cls
COLOR 1F
ECHO.
ECHO HardDrive = %HDrive% SystemRoot = SystemRoot%
ECHO CDDrive = %CDDrive% windir = %windir%
ECHO SystemDrive = %SystemDrive% Temp = %Temp%
ECHO USERNAME = %USERNAME% Tmp = %Tmp%
ECHO.
ECHO.
ECHO #######################################
ECHO # #
ECHO # (Do Not Close This Window) #
ECHO # #
ECHO # ** MINIMIZE ONLY ** #
ECHO # #
ECHO #######################################
ECHO.
ECHO Path:
ECHO %Path%
%HDrive%\windows\explorer.exe
************** cddrive.cmd END **********************
********* Output of cddrive.cmd: *******************
" Starting Windows Explorer..."
HardDrive = C: SystemRoot = C:\WINDOWS
CDDrive = X: windir = C:\WINDOWS
SystemDrive = C: Temp = X:\windows\TEMP
USERNAME = SYSTEM Tmp = X:\windows\TEMP
#######################################
# (Do Not Close This Window) #
# ** MINIMIZE ONLY ** #
#######################################
Path:
C:\windows\system32;C:\windows;C:\windows\System32\Wbem;\bin;X:\windows
******************************************************

CDDrive.cmd stays resident in memory because it is
calling explorer.exe which will not end.
There are other ways to do this without running resident.
There may be errors in code above as it was cut and
pasted and edited for content.

Networking is through a .cmd call from cddrive.cmd.
also certain registry entries pertaining to some
picky programs are also called.

Not everything is working, this is still an experiment in
the making, thus the crude manner, this gives you a somewhat persistent OS/PE, only registry is not retained on reboot, plus I am still missing some critical reg entries allowing for ease of use.

P.S. I can also run winbuilder 080/082 on this system.

 

Regards

RoyM

 

 

 



#3 RoyM

RoyM

    Frequent Member

  • .script developer
  • 414 posts
  • Interests:"Booting and Owning".
  •  
    United States

Posted 12 September 2015 - 11:49 PM

Hey guys, How do I attach a screen capture to posts ????

Please advise this rookie.

 

Regards

RoyM



#4 sbaeder

sbaeder

    Gold Member

  • .script developer
  • 1334 posts
  • Location:usa - massachusettes
  •  
    United States

Posted 14 September 2015 - 01:07 AM

to add picture, you choose picture, attach this file, then Add to post...

 

ScreenHunter_10 Sep. 13 21.02.jpg

 

not sure how to resize it...OR, you have to have image on another file sharing site, and reference it...



#5 RoyM

RoyM

    Frequent Member

  • .script developer
  • 414 posts
  • Interests:"Booting and Owning".
  •  
    United States

Posted 14 September 2015 - 01:43 AM

Thanks Steve

 

Regards

RoyM



#6 RoyM

RoyM

    Frequent Member

  • .script developer
  • 414 posts
  • Interests:"Booting and Owning".
  •  
    United States

Posted 14 September 2015 - 11:08 PM

I've updated the cddrive.cmd file
to re-cap, this is basicaly a flat file
boot of a Win7PE from HD, after files
have been extracted to HD, it can then
be booted via Grub4Dos, upon boot
I have made provisions to shell out
of the boot process to make changes and
then continue booting, cddrive.cmd
is called from winpeshl.ini, Some changes
were made to cddrive.cmd.

So it works like this, boot the drive using grub4Dos.
Windows will load the file Drive:/Sources/Boot.wim
to memory aka x:\, before explorer loads
we shell out and make our registry changes below.
The issue was these variables were not changed:
CompSpec, SystemRoot, TEMP, TMP, windir
they all still pointed to X:\etc, etc,
The fix was to run Environment.reg after
win7peldr.exe is run and before windows explorer.
I would also be willing to bet that just merging
Environment.reg before explore will be all that is
needed and I can then do away with most of this batch.

Now all Variables are pointing to the drive
that is tagged with this file: \_NATIVEWIMEX
There is file persistence but still no registry persistence.

%%%%%%%%%%%%%%%%%%%%%% Contents of Environment.reg %%%%%%%%%%%%%%%%%%%%%%%%%
REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]
"SystemRoot"="C:\\WINDOWS"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment]
"SystemDrive"="C:"
"SystemRoot"="C:\\windows"
"windir"="C:\\windows"
"ComSpec"="C:\\windows\\system32\\cmd.exe"
"Path"=C:\\windows\\system32;C:\\windows;C:\\windows\\System32\\Wbem;C:\\PROGRAMS\\JAVA\\JRE6\\bin;X:\\windows\;X:\\"
"ALLUSERSPROFILE"="C:\\ProgramData"
"CommonProgramFiles"="C:\\Program Files\\Common Files"
"ProgramData"="C:\\ProgramData"
"ProgramFiles"="C:\\Program Files"
"PUBLIC"="C:\\Users\\Public"
"USERPROFILE"="C:\\windows\\system32\\config\\systemprofile"
"TEMP"="C:\\windows\\TEMP"
"TMP"="C:\\windows\\TEMP"

[HKEY_USERS\.DEFAULT\Software\Microsoft\Windows NT\CurrentVersion\Winlogon]
"ParseAutoexec"="1"

[HKEY_USERS\S-1-5-18\Software\Microsoft\Windows NT\CurrentVersion\Winlogon]
"ParseAutoexec"="1"

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 

REM -- Prepare the Command Processor --
SETLOCAL ENABLEEXTENSIONS
SETLOCAL DISABLEDELAYEDEXPANSION

REM SET CDTAG1=SOURCES\BOOT.WIM <- ***ORIGINAL CDTAG***
SET HDTAG1=_NATIVEWIMEX
SET CDTAG1=NATIVEWIMEX
SET CDDrive=
SET HDCmd=Windows\System32\HDrive.cmd

@ECHO  All
@ECHO  Available
@ECHO  Drives;
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (if exist %%a:\nul ECHO         %%a )
ECHO.
ECHO.
@ECHO LOOKING FOR CD DRIVE
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (if exist %%a:\%CDTAG1% ECHO         %%a:\%CDTAG1%  EXISTS && SET CDDrive=%%a:)
ECHO  CDDrive Found = %CDDrive%
@ECHO LOOKING FOR HARD DRIVE
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (if exist %%a:\%HDTAG1% ECHO         %%a:\%HDTAG1%  EXISTS && SET HDrive=%%a:)
ECHO  Hard Drive Found = %HDrive%
ECHO.
ECHO.
:: *** First we will leave a spot to shell out for test purposes
:: *** This IS cddrive.cmd which is running from x:\windows\sys32\
:: *** tried running environment.reg from hdrive.cmd, it did not change the usual wrong entries
:: *** try running environment.reg later
@ECHO CALLING HDrive.cmd
for %%a in (C D E F G H I J K L M N O P Q R S T U V W Y Z) do (if exist %%a:\Windows\System32\HDrive.cmd ECHO  Calling  "%%a:\Windows\System32\HDrive.cmd" &&  CALL "%%a:\Windows\System32\HDrive.cmd")
ECHO.
@ECHO BACK FROM HDrive.cmd AND BACK TO CDDRIVE.CMD AGAIN

:: "Additional notes and changes"

:: SystemDrive is not defined in the registry???

:: REG ENTRY BELOW SHOULD BE "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion,SystemRoot"
:: reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "SystemRoot" /t REG_SZ /d "%HDrive%\WINDOWS" /f

:: reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "windir" /t REG_SZ /d "%HDrive%\WINDOWS" /f
:: should be reg_expand_sz

:: reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "ComSpec" /t REG_SZ /d "%HDrive%\windows\system32\cmd.exe" /f
:: should be reg_expand_sz above

:: allusersprofile not in registry: <-- C:\ProgramData
:: CommonProgramFiles not in registry: <-- C:\Program Files\Common Files
:: ProgramData not in registry:
:: ProgramFiles not in registry:
:: PUBLIC not in registry:
:: USERPROFILE not in registry:

:: reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "TEMP" /t REG_SZ /d "%HDrive%\windows\TEMP" /f
:: should be reg_expand_sz above

:: reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "TMP" /t REG_SZ /d "%HDrive%\windows\TEMP" /f
:: should be reg_expand_sz above

:: *** IF CHANGES MADE, BE SURE TO UPDATE C:\WINDOWS\SYSTEM32\ExpEnvVar.txt ***

:: these did not work
:: X:\ = CompSpec, SystemRoot, TEMP, TMP, windir
:: try merging c:\Environment.reg

 

ECHO %HDrive%\%HDTAG1%
if exist %HDrive%\%HDTAG1% (
ECHO SETTING HD BOOT DRIVE AS  %HDrive%
ECHO SETTING SYSTEM VARIABLES
ECHO SETTING SYSTEMDRIVE= %HDrive%
SET SystemDrive=%HDrive%
SETENV -m SystemDrive %SystemDrive%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "SystemDrive" /t REG_SZ /d "%HDrive%" /f

ECHO SETTING SystemRoot=%HDrive%\WINDOWS
SET SystemRoot=%HDrive%\WINDOWS
SETENV -m SystemRoot %SystemRoot%
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "SystemRoot" /t REG_SZ /d "%HDrive%\WINDOWS" /f

ECHO SETTING windir=%HDrive%\WINDOWS
SET windir=%HDrive%\WINDOWS
SETENV -m windir %windir%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "windir" /t  REG_EXPAND_SZ /d "%SystemRoot%" /f

ECHO SETTING ComSpec=%HDrive%\windows\system32\cmd.exe
SET ComSpec=%HDrive%\windows\system32\cmd.exe
SETENV -m ComSpec %ComSpec%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "ComSpec" /t REG_EXPAND_SZ /d "%SystemRoot%\system32\cmd.exe" /f

ECHO SETTING ALLUSERSPROFILE=%HDrive%\ProgramData
SET ALLUSERSPROFILE=%HDrive%\ProgramData
SETENV -m ALLUSERSPROFILE %ALLUSERSPROFILE%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "ALLUSERSPROFILE" /t REG_SZ /d "%HDrive%\ProgramData" /f

ECHO SETTING CommonProgramFiles=%HDrive%\Program Files\Common Files
SET CommonProgramFiles=%HDrive%\Program Files\Common Files
SETENV -m CommonProgramFiles "%CommonProgramFiles%"
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "CommonProgramFiles" /t REG_SZ /d "%HDrive%\Program Files\Common Files" /f

ECHO SETTING ProgramData=%HDrive%\ProgramData
SET ProgramData=%HDrive%\ProgramData
SETENV -m ProgramData %ProgramData%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "ProgramData" /t REG_SZ /d "%HDrive%\ProgramData" /f

ECHO SETTING ProgramFiles=%HDrive%\Program Files
SET ProgramFiles="%HDrive%\Program Files"
SETENV -m ProgramFiles "%ProgramFiles%"
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "ProgramFiles" /t REG_SZ /d "%HDrive%\Program Files" /f

ECHO SETTING PUBLIC=%HDrive%\Users\Public
SET PUBLIC=%HDrive%\Users\Public
SETENV -m PUBLIC %PUBLIC%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "PUBLIC" /t REG_SZ /d "%HDrive%\Users\Public" /f

ECHO SETTING USERPROFILE=%HDrive%\Users\Default
REM SET USERPROFILE=%HDrive%\windows\system32\config\systemprofile
SET USERPROFILE=%HDrive%\Users\Default
SETENV -m USERPROFILE %USERPROFILE%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "USERPROFILE" /t REG_SZ /d "%HDrive%\Users\Default" /f
rem System Properties says: %USERPROFILE%\AppData\Local\Temp

ECHO SETTING TEMP=%HDrive%\windows\TEMP
SET TEMP=%HDrive%\windows\TEMP
SETENV -m TEMP %TEMP%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "TEMP" /t REG_EXPAND_SZ /d "%SystemRoot%\TEMP" /f

ECHO SETTING TMP=%HDrive%\windows\TEMP
SET TMP=%HDrive%\windows\TEMP
SETENV -m TMP %TMP%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "TMP" /t REG_EXPAND_SZ /d "%SystemRoot%\TEMP" /f

rem SET TEMP=X:\WINDOWS\TEMP
rem SETENV -m TEMP %TEMP%
rem SET TMP=X:\WINDOWS\TEMP
rem SETENV -m TMP %TMP%

ECHO SETTING JAVA_HOME=%HDrive%\Programs\Java\jre6
SET JAVA_HOME=%HDrive%\Programs\Java\jre6
SETENV -m JAVA_HOME %JAVA_HOME%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "JAVA_HOME" /t REG_SZ /d "%HDrive%\Programs\Java\jre6" /f

ECHO SETTING PATH
rem SET Path=%HDrive%\windows\system32;%HDrive%\windows;%HDrive%\windows\System32\Wbem;%JAVA_HOME%\bin;%SystemRoot%\;%CDDrive%\
SET Path=%HDrive%\windows\system32;%HDrive%\windows;%HDrive%\windows\System32\Wbem;%HDrive%\PROGRAMS\JAVA\JRE6\bin;%SystemRoot%\;%CDDrive%\
SETENV -m Path %Path%
reg add "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v "Path" /t REG_SZ /d "%HDrive%\windows\system32;%HDrive%\windows;%HDrive%\windows\System32\Wbem;%JAVA_HOME%\bin;%SystemRoot%\;%CDDrive%\" /f
ExpEnvVar_x86.exe
BroadcastEnvChange.exe /broadcast
SET  )

IF NOT EXIST %HDrive%\%HDTAG1% (
ECHO No HD, SETTING BOOT DRIVE AS CD= %CDDrive%
SET SystemDrive=%CDDrive%
SET SystemRoot=%CDDrive%\WINDOWS
SET windir=%CDDrive%\WINDOWS
SET JAVA_HOME=%CDDrive%\Programs\Java\jre6
SET Path=%CDDrive%\windows\system32;%CDDrive%\windows;%CDDrive%\windows\System32\Wbem;%JAVA_HOME%\bin;%SystemRoot%
SETENV -m CDDrive %CDDrive%
SETENV -m SystemDrive %SystemDrive%
SETENV -m SystemRoot %SystemRoot%
SETENV -m windir %windir%
SETENV -m Path %Path%
SET
PAUSE      )

ECHO   " Starting Win7Peldr..."
win7peldr.exe
ECHO.
ECHO.
ECHO   " Starting Windows Explorer..."
REM cls
COLOR 1F
ECHO.
ECHO.            HardDrive = %HDrive%     SystemRoot = %SystemRoot%
ECHO               CDDrive = %CDDrive%          windir = %windir%
ECHO           SystemDrive = %SystemDrive%            Temp = %Temp%
ECHO              USERNAME = %USERNAME%         Tmp = %Tmp%
ECHO.
ECHO.
ECHO                    #######################################
ECHO                    #                                     #
ECHO                    #      (Do Not Close This Window)     #
ECHO                    #                                     #
ECHO                    #         ** MINIMIZE ONLY **         #
ECHO                    #                                     #
ECHO                    #######################################
ECHO.
ECHO.
ECHO.
ECHO.
::  these did not work when viewed in advanced system properties
::   CompSpec, SystemRoot, TEMP, TMP, windir
:: merging c:\Environment.reg
:: Now they are correct in advanced system properties when .reg is merged
ECHO   " Registering Environment.reg..."
regedit /s Environment.reg
ECHO  
ECHO  Path:
ECHO  %Path%
%HDrive%\windows\explorer.exe

 

 

 

 

Regards

RoyM







Also tagged with one or more of these keywords: usb, install, pe, windows, win, boot

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users