Dans le message :, RS a pris la peine d'écrire ce qui suit :
Bonjour,
Comment "récupérer" la résolution de l'écran dans un fichier .bat ? (1024x768, etc ...)
Avec un VBSCRIPT WMI :
Fichier "GetVideoMode.vbs" ------- couper ici ------- On Error Resume Next strComputer = "." Set colItems = objWMIService.ExecQuery("Select * from Win32_VideoController",,48) For Each objItem in colItems X=objItem.CurrentHorizontalResolution Y=objItem.CurrentVerticalResolution If X<>"" and Y<>"" Then Wscript.Echo X & " x " & Y Next ------- couper ici -------
I:VBS>getvideomode.vbs 1280 x 1024
A toi d'adapter ! (ce script peut fonctionner à DISTANCE : il suffit de remplir "strcomputer" par le nom NetBIOS du PC distant)
-- May the Force be with You! La Connaissance s'accroît quand on la partage ---------------------------------------------------------- Jean-Claude BELLAMY [MVP] http://www.bellamyjc.org ou http://jc.bellamy.free.fr
Dans le message :2A9816FA-6A1A-483A-BAE1-8F9DEBEF3093@microsoft.com,
RS <RS@discussions.microsoft.com> a pris la peine d'écrire ce qui suit :
Bonjour,
Comment "récupérer" la résolution de l'écran dans un fichier .bat ?
(1024x768, etc ...)
Avec un VBSCRIPT WMI :
Fichier "GetVideoMode.vbs"
------- couper ici -------
On Error Resume Next
strComputer = "."
Set colItems = objWMIService.ExecQuery("Select * from
Win32_VideoController",,48)
For Each objItem in colItems
X=objItem.CurrentHorizontalResolution
Y=objItem.CurrentVerticalResolution
If X<>"" and Y<>"" Then Wscript.Echo X & " x " & Y
Next
------- couper ici -------
I:VBS>getvideomode.vbs
1280 x 1024
A toi d'adapter !
(ce script peut fonctionner à DISTANCE : il suffit de remplir "strcomputer"
par le nom NetBIOS du PC distant)
--
May the Force be with You!
La Connaissance s'accroît quand on la partage
----------------------------------------------------------
Jean-Claude BELLAMY [MVP]
http://www.bellamyjc.org ou http://jc.bellamy.free.fr
Dans le message :, RS a pris la peine d'écrire ce qui suit :
Bonjour,
Comment "récupérer" la résolution de l'écran dans un fichier .bat ? (1024x768, etc ...)
Avec un VBSCRIPT WMI :
Fichier "GetVideoMode.vbs" ------- couper ici ------- On Error Resume Next strComputer = "." Set colItems = objWMIService.ExecQuery("Select * from Win32_VideoController",,48) For Each objItem in colItems X=objItem.CurrentHorizontalResolution Y=objItem.CurrentVerticalResolution If X<>"" and Y<>"" Then Wscript.Echo X & " x " & Y Next ------- couper ici -------
I:VBS>getvideomode.vbs 1280 x 1024
A toi d'adapter ! (ce script peut fonctionner à DISTANCE : il suffit de remplir "strcomputer" par le nom NetBIOS du PC distant)
-- May the Force be with You! La Connaissance s'accroît quand on la partage ---------------------------------------------------------- Jean-Claude BELLAMY [MVP] http://www.bellamyjc.org ou http://jc.bellamy.free.fr