Jump to content

Coucher

Member
  • Posts

    8
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

About Coucher

Coucher's Achievements

0

Reputation

  1. D'oh! Not sure how I missed something so simple. After changing to double % marks it works perfectly. Thanks!!
  2. Ok, here's some background on what I'm trying to do... Trying to have a USB HDD with WinPE 3.0 on it and multiple WIM files on the HDD for various types of machines that I build. What I have currently is the above, and from the startnet.cmd I call a batch file (build_machine.bat) that invokes diskpart to prepare the disk, then corrects the boot sector using bootsect.exe, then applies image.wim to the target disk. What I've been doing is just renaming whatever <machine type>.wim file to image.wim for the ones I was doing the most of at that time. Trying to build some automation into the process where the batch file queries the BIOS info from the registry and get's the machine family name, sets that to a variable (%image%), then invokes imagex pointing to %image%.wim. The problem I'm running into is with the command that I'm using to query the registry and set the returned value as a system variable. If I manually execute the command via the command prompt within WinPE it works perfectly, sets the system variable exactly as it should, however when I take that exact command and add it as a line in my build_machine.bat file, it errors out. Here's the query command: for /f "tokens=3,*" %a in ('reg query HKLM\HARDWARE\DESCRIPTION\System\BIOS /v SystemFamily ^| findstr SystemFamily') do set image=%b Which works fine run from the command prompt, but when run from within the batch file errors out with "b was unexpected at this time." Any ideas? Thanks in advance.
  3. Just to update in case anyone ever comes across the post while searching, I added the "del %0" command to the end to have the bat file self delete after running. Works just as it should. Bat file runs, then deletes itself. @ECHO OFF FOR /F "TOKENS=2-4 DELIMS=/ " %%A IN ('DATE /T') DO ( REG ADD HKLM\SOFTWARE\PGA-IGA\PREP /V INSTALLDATE /D "%%A\%%B\%%C" /F>NUL) del %0
  4. That is actually VERY close, however the key it created/updated has "Thu 08\20\2009" rather than "08\20\2009"
  5. I have a need to update a specific registry key with the current date on the first boot of the machine after it is imaged. Additionally, one issue is that the slashes have to be reversed. For example, if the date is 08/16/2009, the registry key needs to be updated to 08\16\2009. What I'm visualizing is this: A bat file of some sort that is set to run once on the first boot. The bat file would somehow query for the current date, then create a reg file replacing the "/"s with "\"s. Then execute the merging of the created reg file by invoking REGEDIT.EXE /S importfile.REG This is just what I'm envisioning. If there's a better way, I'm definitely open to suggestions. If it matters, this is what the created reg file with the current date would need to look like: Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\PGP-IGA] [HKEY_LOCAL_MACHINE\SOFTWARE\PGP-IGA\PREP] "INSTALLDATE"="08\16\2009" Thanks in advance for any help, assistance or advice!
  6. I follow your logic above and agree with it. However the difficult thing is the drive letter never changes. Whether the "PE hdd" shows up in PE as hdd0 or hdd1, it still shows up as C: drive letter. So whatever error checking I do has to somehow identify whether it's hdd0 or hdd1.
  7. Guys, I've run into a problem that I need some help with. I'm not using an image server to do imaging. I use an image hdd (80gb hdd with WinPE and all my WIMs on it). All of my imaging is done on laptops (IBM/Lenovo Thinkpads to be exact). I put the image hdd in an ultrabay tray (removable hdd tray that goes into the CD/DVD bay) and into the Thinkpad. F12, select hdd1 as the boot device, and boot into PE. Works great and is VERY fast. Once PE loads I of course am at an X: prompt. I change to a C: prompt which is my PE hdd and then execute a CMD file(partition.cmd) which starts diskpart /s partition.txt which does the following: select disk 0 clean create partition primary size=10000 select partition 1 active format FS=ntfs label="C_Drive" quick exit Now I'm back at my PE hdd C: prompt. I then have several CMD files for automating the image process based on the specific model of the machine. The problem I'm running into is that it's a 50/50 shot once you're actually in PE as to how PE see's the hdd's, regardless of how the BIOS saw them. For instance the WinPE hdd is always hdd1 in the BIOS boot list, however sometimes once booted into PE, PE see's the hdd's the opposite way. The Thinkpad's hdd is hdd1 according to PE, and the image hdd is now hdd0, so when I execute the script to clean and format "hdd0" it ends up wiping the image disk if on that particular boot PE sees it as hdd0 rather than hdd1. I'm wanting to try to write some logic to do some fashion of check first before invoking the disk part command, but not really sure at which point to do so, or what information I can use to key off of. Thoughts? Thanks in advance.
×
×
  • Create New...