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 :

Hta + commande "dos"


Sujet :

VBScript

  1. #1
    Membre à l'essai
    Inscrit en
    Mai 2012
    Messages
    28
    Détails du profil
    Informations forums :
    Inscription : Mai 2012
    Messages : 28
    Points : 20
    Points
    20
    Par défaut Hta + commande "dos"
    Bonsoir à tous,

    J'ai réalisé un script en ligne de commandes simples qui fonctionne à merveille sous CMD.

    J'ai décidé d'égayer un peu l'exécution de ces batchs en utilisant HTA.

    L'interface HTA est sympathique les scripts s'exécutent bien mais en fin de script batch je fais un Exit.
    A ce moment là j'ai une fenêtre IE qui s'ouvre et qui me demande soir d'ouvrir enregistrer ou fermer le fichier HTA...

    Alors que je voudrais qu'il revienne sur le HTA d'accueil sans me proposer les options citées ci-dessus...

    Depuis mon HTA je lance le batch :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    com="cmd /c "& Lettre &"\code\AssiLectQUsb.bat"
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Result=WshShell.Run(com,1,True) 'Option 1 Console Visible.Option 0 Console Invisible
    Il se lance et se termine, et c'est là qu'il me demande les options citées ci-dessus.

    En espérant avoir été assez claire

    Merci 1000 fois pour votre aide précieuse

    Spawn974

  2. #2
    Expert éminent
    Avatar de hackoofr
    Homme Profil pro
    Enseignant
    Inscrit en
    Juin 2009
    Messages
    3 830
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Enseignant

    Informations forums :
    Inscription : Juin 2009
    Messages : 3 830
    Points : 9 200
    Points
    9 200
    Par défaut

    C'est quoi votre OS ?
    Postez la source de votre HTA

  3. #3
    Membre à l'essai
    Inscrit en
    Mai 2012
    Messages
    28
    Détails du profil
    Informations forums :
    Inscription : Mai 2012
    Messages : 28
    Points : 20
    Points
    20
    Par défaut
    Voici :
    Os : 7 pro / 8 pro
    Hta :
    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
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    <html>
    <head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
    <title>Sauvegarde EnUser 1.5 avant migration (GUI) </title>
    <link rel="stylesheet" href="/css/style.css">
    <script language="JavaScript" src="/js/rollover.js"></script>
    <HTA:APPLICATION
      APPLICATIONNAME="SafeMigr"
      ID="AppSauvegardeEndUser"
      VERSION="1.5"
      ICON="img\favicon.ico"
      SCROLL="no"
      SCROLLFLAT="yes"
      CONTEXTMENU="no"
      NAVIGABLE="yes"
      SINGLEINSTANCE="yes"
      NAVIGABLE="yes"
      SELECTION="no"/>
    		<script language="VBScript">
    			Sub Window_onLoad
    				' msgbox "Msg de test vbs ""Bonjour le monde""",vbExclamation ,"Msg de Test"
    				window.moveTo 150,150
    				window.resizeTo 729,530
    			End Sub
     
    		' -------------------------------------------------------------
    		' 2.Récupération documents Pack Office, Multimédias, Cao Dao...
    		' -------------------------------------------------------------
    			Sub ChxMenu2
    				Set WshShell = CreateObject("WScript.Shell")
    				Lettre = WshShell.CurrentDirectory
    				Dim com,Result
    					Msgbox Lettre	
    				com="cmd /c "& Lettre &"\code\Docs.bat"
    				Result=WshShell.Run(com,1,True) 'Option 1 Console Visible.Option 0 Console Invisible
    			Set WshShell = Nothing 
    			End Sub
     
     
    			</script>
    </head>
    <body bgcolor="#ffffff">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" height="0">
    <tr>
    	<td align="center" valign="middle">
    		<table border="0" cellspacing="0" cellpadding="0" width="0">
             <tr>
                <td><div align="center"><img src="img/Titre.gif" alt="Gestion automatis&eacute;e de la sauvegarde avant migration" width="665" height="57" />
                </div>
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <th scope="col"><div align="left">
                        <h4><strong>&nbsp;</strong></h4>
                      </div></th>
                    </tr>
                    <tr>
                      <th scope="row">&nbsp;</th>
                    </tr>
                    <tr>
                      <th scope="row"><div align="left"> 
                        <h5>...<br>
                        </h5>
                      </div></th>
                    </tr>
                    <tr>
                      <th scope="row">&nbsp;</th>
                    </tr>
                    <tr>
                      <th scope="row"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
     
                          <th scope="col"></th>
                          <th scope="col"></th>
                        </tr>
                        <tr>
                          <th scope="row"><div align="left"><a href="#" target="_blank" onMouseOver="return rollover_on(Choix2, 'img/on/Btn_val_on.gif');"
                        onmouseout="return rollover_off(Choix2);" onclick=ChxMenu2()><img src="img/off/Btn_val_off.gif" alt="Choix 2 - Récupère fichiers avec extensions Pack Office, Cao/Dao, Multimédias" name="Choix2" hspace="0" vspace="0" border=0 align="absmiddle">R&eacute;cup&eacute;ration documents PO, Multim&eacute;dias, Cao/Dao...</a></div></th>
                          <th scope="row"></th>
                        </tr>
                        <tr>
                          <th colspan="2" scope="row">&nbsp;</th>
                        </tr>
                        <tr>
                          <th scope="row">&nbsp;</th>
                          <td>&nbsp;</td>
                        </tr>
                        <tr>
                          <th scope="row">&nbsp;</th>
                          <td>&nbsp;</td>
                        </tr>
                      </table></th>
                    </tr>
                    <tr>
                      <th scope="row">&nbsp;</th>
                    </tr>
                    <tr>
                    <th scope="row">
    				<div align="right">
    				<button type="button" name="Quitter"
    					style="background:white; cursor:pointer; border:solid 0px black; float: right;" 
    					onclick="opener=self;self.close()"
    					onMouseOver="return rollover_on(Quitter, 'img/on/Btn_fer_on.gif');"
    					onMouseOut="return rollover_off(Quitter);">
    					<img src="img/off/Btn_fer_off.gif" alt="Quitter l'utilitaire..." name="Quitter" hspace="0" vspace="0" border="0" align="right" />
     				</button></div>
    				</th>
    					</tr>
                    <tr>
                      <th scope="row"><div align="right">
                        <p><a href="HowTo.chm" target="_blank" onMouseOver="return rollover_on(Aide, 'img/on/Btn_Aide_on.gif');"
                        onmouseout="return rollover_off(Aide);"><img src="img/off/Btn_Aide_off.gif" alt="Comment ça marche ?" name="Aide" hspace="14" vspace="0" border=0 align="absmiddle"></a></p>
                        </div></th>
                    </tr>
                    <tr>
                      <th scope="row"><div align="right"></div></th>
                    </tr>
                    <tr>
                      <th scope="row"><div align="center"><img src="img/Footer.gif" alt="Pied de page" width="666" height="34" /></div></th>
                    </tr>
                  </table></td>
             </tr>
    		</table>
        </td>
    </tr>
    </table>
        <p>&nbsp; </p>
    </body>
    </html>
    Bonjour,

    Un ch'ti Up, Merci.

    Bonjour,

    Un ch'ti Up, Merci.

  4. #4
    Membre à l'essai
    Inscrit en
    Mai 2012
    Messages
    28
    Détails du profil
    Informations forums :
    Inscription : Mai 2012
    Messages : 28
    Points : 20
    Points
    20
    Par défaut
    Bonsoir à tous,

    J'ai trouvé la solution au final je passais par un lien HTML ce qui m'ouvrait une page web après l'exécution du script.

    Pour pallier à ça j'ai utilisé le contrôle Button.

    et cela fonctionne maintenant très bien.

    Je vous souhaite une Bonne soirée à tous.

    Spawn974

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    <td colspan="2"><img src="img/pixel_trans.gif"  width="150" height="1" hspace="0" vspace="0" border="0" align="left" />
    	<button type="button" name="Choix2"  class="Bouton"
    		onclick="ChxMenu2();"
    		onMouseOver="return rollover_on(Choix2, 'img/on/Btn_val_on.gif');"
    		onMouseOut="return rollover_off(Choix2);">
    		<img src="img/off/Btn_val_off.gif" alt="Choix 2 - R&eacute;cup鳥 fichiers avec extensions Pack Office, Cao/Dao, Multim&eacute;dias" name="Choix2" hspace="0" vspace="0" border="0" align="absmiddle" />R&eacute;cup&eacute;ration documents PO, Multim&eacute;dias, Cao/Dao...
    	</button>
    </td>

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. commande sous DOS
    Par zorian dans le forum Scripts/Batch
    Réponses: 4
    Dernier message: 27/04/2004, 12h21

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