Wmic Abfrage u. anhand des Herstellers, Modell Ordner erstellen
Hallo,
ich würde gerne eine wmic Abfrage kombinieren den Hersteller und das Modell auslesen (wmic csproduct get vendor, version) und dann Ordner bzw. Unterordner erzeugen lassen anhand des Herstellers bzw. Modell als Unterordner, wenn diese noch nicht vorhanden sind.
zum Beispiel:
d:\LENOVO\ThinkPad T410\
Danke für Eure Hilfe!
ich würde gerne eine wmic Abfrage kombinieren den Hersteller und das Modell auslesen (wmic csproduct get vendor, version) und dann Ordner bzw. Unterordner erzeugen lassen anhand des Herstellers bzw. Modell als Unterordner, wenn diese noch nicht vorhanden sind.
zum Beispiel:
d:\LENOVO\ThinkPad T410\
Danke für Eure Hilfe!
Please also mark the comments that contributed to the solution of the article
Content-ID: 666351
Url: https://administrator.de/forum/wmic-abfrage-u-anhand-des-herstellers-modell-ordner-erstellen-666351.html
Printed on: February 8, 2025 at 19:02 o'clock
2 Comments
Latest comment
cls
$Attr = Get-WmiObject -Class Win32_ComputerSystem -ComputerName . | Select-Object -Property *
$Hersteller = $attr.Manufacturer
$Modell = $attr.Model
$Pfad = "Y:\Temp\"+$Hersteller
$Subpfad = $Pfad +"\"+$Modell
if(Test-path -Path $Pfad) {
if(!(Test-Path $Subpfad)) {
New-Item -Path $Subpfad -ItemType directory
}
} else {
New-Item -Path $Pfad -ItemType directory
New-Item -Path $Subpfad -ItemType directory
}
Y:\TEMP\ => D:\