IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Scripts/Batch Discussion :

Fond d'écran et version system


Sujet :

Scripts/Batch

  1. #1
    Nouveau Candidat au Club
    Profil pro
    Inscrit en
    Novembre 2012
    Messages
    1
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2012
    Messages : 1
    Points : 1
    Points
    1
    Par défaut Fond d'écran et version system
    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

  2. #2
    Membre averti Avatar de plopi
    Homme Profil pro
    Analyste d'exploitation
    Inscrit en
    Mars 2011
    Messages
    191
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Analyste d'exploitation
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Mars 2011
    Messages : 191
    Points : 306
    Points
    306
    Par défaut
    Bonjour,

    ça pas à l'air trop mal, c'est quoi qui "merde" exactement ?

    sinon peut être essayer ça :

    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
    37
    38
    ::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" (call :WindowsVersion_XP)
    if "%WindowsVersion%"=="6.1" (call :WindowsVersion_SEVEN)
    
    
    :WindowsVersion_XP
    
    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
    
    call :end_script
    
    :WindowsVersion_SEVEN
    
    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
    
    call :end_script
    
    
    :end_script
    exit
    Enjoy

Discussions similaires

  1. emplacement de l'image de fond d'écran win xp
    Par t26 dans le forum Windows XP
    Réponses: 3
    Dernier message: 02/09/2005, 10h22
  2. image de fond d'écran
    Par badr dans le forum Balisage (X)HTML et validation W3C
    Réponses: 4
    Dernier message: 28/04/2005, 16h50
  3. [Debutant] Fond d'écran
    Par Tchakeur dans le forum OpenGL
    Réponses: 2
    Dernier message: 24/01/2005, 11h47
  4. Problème de clignotement de fond d'écran en mode MDI
    Par Tardiff Jean-François dans le forum Composants VCL
    Réponses: 3
    Dernier message: 17/12/2004, 16h19
  5. Comment changer l'image Bitmap en fond d'écran du bureau ?
    Par Maddelphi dans le forum API, COM et SDKs
    Réponses: 8
    Dernier message: 23/06/2004, 19h57

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo