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 :

(echo *> ftp) & (formulaire hta,variable dans un batch)


Sujet :

Scripts/Batch

  1. #1
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Mars 2009
    Messages
    43
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2009
    Messages : 43
    Points : 36
    Points
    36
    Par défaut (echo *> ftp) & (formulaire hta,variable dans un batch)
    Bonjour a tous, je revient avec 2 soucis

    1 - Modification d'un fichier txt sur un ftp
    Existe t'il sous fichier batch, la possibilité d'écrire sur un fichier .txt sur un ftp distant, disposant des droits en écriture ?
    Pour détails, je voudrai éviter la commande dos Ftp qui m'obligerai a laisser visible le mot de pass du ftp en question.

    2 - Comment puis-je récupérer les valeurs de mes variables provenant d'un formulaire hta, dans un fichier batch ?

    Merci d'avance

  2. #2
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Mars 2009
    Messages
    43
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2009
    Messages : 43
    Points : 36
    Points
    36
    Par défaut
    Pour le 2eme souci j'ai trouver comme un grand avec mon ami google

    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
    @echo off
    :: This batch file will create an HTML Application (HTA).
    :: Values entered in the HTA will be saved as %TEMP%\USERIN.BAT
    :: After the USERIN.BAT is CALLed from the main batch 
    :: (and assuming there is enough room in the environment)
    :: environmental variables USERNAME and PASSWORD will be set.
    :: It is your responsibility to delete the USERIN.BAT
    :: after you CALL it. Because this batch file needs to
    :: find itself, you must be sure to call it from your 
    :: main batch file with a full path and file name.
    :: Written and tested under Win95. NT/2000/XP users will
    :: have to do some modifications before it will work.
    :: For example, %0 changes to %f0
    :: Public Domain. Use freely. No guarantees! It may not work!
    :: http://www.ericphelps.com
    
    cls
    echo Please enter your user name and password in the entry box...
    :: See if I can find myself
    If not exist %0 goto ERROR
    :: Make the web page
    type %0 | find "    " | find /v "Not Me!" > %TEMP%\UserIn.hta
    :: Run the vbs code
    start /w %TEMP%\UserIn.hta
    :: At this point a batch file "%TEMP%\UserIn.bat" exists and you should 
    :: call it! If you don't call the batch file here and instead opt to
    :: call it from another batch file, be sure NOT to delete it in the
    :: "Clean up" code section below!
    call %TEMP%\UserIn.bat
    echo Your user name is %USERNAME%
    echo Your password is %PASSWORD%
    :: Clean up
    del %TEMP%\UserIn.hta
    del %TEMP%\UserIn.bat
    goto DONE
    
    :ERROR
    cls
    echo %0 is not the full path and file name
    echo for the batch file. You MUST call this
    echo batch file with a full path and file name.
    goto DONE
    
    :HTA
    :: All HTA code MUST be indented four or more spaces.
    :: NOTHING else in this batch file may be indented four spaces.
        <html>
        <head>
        <title>Password Entry</title>
        <hta:application>
        <script language="vbscript">
            window.resizeTo 250,200
            Sub SaveBatch()
                Set fs = CreateObject("Scripting.FileSystemObject")
                strFile = fs.GetAbsolutePathName(fs.BuildPath(fs.GetSpecialFolder(2), "UserIn.bat"))
                Set ts = fs.OpenTextFile(strFile, 2, True)
                ts.WriteLine "SET USERNAME=" & document.Forms(0).elements("username").value
                ts.WriteLine "SET PASSWORD=" & document.Forms(0).elements("password").value
                ts.Close
            End Sub
        </script>
        </head>
        <body>
        <form>
            User Name:
            <br><input type=text name=username tabindex=1>
            <br>Password:
            <br><input type=password name=password>
            <br><input type=button language="vbscript" value="OK"
            onclick="SaveBatch : Window.Close">
        </form>
        <script language=vbscript>
            document.Forms(0).elements("username").focus
        </script>
        </body>
        </html>
    
    :DONE

  3. #3
    Expert éminent
    Avatar de shawn12
    Homme Profil pro
    Chef de projet en SSII
    Inscrit en
    Avril 2006
    Messages
    3 368
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 38
    Localisation : France

    Informations professionnelles :
    Activité : Chef de projet en SSII
    Secteur : Finance

    Informations forums :
    Inscription : Avril 2006
    Messages : 3 368
    Points : 6 800
    Points
    6 800
    Par défaut
    Citation Envoyé par wnx83 Voir le message
    Existe t'il sous fichier batch, la possibilité d'écrire sur un fichier .txt sur un ftp distant, disposant des droits en écriture ?
    Pour détails, je voudrai éviter la commande dos Ftp qui m'obligerai a laisser visible le mot de pass du ftp en question.
    Dans tous les cas, si tu utilises l'invite de commande, tu ne pourras pas masquer le mot de passe utilisé.
    La commande FTP reste donc une bonne solution. Tu peux l'utiliser en lui passant un fichier en paramètre (en mettant les différentes commandes FTP dans le fichier).
    Maitrisez toutes les subtilités de Windows 8 en lisant la FAQ Windows 8. N'hésitez pas à proposer vos Q/R.
    _ _ _
    Découvrez toutes les facettes de Windows 7 et maitrisez toutes ses fonctionnalités grâce au livre Windows 7 Avancé

  4. #4
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Mars 2009
    Messages
    43
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2009
    Messages : 43
    Points : 36
    Points
    36
    Par défaut
    Je penser surtout a un echo quelque chose >> fichier distant
    En me servant des chmods pour donnée le droit en écriture a tout le monde.
    A la base je compte essayer de créer une "messagerie" qui garderai en compte les x dernières lignes.

    Je ne peut donc pas utiliser les password ftp depuis l'application

  5. #5
    Expert éminent
    Avatar de shawn12
    Homme Profil pro
    Chef de projet en SSII
    Inscrit en
    Avril 2006
    Messages
    3 368
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 38
    Localisation : France

    Informations professionnelles :
    Activité : Chef de projet en SSII
    Secteur : Finance

    Informations forums :
    Inscription : Avril 2006
    Messages : 3 368
    Points : 6 800
    Points
    6 800
    Par défaut
    Dans ce cas, tu peux autoriser les connexions anonymes sur ton serveur FTP pour que tout le monde puisse y écrire. Mais tu aura toujours besoin de la commande ftp pour écrire sur ton serveur FTP.
    Maitrisez toutes les subtilités de Windows 8 en lisant la FAQ Windows 8. N'hésitez pas à proposer vos Q/R.
    _ _ _
    Découvrez toutes les facettes de Windows 7 et maitrisez toutes ses fonctionnalités grâce au livre Windows 7 Avancé

Discussions similaires

  1. Passer nom de formulaire en variable dans fonction publique
    Par clickandgo dans le forum VBA Access
    Réponses: 22
    Dernier message: 23/04/2012, 19h01
  2. passage de variables dans un formulaire
    Par albo69 dans le forum Langage
    Réponses: 4
    Dernier message: 16/02/2006, 22h52
  3. [DOS] Variables dans un batch
    Par Amnesiak dans le forum Autres Logiciels
    Réponses: 6
    Dernier message: 02/02/2006, 14h36
  4. Réponses: 1
    Dernier message: 25/09/2005, 14h29

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