Pinned post

Apple Vision Pro M5 review: everything looks sharper, especially virtual desktop mode, and the Dual Knit band is comfortable, but the headset still costs $3,500 (Lance Ulanoff/TechRadar)

Lance Ulanoff / TechRadar : Apple Vision Pro M5 review: everything looks sharper, especially virtual desktop mode, and the Dual Knit band...

Showing posts with label Scripting. Show all posts
Showing posts with label Scripting. Show all posts

31 March 2023

Detect whether Windows PE is booted in BIOS or UEFI mode

Check the HKLM\System\CurrentControlSet\Control\PEFirmwareType registry value to see if the PC is booted to UEFI or BIOS mode. Note: you may need to run wpeutil UpdateBootInfo to make sure this value is present.


reg query HKLM\System\CurrentControlSet\Control /v PEFirmwareType

This command returns 0x1 if the PC is booted into BIOS mode, or 0x2 if the PC is booted in UEFI mode.


wpeutil UpdateBootInfo
for /f "tokens=2* delims=  " %%A in ('reg query HKLM\System\CurrentControlSet\Control /v PEFirmwareType') DO SET Firmware=%%B
:: Note: delims is a TAB followed by a space.
if %Firmware%==0x1 echo The PC is booted in BIOS mode.
if %Firmware%==0x2 echo The PC is booted in UEFI mode.

FW: Tweet by Guy Leech on Twitter

 

 

 


Guy Leech

‪@guyrleech

1.5 hour call with a new customer (on a Friday night) to troubleshoot ‪@citrix and guess what the problem was?

Yes, D N S

Hosts file entries as a temporary band aid got them going after structured troubleshooting led

#PowerShell tnc (Test-NetConnection) was instrumental

 

17/02/2023, 20:38

 

 

 

20 March 2023

Find a USB plug the simple way

Find the Drive Letter for a USB plug by either Volume Label or by an existing file.

@ECHO OFF
FOR %%d 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 %%d:\TheUSB.txt SET USBDrv=%%d:

Echo  "The USB is %USBDrv%" 

Pause

for /f %%D in ('wmic volume get DriveLetter^, Label ^| find "TheUSB"') do set usbdrv=%%D

Echo  "The USB is %USBDrv%"

Pause

WDS Add /Remove Pre-staged Computers

Add a Pre-Staged Computer to WDS using the MAC Address (FFFFFFFFFFFF). Set the image to Boot first

REM Remove WDS Pre-Staged Computers
Net Computer \\Bay01 /Del

REM Add WDS Pre-Staged Computers
wdsutil /Add-Device /Device:Bay01 /ID:0000000000000000000000FFFFFFFFFFFF /BootProgram:Boot\x64\PXEBOOT.N12 /FORCE /BootImagePath:"Boot\x64\Images\Image.wim"

Get IP Address

Find the IP Address in a batch script and save it as a variable.


for /f "delims=[] tokens=2" %%a in ('ping -4 -n 1 %ComputerName% ^| findstr [') do set NetworkIP=%%a
echo Network IP: %NetworkIP%
pause