Jump to content

i2i8

Active Members
  • Posts

    100
  • Joined

  • Last visited

Recent Profile Visitors

336 profile views

i2i8's Achievements

Adventurer

Adventurer (3/7)

1

Reputation

  1. @Andreik At the same time, thank you very much, thank you have been helping me.
  2. @NineI can't describe my admiration for you, you are simply a legend to me, the perfect solution to my problem, thank you so much, thank you again!
  3. @NineAfter executing your script, the data is as follows:
  4. Very sorrry, in this case, I didn't write it right. the GUID of my recovery partition is: \\?\Volume{1aafebf5-8d4b-487e-8ad8-754c15d8ed07}\ The end result I want to achieve is : $GUID = \\?\Volume{1aafebf5-8d4b-487e-8ad8-754c15d8ed07}\ Now that I have a GUID, I want to be able to assign a drive letter to the recovery partition with the following command: MountVol R: \\?\Volume{1aafebf5-8d4b-487e-8ad8-754c15d8ed07}\
  5. Thank you very much for your beautiful script, although all partition GUids are listed,But I don't know which GUID is the recovery partition. I am going to assign a drive letter to the recovery partition by its GUID. For example: MountVol R: \\?\Volume{eea3b237-18e9-4572-a656-ba4f3c6030a6}\
  6. @AndreikThank you very much for your reply, but it did not meet my needs. In fact, I am not an English operating system, ConsoleWrite($line0) outputs the following: ǽ¶¯Ʒ \\?\Volume{eea3b237-18e9-4572-a656-ba4f3c6030a6} ֐µľ탻Ӑ±ꇩ¡£ ¾�вÁкŊǠF4E6-FD70 \\?\Volume{eea3b237-18e9-4572-a656-ba4f3c6030a6}\Recovery µĄ¿¼ 2023/08/27 19:47 <DIR> . 2023/08/27 19:47 <DIR> .. 2023/08/27 19:47 <DIR> OEM 0 ¸ö΄¼þ 0 ז½ڍ 3 ¸öĿ¼ 164,650,033,152 ¿ɓ×ֽڍ ǽ¶¯Ʒ \\?\Volume{1aafebf5-8d4b-487e-8ad8-754c15d8ed07} ֐µľ탻Ӑ±ꇩ¡£ ¾�вÁкŊǠ9624-8F9F \\?\Volume{1aafebf5-8d4b-487e-8ad8-754c15d8ed07}\Recovery µĄ¿¼ 2023/07/25 21:44 <DIR> . 2023/07/25 21:44 <DIR> .. 2023/07/25 21:50 <DIR> Logs 2023/07/25 21:49 <DIR> WindowsRE 0 ¸ö΄¼þ 0 ז½ڍ 4 ¸öĿ¼ 88,928,256 ¿ɓ×ֽڍ My Function Func _GetRecoveryPartition() Local $GUID_TMP, $iPid $GUID_TMP = Run(@ComSpec & ' /C mountvol | find "\\?" >' & @TempDir & '\GUID.TMP','','', $STDOUT_CHILD+$STDERR_CHILD) ProcessWaitClose($GUID_TMP) $iPid = Run(@ComSpec & ' /C for /f %1 in ( ' & @TempDir & '\GUID.TMP' & ') do @dir %1Recovery /a 2> nul' ,'','', $STDOUT_CHILD+$STDERR_CHILD) Local $line0, $line1, $line2 While ProcessExists($iPid) $line0 = StdoutRead($iPid) ConsoleWrite($line0) WEnd EndFunc The end result I want to achieve is : $GUID = \\?\Volume{eea3b237-18e9-4572-a656-ba4f3c6030a6}\
  7. I have a string that looks like this: C:\>for /f %1 in ( a.txt ) do @dir %1Recovery /a 2> nul Volume in drive \\?\Volume{eea3b237-18e9-4572-a656-ba4f3c6030a6} has no label. Volume Serial Number is F4E6-FD70 Directory of \\?\Volume{eea3b237-18e9-4572-a656-ba4f3c6030a6}\Recovery 2023/08/27 19:47 <DIR> . 2023/08/27 19:47 <DIR> .. 2023/08/27 19:47 <DIR> OEM 0 File(s) 0 bytes 3 Dir(s) 165,001,043,968 bytes free Volume in drive \\?\Volume{1aafebf5-8d4b-487e-8ad8-754c15d8ed07} has no label. Volume Serial Number is 9624-8F9F Directory of \\?\Volume{1aafebf5-8d4b-487e-8ad8-754c15d8ed07}\Recovery 2023/07/25 21:44 <DIR> . 2023/07/25 21:44 <DIR> .. 2023/07/25 21:50 <DIR> Logs 2023/07/25 21:49 <DIR> WindowsRE 0 File(s) 0 bytes 4 Dir(s) 88,928,256 bytes free My Function Func _GetRecoveryPartition() Local $GUID_TMP, $iPid $GUID_TMP = Run(@ComSpec & ' /C mountvol | find "\\?" >' & @TempDir & '\GUID.TMP','','', $STDOUT_CHILD+$STDERR_CHILD) ProcessWaitClose($GUID_TMP) $iPid = Run(@ComSpec & ' /C for /f %1 in ( ' & @TempDir & '\GUID.TMP' & ') do @dir %1Recovery /a 2> nul' ,'','', $STDOUT_CHILD+$STDERR_CHILD) Local $line0, $line1 While ProcessExists($iPid) $line0 = StdoutRead($iPid) ConsoleWrite($line0) ... $line1 = StringRegExpReplace($line0, .) ConsoleWrite($line1) WEnd EndFunc With the above function, I don't know how to extract the desired result. The end result I want to achieve is : $GUID = \\?\Volume{eea3b237-18e9-4572-a656-ba4f3c6030a6}\ Can you help me? Thank you so much!
  8. Thank you very much for your reply. Back to this topic, I still don't know how to solve it.
  9. When the online system, the background is transparent, but in WinRE mode, the background becomes white, can the progress bar background become transparent in WinRE mode? @UEZI'm really looking forward to your help.
  10. I found a very beautiful progress bar UDF, the source code is as follows ;Fast hack by UEZ ;-) #include <GDIPlus.au3> #include <GUIConstantsEx.au3> ;#include <MsgBoxConstants.au3> #include <WinAPISysWin.au3> #include <WindowsConstants.au3> Opt("MustDeclareVars", 1) Opt("GUIOnEventMode", 1) Global $h = 150, $w = $h Global $hGUI = GUICreate("GDI+ Circle Progress Meter by UEZ 2010", $w, $h, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST)) Global $bg_color = 0xFFFFFF GUISetBkColor($bg_color) _WinAPI_SetLayeredWindowAttributes($hGUI, $bg_color, 0xFF) GUISetState() Circle_Progress_Init($hGUI, $w, $h, $bg_color) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST") Global $fx, $progress Global $angle = 0 Global $size = 111 Global $current = 0 Do $progress = $current / $size $angle = $progress * 360 Circle_Progress($angle, $progress * 100) $current += 1 Sleep(75) Until $angle > 359 Sleep(500) Circle_Progress(360, "Done", "%s") Sleep(2500) _Exit() Func Circle_Progress_Init($hWnd, $Weight, $Height, $bg_color = 0xFFFFFF) _GDIPlus_Startup() Global $font = "Arial" Global $fsize = Floor($h / 10) Global $pen_size = Floor($Height / 6) Global $hPen = _GDIPlus_PenCreate(0, $pen_size) Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hWnd) Global $hBitmap = _GDIPlus_BitmapCreateFromGraphics($Weight, $Height, $hGraphics) Global $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsClear($hBackbuffer, "0xFF" & $bg_color) _GDIPlus_GraphicsSetSmoothingMode($hBackbuffer, 2) EndFunc Func Circle_Progress($angle, $text, $sFormat = "%.2f", $fg_pencolor = 0xFF00FF00, $bg_pencolor = 0xFFD0FFD0, $clear_color = 0xFFFFFFFF) Local $ps2 = $pen_size / 2 _GDIPlus_GraphicsClear($hBackbuffer, $clear_color) _GDIPlus_PenSetColor($hPen, $bg_pencolor) _GDIPlus_GraphicsDrawEllipse($hBackbuffer, $ps2, $ps2, $w - $pen_size, $h - $pen_size, $hPen) _GDIPlus_PenSetColor($hPen, $fg_pencolor) _GDIPlus_GraphicsDrawArc($hBackbuffer, $ps2, $ps2, $w - $pen_size, $h - $pen_size, -90, $angle, $hPen) $fx = StringLen(StringFormat($sFormat, $text)) * $fsize / 2.5 _GDIPlus_GraphicsDrawString($hBackbuffer, StringFormat($sFormat, $text), $w / 2 - $fx, $h / 2 - $fsize * 0.75, $font, $fsize) _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, $w, $h) EndFunc Func Circle_Progress_Close() _GDIPlus_PenDispose($hPen) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_GraphicsDispose($hBackbuffer) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_Shutdown() EndFunc Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam) If ($hWnd = $hGui) And ($iMsg = $WM_NCHITTEST) Then Return $HTCAPTION EndFunc ;==>WM_NCHITTEST Func _Exit() Circle_Progress_Close() GUIDelete($hGUI) Exit EndFunc When I ran it in online system mode, everything worked fine.But when I run it in WinRE mode on a WIN7 X64 system, percentages are not displayed. Can you guys help me? Thanks a lot!
  11. very nice
  12. Thank you so much, you are right, the final code is as follows: Local $sPid = Run('bcdedit /create /d ' & '"' & $BootEntryName & '"' & ' /application OSLOADER','','', $STDOUT_CHILD + $STDERR_CHILD) If StringRegExp(StdoutRead($sPid), '(?i){',3) Then ProcessWaitClose($sPid) $GUID = _StringBetween(StdoutRead($sPid), "{", "}") EndIf MsgBox(0,0,$GUID[0])
  13. I have a script like this: Local $GUID, $BootEntryName = "Test" Local $sPid = Run('bcdedit /create /d ' & '"' & $BootEntryName & '"' & ' /application OSLOADER','','', $STDOUT_CHILD + $STDERR_CHILD) If StringRegExp(StdoutRead($sPid), '(?i){',3) Then MsgBox(0,0,'Yes') $GUID = _StringBetween(StdoutRead($sPid), "{", "}") ConsoleWrite($GUID[0]) EndIf In the code above, if I comment out the MsgBox , ConsoleWrite does not output any information. Why?
  14. I'm very sorry. I have to ask for help again. I want to use lis vol to find the efi partition and assign it a drive letter if it doesn't have one. The output is as follows: Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\windows\system32>chcp 437 Active code page: 437 C:\windows\system32> Microsoft DiskPart version 6.1.7601 Copyright (C) 1999-2008 Microsoft Corporation. On computer: WIN-9KKUI6K0PT8 DISKPART> Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- Volume 0 E DVD-ROM 0 B No Media Volume 1 C NTFS Partition 39 GB Healthy Volume 2 FAT32 Partition 100 MB Healthy Hidden Volume 3 D NTFS Partition 49 GB Healthy DISKPART> The above result is the output after I insert windows_server_2008_r2.iso and boot from CD-ROM. On the first screen of boot, press Shift + F10 and run the following script. #RequireAdmin Global $sRet,$aRet Local $iPid = Run(@ComSpec & " /c (echo,chcp 437) | cmd.exe & (echo, lis vol) | diskpart.exe", "C:\windows\system32", @SW_HIDE, 0x8) ProcessWaitClose($iPid) $sRet = BinaryToString(StdoutRead($iPid, 1, 1), 1) MsgBox(0, "", $sRet) Next, how should I write this script to assign a drive letter to vol 2 ?
  15. @AllenAA I would like your help with another question. As for the GUI above, after I click the Exit button, the exit event does not take effect, and the entire GUI cannot exit without any reaction. Could you please help me see what went wrong?
×
×
  • Create New...