Bonjour,

Voici les paramètres : Je dois appliquer un fond d'écran spécifique lors de l'ouverture de session qui contient des paramètres d'affichages différents en fonction de la version de l'OS sur lequel le script s’exécute.

Je n'y connais malheureusement pas grand chose en script et voici ce que j'ai tenté de pondre, si une bonne âme charitable qualifié dans le domaine traîne par ici et puisse me dire ce qui merde je lui en serais extrêmement reconnaissant.

D'avance merci
Voici le script en question :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#OS detection
for /f "tokens=3" %%i in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CurrentVersion') do (
	set WindowsVersion=%%i
)

if "%WindowsVersion%"=="5.1" 
set

copy \\SRVPKDOM01\netlogon\fondecran.bmp %SYSTEMROOT%

reg add "HKEY_CURRENT_USER\Control Panel\Colors"  /v Background /t REG_SZ /d "255 255 255" /f
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "%SystemRoot%\fondecran.bmp" /f
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v TileWallpaper /t REG_SZ /d 0 /f
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v WallpaperStyle /t REG_SZ /d 2 /f



%SystemRoot%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters

then

if "%WindowsVersion%"=="6.1" 
set 

copy \\SRVPKDOM01\netlogon\fondecran.bmp %SYSTEMROOT%



reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "%SystemRoot%\fondecran.bmp" /f
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v TileWallpaper /t REG_SZ /d "0" /f
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v WallpaperStyle /t REG_SZ /d "6" /f
reg add "HKEY_CURRENT_USER\Control Panel\Colors"  /v Background /t REG_SZ /d "255 255 255" /f



%SystemRoot%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters