Login | |
|
 |
RE: HTA Question - 2/28/2006 9:09:30 PM
|
|
 |
|
| |
rOOs
Posts: 63
Score: 0
Joined: 2/28/2006
From: Switzerland
Status: offline
|
The HTML: <input type='checkbox' name='test'> Select this one... <input type='button' name='OKButton' value=' Test this out . . . ' onclick="DoIt"> the Code: Sub DoIt If document.All.Item("test").Checked Then 'do it End If End Sub Each input its own name, and each if checked refernces to that name... something like this?
|
|
| |
|
|
|
 |
RE: HTA Question - 3/1/2006 8:13:34 PM
|
|
 |
|
| |
rOOs
Posts: 63
Score: 0
Joined: 2/28/2006
From: Switzerland
Status: offline
|
quote:
ORIGINAL: ginolard You don't need the Wscript.Createobject, just CreateObject will do. This is because of the context it is run under... the hta doesn't run in the wscript context. so wscript.sleep won't work either... btw: Wscript.sleep can be emulated with a timer...
|
|
| |
|
|
|
 |
RE: HTA Question - 3/1/2006 8:15:30 PM
|
|
 |
|
| |
rOOs
Posts: 63
Score: 0
Joined: 2/28/2006
From: Switzerland
Status: offline
|
quote:
<IMAGE SRC = "C:\Pictures\World.jpg" align = "center"> Try to make relative paths for the images such as ".\pic\World.jpg" better for distribution... :-)
|
|
| |
|
|
|
 |
RE: HTA Question - 3/2/2006 6:53:29 PM
|
|
 |
|
| |
rOOs
Posts: 63
Score: 0
Joined: 2/28/2006
From: Switzerland
Status: offline
|
Every portion of Script you have to run seperately you put in a seperate sub with a seperate unique name that shows what the sub makes.. repeatly used tasks you also put into a sub, so you can call it when you need it. is this what you asked for? sorry for my bad english (i am swiss)
|
|
| |
|
|
|
 |
RE: HTA Question - 3/6/2006 12:51:25 AM
|
|
 |
|
| |
Country73
Posts: 712
Score: 8
Joined: 8/25/2004
From: USA
Status: offline
|
When a particular option is selected it should run a certain Sub (or function) for that option. Inside the option you could just put in: oShell.Run <batch / script path>,0,True oShell is just what I normally have setup in my scripts: Set oShell = CreateObject("Wscript.Shell") 0, True in that line: 0 = run minimized (you will not see the DOS window); True = Wait until finished before moving on.
|
|
| |
|
|
|
 |
RE: HTA Question - 3/8/2006 1:08:47 AM
|
|
 |
|
| |
rOOs
Posts: 63
Score: 0
Joined: 2/28/2006
From: Switzerland
Status: offline
|
the trick is to create a sub to check whats checked (extremely well written sentence :-) ) and to run the relative sub then... or not... <html> <head> <hta:application id = "mcomms" /> <title>Test Checkbox</title> <meta http-equiv = "content-script-type" content = "text/vbscript"/> <script language = "VBScript" type = "text/vbscript" > Sub DoSelected If test.checked = True Then doit1 End If If test2.checked = True Then doit2 End If End Sub Sub doit1 Set oShell = CreateObject("Wscript.Shell") oShell.Run "J:\comms\MoveCommsOut-Nz.bat",0,True End Sub Sub doit2 Set oShell = CreateObject("WScript.Shell") oShell.Run "J:\Comms\MoveCommsInOz-Monday.bat",0,True End Sub </script> </head> <IMAGE SRC = ".\network.jpg" align = "center"> <h1 align="center"> Run Comms Processes</h1> <body> <input type='checkbox' name='test'> Select this one... <input type='checkbox' name='test2'> Select this one as well... <input type='button' name='OKButton' value=' Test this out . . . ' onclick="DoSelected"> <o:p> </o:p></p> <input type = "BUTTON" value = " Exit " onclick ="self.close()"> </button></body> </html>
|
|
| |
|
|
|
 |
RE: HTA Question - 3/8/2006 6:26:30 PM
|
|
 |
|
| |
rOOs
Posts: 63
Score: 0
Joined: 2/28/2006
From: Switzerland
Status: offline
|
Dont' forget to change the name of the chockboxes and subroutines so that it makes sense... 'test' ist never a good name...
|
|
| |
|
|
|
 |
RE: HTA Question - 3/9/2006 9:41:40 AM
|
|
 |
|
| |
rOOs
Posts: 63
Score: 0
Joined: 2/28/2006
From: Switzerland
Status: offline
|
That you could solve with a for ... next statement, that checks wheter a file exist or not... the above posted is still manual... is only a bit faster, and better code...
|
|
| |
|
|
|
|
|