Hi guys.
I am try to get USB/HDD/PortableHDD/PortableSSD/ExternalDisks name and save to the .txt file.
I am using WMI header on NSIS-wiki
But not successful.
Someone help me.
Thanks.
NSIS how to get USB/HDD/PortableHDD name and save to text
8 posts
Which name? Volume/partition label name? Name of the hardware?
Post the code you have tried.
Post the code you have tried.
@Anders All USB/Fixed Disks Name, not label/volume/partition name.
Play around with the WMIC tool to find out where this information is stored.
https://nsis.sourceforge.io/WMI_header
${WMIGetInfo} ROOT\CIMV2 Win32_DiskDrive Model Win32_DiskDrive_Model
Function Win32_DiskDrive_Model
DetailPrint '$R0/$R1 = $R2'
;StrCpy $Var_Disks '$R2$\n'
FunctionEnd
It is show disks, but I do not know how to save to .txt.
${WMIGetInfo} ROOT\CIMV2 Win32_DiskDrive Model Win32_DiskDrive_Model
Function Win32_DiskDrive_Model
DetailPrint '$R0/$R1 = $R2'
;StrCpy $Var_Disks '$R2$\n'
FunctionEnd
It is show disks, but I do not know how to save to .txt.
Originally Posted by meoit View Posthttps://nsis.sourceforge.io/WMI_header
${WMIGetInfo} ROOT\CIMV2 Win32_DiskDrive Model Win32_DiskDrive_Model
Function Win32_DiskDrive_Model
DetailPrint '$R0/$R1 = $R2'
;StrCpy $Var_Disks '$R2$\n'
FunctionEnd
It is show disks, but I do not know how to save to .txt.
!include WMI.NSH
Var Memo
Section
${WMIGetInfo} ROOT\CIMV2 Win32_DiskDrive Model Win32_DiskDrive_Model
SectionEnd
Function Win32_DiskDrive_Model
FileOpen $Memo "$EXEDIR\DiskDrives.txt" a
FileSeek $Memo 0 END
FileWrite $Memo '$R0/$R1 = $R2'
FileClose $Memo
FunctionEnd
Thanks r2du-soft.
Content display on 1 line.
How to show per line for object.
Content display on 1 line.
How to show per line for object.
Add $\r$\n. You should be able to research these basic issues on your own...Originally Posted by meoit View PostThanks r2du-soft.
Content display on 1 line.
How to show per line for object.