Re: Learning




Great, but there is a problem. I want to create ".vbs" files which
works lika a ".exe" or ".bat" files.


VBS the way you want to use it will be run by
the Windows Script Host. MS has fairly good
help files for both:

http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-
8A76-1C4099D7BBB9

(That should have both a vbscript.chm and wsh.chm
help file inside. If one is missing you'll need to hunt
it down. MS has a way of reshuffling things for no
reason.)

There are 2 newsgroups:

microsoft.public.scripting.vbscript
microsoft.public.scripting.wsh

It's somewhat confusing because VBS on Windows
is a patchwork.

First you need to know that you may
have to adjust security. There's been hysteria about VBS
viruses and at this point most anti-virus products are
configured by default to block VBS from running
while ignoring EXE! If you have WinXP SP2 you'll
also need to make changes in order to use VBS in
IE windows. SP2 redefines the IE local zone as
roughly equivalent to the restricted zone.

Aside from the security issues:

VBScript was first created for IE, to create incompatibility
with javascript in browsers. ... part of the Netscape
war.
The early VBS was only a limited browser DOM scripting.
MS later added functionality
to fill the gap for system administrators who wanted
some kind of simple scripting system. They added
CreateObject, which allows VBS to use any COM
object with data types that it can handle. That move
accounts for most of the problems in IE: MS mixed
system scripting with browser scripting and left big
security holes open as a result.

Gradually MS added more options for script.
The Windows Script Host, wscript, has functions of
its own that you can call from script. The scripting
runtime, scrrun.dll, adds the FileSystemObject
(among other things) which gives script a full set
of file and folder operations. In 2000/ME/XP there's
WMI, which is a completely different SQL-ish thing
for sys. admins, but it can be used through VBS.

The reason I'm explaining all of that is to give you an
idea of what you're dealing with. VBScript itself is
like a simple version of VB with limited data types.
But in practice, what you're mostly concerned with
is the COM objects that you can use. (You can also
write COM objects in VB that VBScript can use. Just
design them to expose only variants and objects.)

So you can figure out VBS and some of the common
objects from the CHM file. Then you need to look elsewhere
for some of the other options. For instance, the wscript.shell
object is documented in the WSH help. The FileSystemObject
is documented in the vbs help file. Other things are not in
either. And if you want to make webpage utilities (IE is
the main GUI option for VBS) then you're dealing with the
IE DOM, which is a completely different "kettle of fish".

In short, MS didn't have system scripting like Unix has, so
they just pasted a few things together, called it a system,
and announced the arrival of scripting for sys. admins.
What's part of VBScript from most people's point of
view is somewhat arbitrary.

(And if you really want to get confused, there's Monad.
MS seems to be suffering a sort of Unix copycat mania,
apparently in an attempt to waylay Unix server admins on
their way to Linux. Monad is a new system in beta that
actually simulates a terminal/command line scripting
environment with command applets like Linux/Unix have.
Monad will have no GUI features, as far as I know. VBS
will still be around in the future but will be defined as "legacy"
while Monad, with it's old-fashioned command line terminal
designed to make Unix geeks feel at home,
will become the "cutting edge" of Windows scripting. :)

Books: The best all-around that I know of is
Windows Script Host programmers reference by
Dino Esposito. He doesn't give you a full, systematic
presentation, but he does a good job of showing
you the landscape.




.



Relevant Pages

  • Re: Vbscript script file
    ... Creates a new file with extension .VBS. ... I-Worm.LoveLetter is Internet worm written in the scripting language ... Windows Scripting Host is installed. ...
    (microsoft.public.windowsxp.general)
  • Re: Question about VB scripting
    ... application, copy it, open notepad, and paste it there. ... Note that VBA and VBS are both based on Visual Basic, ... It's scripting capabilitys could ... be very similar to plain VBScript, or it could be quite different. ...
    (microsoft.public.scripting.vbscript)
  • Re: Problems in Waiting for Web page to Open
    ... Michael Harris escreveu: ... not sure if you are saying that vbs just simply CANNOT do ... Microsoft MVP Scripting ...
    (microsoft.public.scripting.vbscript)
  • Re: Why is the Script 5.6 documentation so crummy?
    ... I don't think that the WSH and Windows scripting ... VBS for browser scripting. ...
    (microsoft.public.scripting.vbscript)
  • Re: "Action Canceled" when viewing help topics
    ... Do you have a suggestion if I have mapped a local intranet UNC path ... then I can access the help file if I go via full UNC ... To see what zone you now have have for the path, in Explorer, select ... torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.windowsupdate)

Loading