Bildschirmauflösung in Paket

Post Reply
ralph.hinkel
Posts: 21
Joined: 14. Dec 2004, 12:09
Location: Pirmasens
Contact:

Bildschirmauflösung in Paket

Post by ralph.hinkel » 08. Aug 2013, 09:16

Hallo allerseits,

ich benötige die aktuelle Bildschirmauflösung während der Installation eines Pakets.

Folgendes habe ich schon versucht:

Code: Select all

callhidden cmd.exe /c wmic.exe path win32_videocontroller get CurrentHorizontalResolution | find /V /I "CurrentHorizontalResolution" > "%temp%\resolution.txt"

Set CurrentHorizontalResolution=ReadTextFile ("%temp%\resolution.txt")

callhidden cmd.exe /c wmic.exe path win32_videocontroller get CurrentVerticalResolution | find /V /I "CurrentVerticalResolution" > "%temp%\resolution.txt"

Set CurrentVerticalResolution=ReadTextFile ("%temp%\resolution.txt")
Allerdings haben die Variablen dann noch zwei oder drei Zeilenumbrüche und damit kann ich bei String-Operationen nichts anfangen.

Hat jemand eine Idee?

Vielen Dank und Gruß
Ralph

Walter_Schulz
Posts: 876
Joined: 17. Dec 2004, 12:29
Contact:

Re: Bildschirmauflösung in Paket

Post by Walter_Schulz » 08. Aug 2013, 09:54

ralph.hinkel wrote:

Code: Select all

callhidden cmd.exe /c for /F "skip=1" %a in ('wmic.exe path win32_videocontroller get CurrentHorizontalResolution') do echo %a>> "%temp%\Hresolution.txt"

Set CurrentHorizontalResolution=ReadTextFile ("%temp%\Hresolution.txt")

callhidden cmd.exe /c for /F "skip=1" %a in ('wmic.exe path win32_videocontroller get CurrentVerticalResolution'') do echo %a>> "%temp%\Vresolution.txt"

Set CurrentVerticalResolution=ReadTextFile ("%temp%\Vresolution.txt")
Ciao!
Walter Schulz

ralph.hinkel
Posts: 21
Joined: 14. Dec 2004, 12:09
Location: Pirmasens
Contact:

Re: Bildschirmauflösung in Paket

Post by ralph.hinkel » 08. Aug 2013, 13:30

Danke für die schnelle Antwort aber es funktioniert nicht. :-(

Habe die Zeilen in meine setup.inf übernommen aber er erstellt irgendwie die Hresolution.txt und die Vresolution.txt nicht.

Habe den Befehl einfach mal in einer Eingabeaufforderung ausprobiert:

Code: Select all

for /F "skip=1" %a in ('wmic.exe path win32_videocontroller get CurrentHorizontalResolution') do echo %a>> "c:\temp\Hresolution.txt"
Dort generiert er folgende Hresolution.txt:

Code: Select all

1280
ECHO ist eingeschaltet (ON).
ECHO ist eingeschaltet (ON).

Schön zu erkennen sind die beiden Zeilenumbrüche. ;-)

Warum erstellt er die TXT-Dateien aus der sertup.inf heraus nicht und wir bekomme ich noch die beiden Zeilenumbrüche weg?

Vielen Dank und Gruß
Ralph

Walter_Schulz
Posts: 876
Joined: 17. Dec 2004, 12:29
Contact:

Re: Bildschirmauflösung in Paket

Post by Walter_Schulz » 08. Aug 2013, 13:44

Code: Select all

callhidden cmd /c for /F "skip=1" %a in ('wmic.exe path win32_videocontroller get CurrentHorizontalResolution') do @echo %a>> "c:\temp\Hresolution.txt"
Falls das nicht nach c:\temp schreibt, dann bitte

Code: Select all

callhidden cmd /c for /F "skip=1" %%a in ('wmic.exe path win32_videocontroller get CurrentHorizontalResolution') do @echo %%a>> "c:\temp\Hresolution.txt"
testen.

Ciao!
Walter Schulz

ralph.hinkel
Posts: 21
Joined: 14. Dec 2004, 12:09
Location: Pirmasens
Contact:

Re: Bildschirmauflösung in Paket

Post by ralph.hinkel » 08. Aug 2013, 13:57

Mit %%a legt er die TXTs jetzt an. Aber ich habe immer noch die "Echo Ons" für die beiden Zeilenumbrüche der WMIC-Ausgabe:

Code: Select all

1280
ECHO ist eingeschaltet (ON).
ECHO ist eingeschaltet (ON).

Vielen Dank für die Hilfe.

Gruß
Ralph

Walter_Schulz
Posts: 876
Joined: 17. Dec 2004, 12:29
Contact:

Re: Bildschirmauflösung in Paket

Post by Walter_Schulz » 08. Aug 2013, 14:29

Um Brutus zu zitieren (Streit um Asterix):
Werden wir brutal!

Code: Select all

callhidden cmd /c for /F "skip=1" %%a in ('wmic.exe path win32_videocontroller get CurrentHorizontalResolution') do @echo %%a>> "c:\temp\Hresolution.tmp"
callhidden cmd /c type c:\temp\hresolution.tmp|find /V "ECHO">>Hresolution.txt
Ciao!
Walter Schulz

ralph.hinkel
Posts: 21
Joined: 14. Dec 2004, 12:09
Location: Pirmasens
Contact:

Re: Bildschirmauflösung in Paket

Post by ralph.hinkel » 08. Aug 2013, 14:52

LOOOOOOL

Funzt.

Vielen lieben Dank.

Gruß
Ralph

###Ben###
Posts: 37
Joined: 05. Oct 2012, 12:00
Contact:

Re: Bildschirmauflösung in Paket

Post by ###Ben### » 23. Jan 2015, 09:36

Hallo,

habe mir das mal abgeguckt und versuche sowas Ähnliches:

Code: Select all

callhidden cmd /c for /f "skip=1" %%a in ('wmic.exe path win32_useraccount where (LocalAccount=true AND Name like '%TEST%') get Name') do @echo %%a "C:\temp\Hresolution.tmp"
Möchte damit innerhalb eines Skripts abfragen, ob ein Userkonto mit dem Namen schon existiert oder nicht und ggf. anlegen ODER das Passwort ändern (da die Empirum-eigenen Befehle "LocalUser.Add" bzw. "LocalUser.Mod" das nicht tolerieren?!).

Sobald die "where"-Bedingung mit ins Spiel kommt, verweigert der Befehl seinen Dienst...

Irgendwelche Ideen?

Danke & Gruß, Ben

###Ben###
Posts: 37
Joined: 05. Oct 2012, 12:00
Contact:

Re: Bildschirmauflösung in Paket

Post by ###Ben### » 26. Jan 2015, 10:23

Hab's anders gelöst:

Code: Select all

net user %VM_Username%
If %ErrorLevel% <> 0 Then "Erstellen" Else "Modifizieren" EndIf
Damit hab ich erreicht, was ich wollte.

User avatar
r.wiegel
Posts: 896
Joined: 05. Feb 2010, 13:45
Location: Regensburg
Contact:

Re: Bildschirmauflösung in Paket

Post by r.wiegel » 26. Jan 2015, 10:54

Was ist das Ziel?
Wenn man den Abschnitt <Display> in unattend.xml löscht, wird die Bildschirmauflösung optimal (auf Maximum) gesetzt...
Viele Grüße
Roman Wiegel
IT-Consultant

MR Datentechnik - Vertriebs- und Service GmbH

Post Reply

Return to “Paketierung”

Who is online

Users browsing this forum: No registered users and 8 guests