[VBS][DOS]
Fermé
TheRealGRiz
Messages postés
8
Date d'inscription
samedi 16 janvier 2016
Statut
Membre
Dernière intervention
17 janvier 2016
-
Modifié par TheRealGRiz le 16/01/2016 à 23:03
cs_Le Pivert Messages postés 7883 Date d'inscription jeudi 13 septembre 2007 Statut Contributeur Dernière intervention 18 mars 2023 - 17 janv. 2016 à 13:30
cs_Le Pivert Messages postés 7883 Date d'inscription jeudi 13 septembre 2007 Statut Contributeur Dernière intervention 18 mars 2023 - 17 janv. 2016 à 13:30
1 réponse
cs_Le Pivert
Messages postés
7883
Date d'inscription
jeudi 13 septembre 2007
Statut
Contributeur
Dernière intervention
18 mars 2023
724
17 janv. 2016 à 08:08
17 janv. 2016 à 08:08
Bonjour,
Voir ceci:
https://stackoverflow.com/questions/4388879/vbscript-output-to-console
Voir ceci:
https://stackoverflow.com/questions/4388879/vbscript-output-to-console
Set oWSH = CreateObject("WScript.Shell")
vbsInterpreter = "cscript.exe"
Call ForceConsole()
Function printf(txt)
WScript.StdOut.WriteLine txt
End Function
Function printl(txt)
WScript.StdOut.Write txt
End Function
Function scanf()
scanf = LCase(WScript.StdIn.ReadLine)
End Function
Function wait(n)
WScript.Sleep Int(n * 1000)
End Function
Function ForceConsole()
If InStr(LCase(WScript.FullName), vbsInterpreter) = 0 Then
oWSH.Run vbsInterpreter & " //NoLogo " & Chr(34) & WScript.ScriptFullName & Chr(34)
WScript.Quit
End If
End Function
Function cls()
For i = 1 To 50
printf ""
Next
End Function
printf " _____ _ _ _____ _ _____ _ _ "
printf "| _ |_| |_ ___ ___| |_ _ _ _| | | __|___ ___|_|___| |_ "
printf "| | | '_| . | | --| | | | . | |__ | _| _| | . | _|"
printf "|__|__|_|_,_|___|_|_|_____|_____|___| |_____|___|_| |_| _|_| "
printf " |_| v1.0"
printl " Entrez votre nom:"
MyVar = scanf
cls
printf "Votre nom est: " & MyVar
wait(5)
Modifié par TheRealGRiz le 17/01/2016 à 13:03
Cependant je voudrais n'afficher que des boites de dialogue dans wscript (c'est pour ça que j'utilise un vbscript et non un batch) et que csript reste invisible. Il me semble qu'on peut le faire avec ou avec
17 janv. 2016 à 13:30
https://tahe.developpez.com/web/vbscript/?page=page_2#LII-B
@+