Bonsoir à tous, voilà je souhaiterais me lancer dans le HTA et j'ai donc essayé de créer un programme simpliste (un programme qui crée un raccourci en rentrant manuellement les paramètres)
Voici la bête:
Je n'arrive pas à le faire fonctionner, le problème vient que je n'arrive pas à entrer correctement les paramètres, je pense que c'est tout bête mais ça fait pas mal de temps que je bloque dessus ... pourriez vous me donner une piste ?
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 <html> <head> <HTA:APPLICATION ICON="http://www.iconarchive.com/download/i38830/google/chrome/Google-Chrome.ico" APPLICATIONNAME = "Shortcut creator" BORDER="dialog" BORDERSTYLE="complex" CONTEXTMENU="no" SYSMENU="yes" MAXIMIZEBUTTON="no" SCROLL="no" > <title>Shortcut creator</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style> body{ background-color: black; } label,.btn{ font-weight: bold; } </style> <script language="VBScript"> Sub window_onload() CenterWindow 380, 240 End Sub Sub CenterWindow(x,y) window.resizeTo x, y iLeft = window.screen.availWidth/2 - x/2 itop = window.screen.availHeight/2 - y/2 window.moveTo ileft, itop End Sub Sub Createshortcut(Urlico, Frqtache) Set oShell = CreateObject("WScript.Shell") strHomeFolder = oShell.ExpandEnvironmentStrings("%USERPROFILE%") Set lnk = oShell.CreateShortcut(strHomeFolder & "\monraccourci.lnk") lnk.WindowStyle = 7 lnk.IconLocation = Urlico lnk.TargetPath = "cmd.exe" lnk.arguments = "/C SCHTASKS /Create /F /SC Frqtache /TN Test3 /TR calc.exe" end sub </script> </head> <body> <label for="Urlico" style="width: 120; textalign: right;"><p style="color:#FFFFFF";>Url icone: </p></label><input type="text" id="Urlico" name="Urlico" value="Url de l'icone"><br /> <label for="Frqtache" style="width: 120; textalign: right;"><p style="color:#FFFFFF";>Frequence tache: </p></label><input type="text" id="Frqtache" name="Frqtache" value="MINUTE, HOURLY, DAILY, WEEKLY, MONTHLY, ONCE"><br /> <p><center><input class="btn" type="button" value="Creer" onClick="lnk.Save"></p></center> </body> </html>
Je vous remercie !![]()
Partager