Set objSh = CreateObject("wscript.Shell")
I have tried changing wscript to scripting with no luck. If I understand
correctly, wscript won't work in a script in html, but it should work within
an hta because the hta doesn't have such restrictive security. I have NT4
sp6a with IE 5.5 sp2 and wsh 5.6 on the workstation. The hta runs off of an
intranet webpage on a NT4 server, but I think all of the stuff it calls in
the script it uses from the workstation, not the server. I don't understand
why I'm getting this error, can anyone help? TIA
I noticed a couple more things about this problem. The MS script debugger
highlights and indicates the objSh line, but the error message seems to
refer to the objFS line after it. Also, I have another similar hta on the
server that also has the below lines of code in it and it runs fine, doesn't
get the same errors. I have compared the two hta's next to each other, line
by line and don't see any differences that would fix the problem. :(
Again, thanks for any help.
Set objSh = CreateObject("wscript.Shell")
Set objFS = CreateObject("wscript.FileSystemObject")
"Just remember that wscript/cscript.exe is still NOT the host. So the
intrinsic WScript object isn't
available, but the entire DHTML DOM is (pretty fair trade if you ask me..."
Could this be the problem? If so, then why does one script work fine with
this and another doesn't? Thanks again.
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=efX7S3eQ
BHA.1408%40tkmsftngp05&rnum=20&prev=/groups%3Fq%3D%252Bhta%2B%252Bhtml%2B%25
2Bsecurity%2B%252Bvbscript%26start%3D10%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%
3DUTF-8%26selm%3DefX7S3eQBHA.1408%2540tkmsftngp05%26rnum%3D20
Hermes <her...@messenger.com> wrote in message
news:efiCmKg#CHA....@TK2MSFTNGP12.phx.gbl...
A couple of notes here.
(1) Your problem is the FSO line. That should be
"Scripting.FilesystemObject"
(2) You cannot use the WScript object from anything but WSH, but that has
nothing to do with either "Wscript.Shell" or "WScript.Network", which are merely
COM objects with WScript in their ID. The WScript object is the intrinsic one
used as a prefix for certain intrinsic WSH methods. The following are things
you can't do in an HTA:
WScript.CreateObject("My.Object")
WScript.Sleep 10
WScript.Echo "Hello, World!"
All of your stuff is OK; just fix the reference to "Scripting.FileSystemObject".
--
Please respond in the newsgroup so everyone may benefit.
http://dev.remotenetworktechnology.com
(email requests for support contract information welcomed)
----------
Microsoft's new UNIFIED Terminal Services Newsgroup:
news:microsoft.public.windows.terminal_services
Set objSh = CreateObject("wscript.Shell")
Set objFS = CreateObject("wscript.FileSystemObject")
To
Set objSh = Wscript.CreateObject("scripting.Shell")
Set objFS = CreateObject("scripting.FileSystemObject")
It was one of the first things I tried. Does anyone know why? Thanks for
the reply.
Alex K. Angelopoulos (MVP) <a...@mvps.org> wrote in message
news:e6Y8S5i#CHA....@TK2MSFTNGP12.phx.gbl...
> I get a error on the same line if I make that change in this script. The
> error: "Object required: Wscript". This is the error I get if I change the
> line(s) in error from
>
> Set objSh = CreateObject("wscript.Shell")
> Set objFS = CreateObject("wscript.FileSystemObject")
>
> To
>
> Set objSh = Wscript.CreateObject("scripting.Shell")
> Set objFS = CreateObject("scripting.FileSystemObject")
>
> It was one of the first things I tried. Does anyone know why?
Hi
You can't use 'Wscript.CreateObject(...' from a HTA script,
you need to use 'CreateObject(...'
and there is no object called "scripting.Shell" either, you will need to use
"Wscript.Shell".
This should work from your HTA script:
Set objSh = CreateObject("Wscript.Shell")
Set objFS = CreateObject("Scripting.FileSystemObject")
--
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/scriptcenter
Torgeir Bakken (MVP) <Torgeir.B...@hydro.com> wrote in message
news:3E8D9C30...@hydro.com...