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

VBScript Discussion :

[VBS] windows scripting


Sujet :

VBScript

  1. #1
    Candidat au Club
    Profil pro
    Inscrit en
    Mai 2005
    Messages
    3
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2005
    Messages : 3
    Points : 4
    Points
    4
    Par défaut [VBS] windows scripting
    Bonjour,

    Je dois faire un script batch qui doit lancer un executable dont on passe le chemin en parametre

    C'est tout simple dans la fonctionnalité, mais je ne trouve pas de doc sur internet concernant le windows scripting (fichiers extansion = .vbs ou .wsf)

  2. #2
    Expert confirmé
    Avatar de pc75
    Profil pro
    Inscrit en
    Septembre 2004
    Messages
    3 662
    Détails du profil
    Informations personnelles :
    Âge : 69
    Localisation : France, Paris (Île de France)

    Informations forums :
    Inscription : Septembre 2004
    Messages : 3 662
    Points : 4 047
    Points
    4 047
    Par défaut
    Bonjour,

    Un extrait de MSDN :

    Microsoft® Windows® Script Host
    Run Method WSH Reference
    Version 1

    Applies To


    --------------------------------------------------------------------------------

    Description
    Creates a new process that executes strCommand.
    Syntax
    object.Run (strCommand, [intWindowStyle], [bWaitOnReturn])
    Parameters
    Part Description
    object WshShell object.
    strCommand Environment variables within the strCommand parameter are automatically expanded.
    intWindowStyle Optional. Sets the window style of the program being run.
    bWaitOnReturn Optional. If bWaitOnReturn is not specified or FALSE, immediately returns to script execution rather than waiting for the process to end.
    If bWaitOnReturn is set to TRUE, the Run method returns any error code returned by the application.

    If bWaitOnReturn is not specified or is FALSE, the Run method returns an error code of 0 (zero).



    Remarks
    The following table lists the available settings for intWindowStyle:
    intWindowStyle Description
    0 Hides the window and activates another window.
    1 Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time.
    2 Activates the window and displays it as a minimized window.
    3 Activates the window and displays it as a maximized window.
    4 Displays a window in its most recent size and position. The active window remains active.
    5 Activates the window and displays it in its current size and position.
    6 Minimizes the specified window and activates the next top-level window in the Z order.
    7 Displays the window as a minimized window. The active window remains active.
    8 Displays the window in its current state. The active window remains active.
    9 Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when restoring a minimized window.
    10 Sets the show state based on the state of the program that started the application.



    Example
    The following example runs Microsoft Notepad and opens the currently running script:
    Set WshShell = WScript.CreateObject("WScript.Shell")
    WshShell.Run ("%windir%\notepad" & WScript.ScriptFullName)
    The following example returns the error code from the executed application:
    Set WshShell = WScript.CreateObject("WScript.Shell")
    Return = WshShell.Run("notepad " & WScript.ScriptFullName, 1, TRUE)

Discussions similaires

  1. windows script appelé par VBA excel
    Par nysduc dans le forum Macros et VBA Excel
    Réponses: 2
    Dernier message: 05/04/2011, 10h31
  2. Windows Script Host Debugger - Windows 7 (64 Bits)
    Par Feneck91 dans le forum VBScript
    Réponses: 3
    Dernier message: 22/11/2010, 21h05
  3. [Windows - Scripts d'Arret / Démarrage]
    Par loguiss dans le forum DB2
    Réponses: 7
    Dernier message: 13/05/2009, 17h01
  4. VBS - Java Script et vbs dans un fichier .hta
    Par Lorponos dans le forum VBScript
    Réponses: 5
    Dernier message: 20/07/2006, 13h11
  5. WSH windows scripting host vbs: delphi et script
    Par nek_kro_kvlt dans le forum Langage
    Réponses: 5
    Dernier message: 30/11/2005, 17h55

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