<html>
<HTA:APPLICATION ID="moveOrders">
<head>
<script language="vbscript">
Sub transfer_click()
set wsh = WScript.CreateObject("WScript.Shell")
End Sub
</script>
</head>
<body>
<form>
<input type="button" value="Transfer" onclick="transfer_click">
</form>
</body>
</html>
> The code below causes an "Object required: 'WScript'" error when I run it.
> I read somewhere that WScript is not available unless the script is run
> using WScript.exe or CScript.exe. However, I have seen several sample
> applications that use it in an HTA. What is the real scoop on this? Can I
> do this? I have W2k SP4, IE 6 and WSH 5.6.
>
> <html>
> <HTA:APPLICATION ID="moveOrders">
> <head>
> <script language="vbscript">
> Sub transfer_click()
> set wsh = WScript.CreateObject("WScript.Shell")
> End Sub
> (snip)
Hi
In this case, the solution is simple:
instead of
set wsh = WScript.CreateObject("WScript.Shell")
use
set wsh = CreateObject("WScript.Shell")
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/community/scriptcenter/default.mspx
"Torgeir Bakken (MVP)" <Torgeir.B...@hydro.com> wrote in message
news:exQtl0nT...@tk2msftngp13.phx.gbl...