'http://www.vbfrance.com/codes/VBS-ECRIVANT-DANS-LE-BLOC-NOTE-/32820.aspx
'définission de la variable
'la variable peut porter n'importe quel nom, ici variable.
Set variable=CreateObject("WScript.Shell")
'lancement du notepad dans le répertoire "C:\WINDOWS\System32" grace a la commande "nom de la variable.Run"
'Bien sur, vous pouvez lancer d'autre chose, du moment que son répertoire est correctement indiquer.
'variable.Run("C:\WINDOWS\System32\notepad.exe")
'MJ attente 1 secondes
'wscript.sleep 1000
'MJ attente 1 seconde puis envoie touches
n=InputBox("Nombre de fois Type")
For i = 1 To n
wscript.sleep 500
variable.SendKeys ("{F2}")
wscript.sleep 500
variable.SendKeys ("Type")
wscript.sleep 500
variable.SendKeys ("{DOWN}")
wscript.sleep 500
next
For i = 1 To n
wscript.sleep 500
variable.SendKeys ("{UP}")
wscript.sleep 500
next
wscript.sleep 500
variable.SendKeys ("{RIGHT}")
wscript.sleep 500
For i = 1 To n
wscript.sleep 200
'variable.SendKeys ("{F2}")
wscript.sleep 200
variable.SendKeys ("%{TAB}")
wscript.sleep 200
variable.SendKeys ("^{INSERT}")
wscript.sleep 200
variable.SendKeys ("{DOWN}")
wscript.sleep 200
variable.SendKeys ("%{TAB}")
wscript.sleep 200
'variable.SendKeys ("+{INSERT}")
variable.SendKeys ("^v")
wscript.sleep 200
variable.SendKeys ("{DOWN}")
wscript.sleep 500
next
'MJ attente 1 seconde puis envoie touche tab
Set WshShell = Nothing