×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Perl Windows Admins

Do you know how to store your code(for later uses)? by Phalanx1
Posted: 24 Feb 04

Do you know how to store your code(for later uses)? with the ability to integrate C++, PERLScript, PERL, vbscript, jscript, and more: the windows script component is definitly the way to go if you want to be able to manage your code in each scripts names space without seeing all the other "Programming" & languages(such as C++ and PERL and assembly) i consider to be languages because they have unparrelled any-level usage of and strongly integrated flexible dynamic addins. vbscript javascript are pretty similiar, now ECMAscript is just some wierdo standing on the side lines of what i consider to be useful scripting yet damagingly similiar to the internets first cross-browser language JavaScript.

But anyways let's show you how to write your own com component that is capable by:
OLE_CREATE() i am in way  
CreateObject()
new ActiveXObject('');
Win32::OLE->new('');
i am assuming you know what each of these does, if not this is how to instantiate a COM+ Component which are scriptable objects that can be used in any script capable of Using OLE_Create such as vbscript CreateObject() method which should be done like so
Dim Obj : Set Obj = CreateObject("TheNameOfYour.ComFileHere")
#normal sytnax (something.something)
for instance the Scripting.FileSystemObject which provides "Scriptable access to the Win32 FileSystem, such as read write, create delete, list, check and more that i now forget ever since i met perl 5.8.3, (3)months ago and love it for the raw texture of the design and its cut throut attitude toward itself.
use Win32::OLE;
my $something = Win32::OLE->new('WScript.Shell') | die "now that is control of code at its finest" $!
unless $something;
now in XML yes i said XML is i guess said to be cross windows platform compatible so assuming they have the languages of the COM+ File you created installed and ready to be compiled and registered with regSvr32.exe nameoftheComponent.wsc
so this is the begining xml for its com file counterpart the Windows script component.
Com Objects
<object id="objectID"  classid="classid:GUID" | progid="progID"/> exactly as in html

type libraries into your component by using the reference id. By importing a type library into your component, you will be able to naturally access the constants that belongs to it, too.  
<reference progID="progID"|guid="typelibGUID" version="version#"/>
<resoure id="ID">Text or number to represent the value of the reource/>
getResource(ResID); #to retrieve the value
<comment>tag is used of course to explain the rough idea of the work you are doing, of course</comment>  
<registration progid="Telnet.PerlScriptNetAdmin" classid="{E2BFEBC6-9586-415F-8DBA-31378EFB9D23}" description="Telnet NET Admin" version="1.5" remotable="true">
</registration>is the process of describing to the registry the features of you Windows Script Component
so that there interfaces(properties and methods) which you will see shortly

This is my current baby and has been through more testing then my little 22 year old brain can possible handle by myself, so i ask anyone willing to develop and enjoys the pure fun of developing with a group of people i offer the environment of a windows 2003 standard Edition Server with 4 xeon CPUs with Hyperthreading tech now i only have 5 client licenses as of now but plan to obtain more in the future. anyone with more expierence administering a window 2003+ active directory is greatly needed, because i only have remedial hacker-like expierence in the administration of my 2 year associates degree college. I call it hacker like expierence because it was a complete mess when i got there, they were using fat32 with active directory becuse they thought that administering the permissions of ntfs would be to taxing on the current systems programmer, so i was put off, but only for the moment. This event maid me ask myself for the first time ever the question that got my into programming 1 1/2 years ago, why is progrmming so hard.
needless to say i wrote a script to Convert C: to ntfs, then made a student user, then added a group to classify each of the student curricullims, of course IT got the better part of the stick read write and execute permissions. I got his job... pretty quik when i came out with that peice of work.  
    
but again on with it this is the basic over all syntax: for all components:

<?xml version="1.0" ?>
<package>
    <comment>
    Phalanx generated COM File
    </comment>
    <component id="TelAdmin">
        <?component error="true" debug="true" ?>
        <public>
            <method name="TelnetSocket"/>
            <method name="GetPrt"/>
            <method name="GetPrtConns"/>
            <method name="NTEVTLGS"/>
            <method name="CRTORCHNGUSRORPSSWRD"/>
            <method name="ReactivACCT"/>
            <method name="EXEVBS"/>       
        </public>
        <script id="TPerl.wsc" language="PerlScript">
<![CDATA[
]]></script>
<registration progid="YourProgID" classid="{YourClassID}" description="" version="version#" remotable="true|false">
        </registration>
</component>
</package>
so that it. if you want a better understanding of the windows script component see this page for more examples and better definitions.
http://www.xav.com/perl/Windows/windows_script_components.html#com

Back to Perl FAQ Index
Back to Perl Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close