Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Do you know how to store your code(for later uses)?

Perl Windows Admins

Do you know how to store your code(for later uses)?

by  Phalanx1  Posted    (Edited  )
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
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top