Bonjour, quelle est la commande pour envoyer du texte a une application qui est en cours d'exécution (Bloc Notes, Msn, Word...)?
Merci:mrgreen:
Version imprimable
Bonjour, quelle est la commande pour envoyer du texte a une application qui est en cours d'exécution (Bloc Notes, Msn, Word...)?
Merci:mrgreen:
salut,
regarde du côté de VBS et AutoIt, voici un exemple pour word
Code:
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 @echo off > testword.vbs ( echo Set ow = createobject^("word.application"^) echo Set odoc = ow.Documents.Add^(^) echo set objs = ow.selection echo ow.Visible = 1 echo objs.font.name = "verdana" echo objs.font.size = "20" echo objs.font.color = 16711680 echo objs.font.italic = 1 echo objs.paragraphformat.alignment = "1" echo objs.typetext "Question de Pierre" echo objs.typeparagraph^(^) echo objs.typeparagraph^(^) echo objs.paragraphformat.alignment = "0" echo objs.font.size = "12" echo objs.font.color = 0 echo objs.typetext "Bonjour," echo objs.typeparagraph^(^) echo objs.typeparagraph^(^) echo objs.font.bold = 1 echo objs.typetext " Quelle est la commande pour envoyer du texte " echo objs.typetext " a une application qui est en cours " echo objs.typetext " d'exécution (Bloc Notes,Msn, Word...)?" echo objs.typeparagraph^(^) echo objs.typeparagraph^(^) echo objs.typetext vbTab echo objs.font.size = "20" echo objs.font.color = 87415 echo objs.font.underline = 1 echo objs.typetext " ...Pour WORD voici un exemple... " echo ow.activedocument.saveas "c:\pierre.doc" echo msgbox "création de c:\pierre.doc" ) cscript //nologo testword.vbs del testword.vbs
Merci beaucoup d'avoir répondu en passant un exemple :mrgreen: mais comment faut il faire pour le bloc notes?
:merci:
tu peux simplement utiliser la fonction VBS SendKeys tu as des exemples dans la FAQ VBS ou bien avec NIRCMD avec sa commande Sendkey ou bien passer directement à AutoIt là tu trouveras tout ce que tu veux..
pour NIRCMD t'as un exemple ici
Merci beaucoup je crois que c'est bon
J'essaye et je post le résultat si ça fonctionne
:mrgreen:
C'est bon je vais utiliser NirCmd
Merci beaucoup :mrgreen:Code:
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 >tst.nir echo wait 500 >>tst.nir echo execmd start cmd.exe >>tst.nir echo wait 500 >>tst.nir echo sendkey c press >>tst.nir echo wait 500 >>tst.nir echo sendkey l press >>tst.nir echo wait 500 >>tst.nir echo sendkey s press >>tst.nir echo wait 500 >>tst.nir echo sendkey enter press >>tst.nir echo wait 500 >>tst.nir echo sendkey d press >>tst.nir echo wait 500 >>tst.nir echo sendkey i press >>tst.nir echo wait 500 >>tst.nir echo sendkey r press >>tst.nir echo wait 500 >>tst.nir echo sendkey enter press >>tst.nir echo wait 500 >>tst.nir echo sendkey e press >>tst.nir echo wait 500 >>tst.nir echo sendkey x press >>tst.nir echo wait 500 >>tst.nir echo sendkey i press >>tst.nir echo wait 500 >>tst.nir echo sendkey t press >>tst.nir echo wait 500 >>tst.nir echo sendkey enter press
juste un dernier truc avec nircmd: comment on fait pour "envoyer" la touche supprimer et les caractères comme !? ?
J'ai essayé
mais sa ne fonctionne pasCode:>>tst.nir echo sendkey del press
Merci:D
t'as tout la doc de nircmd, voici ma petite version avec en supplément un petit quelque chose:
le petit quelque chose:Code:
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 @echo off echo>>script.nir wait 100 echo>>script.nir execmd start notepad.exe echo>>script.nir wait 300 echo>>script.nir sendkey enter press echo>>script.nir wait 80 echo>>script.nir sendkey T press echo>>script.nir wait 80 echo>>script.nir sendkey u press echo>>script.nir sendkey enter press echo>>script.nir wait 80 echo>>script.nir sendkey v press echo>>script.nir wait 80 echo>>script.nir sendkey e press echo>>script.nir wait 80 echo>>script.nir sendkey u press echo>>script.nir wait 80 echo>>script.nir sendkey x press echo>>script.nir sendkey enter press echo>>script.nir wait 80 echo>>script.nir sendkey u press echo>>script.nir wait 80 echo>>script.nir sendkey n press echo>>script.nir sendkey enter press echo>>script.nir wait 80 echo>>script.nir sendkey p press echo>>script.nir wait 80 echo>>script.nir sendkey e press echo>>script.nir wait 80 echo>>script.nir sendkey t press echo>>script.nir wait 80 echo>>script.nir sendkey i press echo>>script.nir wait 80 echo>>script.nir sendkey t press echo>>script.nir sendkey enter press echo>>script.nir wait 80 echo>>script.nir sendkey c press echo>>script.nir wait 80 echo>>script.nir sendkey a press echo>>script.nir wait 80 echo>>script.nir sendkey d press echo>>script.nir wait 80 echo>>script.nir sendkey e press echo>>script.nir wait 80 echo>>script.nir sendkey a press echo>>script.nir wait 80 echo>>script.nir sendkey u press echo>>script.nir wait 80 echo>>script.nir sendkey enter press nircmd qboxcom "voir un petit exemple ?" "DEMO" script "script.nir" ping -n 3 localhost>nul tasklist /nh|find /i "notepad.exe" >nul && ( taskkill /im notepad.exe /f>nul ( echo **** C A D E A U **** echo. echo Direction --^> "Google Image" puis sans plus tarder mettre echo le code ci-dessus dans la barre d'adresse de ton navigateur )>~.txt notepad.exe ~.txt ) del script.nir ~.txt 2>nul pause
Code:
1
2 javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; var DI= document.images; DIL=DI.length; function A(){for(i=0; i<DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=Math.sin(R*x1+i*x2+x3)*x4+x5+"px"; DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5+"px"}R++}tag=setInterval('A()',5 );document.onmousedown=function(){clearInterval(tag);for(i=0; i<DIL; i++){DI[i].style.position="static";}}; void(0)
Ok merci je regarde a ca :mrgreen:
pour la syntaxe:
plus de détail dans l'aide de la commande.Code:
1
2
3
4
5
6
7
8
9
10 Sendkey [clef] [action] ^ ^ |--------| |---[press|up|down] v [a-z0-9] [F1,F2,..etc] [shift,ctrl,alt,enter,esc] [code de type "0xN" par exmple pour la touche "DEL" 0x2e]
Est-ce que mon cadeau t'as plu ? "le quelque chose" :mrgreen:
source
merci
Oups désolé j'avais pas lu
Oui sa m'a plu merci lolCitation:
Est-ce que mon cadeau t'as plu ? "le quelque chose" :mrgreen: