COMP 2071 INTRO - PowerPoint PPT Presentation

1 / 8
About This Presentation
Title:

COMP 2071 INTRO

Description:

Scripts will allow you, as a system administrator, to automate or semi-automate ... DOS was modeled on UNIX (and on CP/M) and has 'batch' file capabilities this ... – PowerPoint PPT presentation

Number of Views:42
Avg rating:3.0/5.0
Slides: 9
Provided by: JimS70
Category:
Tags: comp | intro | dos

less

Transcript and Presenter's Notes

Title: COMP 2071 INTRO


1
COMP 2071 INTRO
  • This course is primarily about Scripting, and
    will encompass both Windows and Linux. Scripts
    will allow you, as a system administrator, to
    automate or semi-automate many administrative
    tasks.
  • There is no textbook for the first part of the
    course - buy a 3-ring binder, and print out any
    documents referenced from the web and add them to
    your binder.
  • Your resources for this course will be weekly
    PowerPoint slide presentations, Word documents
    written to support this course, web resources and
    URLs provided to you and finally, anything you
    can find on the web, and in books and other
    places.
  • Each week, these slides and documents will be
    placed on the I-drive in the folder
    Comp2071\Class Notes

2
Background - 1
  • Operating systems (OSs) consist of a kernel or
    core set of operating routines which access the
    hard drives and peripherals, and manage the file
    system.
  • To use this kernel, each OS is accessed by a
    shell which allows a user to use the kernel
    routines. Each shell has some form of
    scripting capabilities that is, you can put a
    set of shell commands together in one file, and
    run or execute the entire set of shell commands
    rather than having to run each one individually
    and manually.
  • Much of this began with UNIX. UNIX has more than
    one shell. Each shell is more suited to some
    tasks than to others. Usually, you can launch
    one shell from another.

3
Background - 2
  • Common UNIX shells include the C shell, Bourne
    Shell and the Korn shell. There are others, and
    all are similar, having a core set of commands in
    common. Linux has similar shells.
  • DOS was modeled on UNIX (and on CP/M) and has
    batch file capabilities this is DOSs script
    language. Most of these batch files will still
    operate under Windows 2000 and XP, when run under
    the Windows command line prompt.
  • As to script languages, UNIXs Cscript was
    followed by Perl and Tcl, which are now much
    better-known and more widely used.
  • Some DOS Batch File Examples

4
Windows Script Host - 1
  • WSH uses the same scripting engines used by IE
    to execute client-side scripts, and by IIS to
    execute ASP (Active Server Page) server-side
    scripts. WSH provides a local environment in
    which to execute these WSH scripts.
  • WSH Scripting Technology provides access to
  • Scripting environment and Object model
  • VBScript and JScript engines
  • COM (Component Object Model)
  • Windows Script Components (previously known as
    Server Scriptlets), generally to provide COM
    objects in script code
  • WSH provides 2 scripting utilities
  • CScript the command-line utility, via the
    command prompt window
  • WScript the Windows interface version of the
    utility

5
Windows Script Host - 2
Windows Script Host Object Model
-gt WSH Object Model
6
Windows Script Host - 3
  • Wscript is the most important object.
  • Its properties
  • Application returns IDispatch interface for WSH
    script host
  • Arguments returns a collection containing
    parameters for the script
  • FullName returns full path to host executable,
    cscript.exe or wscript.exe
  • Name friendly name of WSH
  • Path directory containing WSH
  • ScriptFullName full path to currently-running
    script
  • ScriptName what it says! (name of
    currently-running script)
  • Version version of WSH
  • Its methods (more about these next week)
  • CreateObject, DisconnectObject, GetObject, Echo,
    Quit

7
Windows Script Host - 4
  • The next set of objects after Wscript include
  • WshShell
  • WshNetwork
  • WshCollection
  • You have already seen some uses of WshShell one
    of the most important uses of it is to use its
    objects WshSpecialFolders and WshEnvironment (see
    code examples)
  • Many things about the Network you are on can be
    known through use of the WshNetwork object (see
    code example)
  • Finally, we will do more with the WshCollection
    object and with the Dictionary object next week

8
Windows Script Host - 5
  • Scripting Runtime Library
  • One of the most important objects you will use in
    scripting is the FileSystemObject.
  • Technically-speaking, it is not part of the WSH
    script model.
  • Rather, like a number of other objects, it is
    part of an encapsulated scripting runtime library
    or SRL which makes its objects available to
    JScript and VBScript.
  • As a result, we can use these objects just the
    same way as the WSH objects - their syntax is
    either the same or similar
  • You will see some of these objects in week2.
Write a Comment
User Comments (0)
About PowerShow.com