A voir également:
- VBS
- Vbs windows - Accueil - Optimisation
- Vbs - Télécharger - Édition & Programmation
- Vbs editor - Télécharger - Édition & Programmation
- Fichier vbs ✓ - Forum Virus
- Vbs malware gen ✓ - Forum Virus
2 réponses
==> si le fichier indiqué existe alors
pour plus d'info voir: titoriel VBS VB script
http://toptech.geekaddict.net/t97-titoriel-pour-vbs-vb-script#104
pour plus d'info voir: titoriel VBS VB script
http://toptech.geekaddict.net/t97-titoriel-pour-vbs-vb-script#104
jesuismoi
mais dir& signifie koi ?
Bonjour,
if WScript.ScriptFullName=dir&"\test.txt" then
dir&"\test.txt" ???
il faut lire :
dir & "\test.txt"
mais cette syntaxe n'a pas de sens.
Il faudrait plustôt écrire comme suit :
n.b. L'instruction Dir n'est valide que sous VBA ou VB,
mais il n'est pas reconnu sous VBS.
Cdt
Lupin
if WScript.ScriptFullName=dir&"\test.txt" then
dir&"\test.txt" ???
il faut lire :
dir & "\test.txt"
mais cette syntaxe n'a pas de sens.
Il faudrait plustôt écrire comme suit :
Dim LeFichier, MonFichier
LeFichier = WScript.ScriptFullName
MonFichier = Left(LeFichier, InStrRev(LeFichier, "\"))
MonFichier = MonFichier & "Test.txt"
If (FichierExistant(MonFichier)) Then
WScript.Echo "Fichier existant."
Else
WScript.Echo "Fichier n'existe pas."
End If
Wscript.Quit(0)
Function FichierExistant(NomFichier)
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
FichierExistant = fso.FileExists(NomFichier)
Set fso = Nothing
End Function
'
n.b. L'instruction Dir n'est valide que sous VBA ou VB,
mais il n'est pas reconnu sous VBS.
Cdt
Lupin