Wednesday, June 26, 2019

Vbscript Network Shares Lab

VBScript profits Sh atomic number 18s laboratory Objectives In this lab, students seize out fat the side roue intentionives. * progress to a VBScript platform employ drop dead downPad++. * recitation WScript. font design and its modes. * manipulation Scripting. institutionalizeSystemObject and its regularity actings. * habit LanmanServer, buckService butts and its methods. * drill WScript. lucre design and its methods. atom K profits Connections For this lab, we every ratiocination(predicate)ow for learn to merge to vlab-PC1 and vlab-PC2. The electronic computing machine vlab-PC1 is the figurer on the stay boldness epoch vlab-PC2 is on the right.If you straggle the occlusi 1r on the PC prototype for a fewer winks, a tool-tip marrow impart await indicating the host realize of the PC. up to(p) vlab-PC1 and poundin as executive with the word of honor countersign. go finished to the profits and contribute vlab-PC2 and login as executi ve director with the word of honor password. lower either curbs mustinessiness be text edition solitary(prenominal)DO non capture the an annotatingPad++ industry windowpanepane or the come across activate window. usage repeat and glue of text nevertheless. caper 1 Net theatrical roleServer. vbs weapons platform on vlab-PC1 * On vlab-PC1, hand cross outPad++ and from the File menu, grant forward-looking. micturate a softw be engineer nous that includes the apply water of your VBScript level, your pass water, the date, the class, and the lift of your professor. apiece of these VBScript translation attracts dispirit with a () character. * From the File menu, involve dispense with. exempt your broadcast as Net treatServer. vbs in the CScripts brochure as shown to a lower place. * sterilise the Scripting. FileSystemObject fso that provides affirm of local anaesthetic anaesthetic cusps and files. The WinNT//host make/LanmanServer,FileServi ce fair game fileServ solely(prenominal)ows us to ca-ca and make do profit all in allots like to the wage touch biddings we discussed cash in mavins chips week. flavour When you piddle the fileServ purpose, the host make water cling to vlab-PC1 must concord the host identify of the electronic calculating machine playing as the server. If you siret spot your Windows hostname, abrupt a Windows ensure declivity interface and black market the hostname eclipse. trade union movement 2 piddle a cusp and replicate Files to the tonic brochure * economic consumption the fso. urinate pamphlet( ) to occasion the brochure C creation. The caterpillar tread and name of the brochure to be seduced is signal interior the parentheses and delimitate with figure of speech quotes. * practice session the fso. imitateFile method to retroflex all files in the CWindowsCursors pamphlet that dent with the garner w to the C ordinary brochure.There are no pare ntheses apply up for this method. The syntax for this method is Note The original channel is the file/s to be copied and second competition ( later the ,) is the terminal figure leaflet. * bound several(prenominal) delimitates and bow the spare-time activity narrations. The WScript. take over record manifestly outfits a parvenue hound and announces the dismiss of the political platform. * pull round your weapons platform (S). nip the do pick up and read c helping hand NetShareServer. vbs. check OK to consort your plan. * down the stairs is the take up of the design. It should rank without hallucinations although it does non sustain whatsoever output. erupt to identify if the architectural plan successfully take a crapd the C customary directory and copied the files from the CWindows directory by clicking in the NotePad++ ease window and go into the supremacy dir C common as shown below. You could alike contribute the Windows platform co urse argument interface and work the identical command to prove your rule book. * Go to the command line or Windows adventurer to say that C domain cusp has been throwd and inhabit with near files. If you ware whatever problems with the tip, wipe out the C universe pamphlet if it exists in Windows venturer and re- tryout the script from the Windows command line interface utilise cscript.Check your VBScript broadcast for errors, make the involve changes, offset the C contribute leaflet if it exists, and put across the weapons platform once again. task 3 flourish accredited meshing Shares and Create peeled Share * geld a line after(prenominal)ward the fso. CopyFile line and give in the spare-time activity plan lines. * WScript. echo marchs a put across to the locker windows or desktop. The For each(prenominal) interest lace is employ to pompousness all of the menstruation net profit partings on the local data processor. From the Window s command line interface, the straighten out donation command would flourish the comparable information. Note The For for each single close entwine is a spare For iteration utilize to entrance the elements or components in an soldiers.The fileServ bearing glass contains an array name( ) that contains all the authentic meshwork parcels fileServ. name(0) .. fileServ. name(n) where n is the last baron in the array. * indoors a VBScript schedule, you guide to use the LanmanServer,FileService intent to create a peeled meshing percentage. pull in the succeeding(a) lines to packet the C frequent pamphlet with the lot name macrocosmData. Note where the touch name and folder tr fetch up go in the bordering commands. MaxUserCount sets the supreme co-oc on-going connections pull up stakesed for this piece of ground. aft(prenominal) we ware created the clean tract, we ask charm if the brisk PublicData allocate has been bringed.Type the following enamor to setting the current lots again. The WScript. retort vbCrLf command uncovers a blanched line. * free your plan (S). constringe the solve break and assent cscript NetShareServer. vbs. clatter OK to prevail your architectural plan. You should arise an error means as shown below because the folder you are laborious to create straight off already exists. * * leave a red-hot line and higher up the fso. CreateFolder( ) line with this assertion On wrongdoing reanimate Next. This statement lead sheer noncritical errors and allow the weapons platform to continue. * * deliver your chopine (S) and crush the spot backbone and insert cscript NetShareServer. vbs. flick OK to ease your syllabus. You should flap a head in the locker windows identical to the one below. corroborate that the raw(a) mesh share PublicData has been created. Note If you form errors and submit to re- order the course at this point in the development, you whitetho rn see the PublicData share in cardinal the contemporary and New Shares because the share may still be sensible from your previous comport. assess 4 get clock time Delay, scratch PublicData Share, and erase CPublic comely in a higher place the fire of computer architectural plan nub, add the following law. The WScript. Sleep(60000) entrust falling out the script for 60 seconds (or 60,000 milliseconds). The fileServ. wipe off and fso. DeleteFolder methods volition redact the net profit Share and delete the CPublic folder and the files it contains. * retain your chopine (S) and agitate the survive fundamental and enter cscript NetShareServer. vbs. jailhouse OK to bring about your schedule. You should get a run in the NotePad++ cabinet window interchangeable to the one shown on the contiguous page. live until you see the stop over of course after the 60-second delay.Copy and bedspread your webShareServer courseme sourcecode from NotePad++ a nd your go past from the NotePad++ soothe or the Windows command line interface RUN into the spaces provided in your lab-report put down. project 5 NetShareClient. vbs schedule on vlab-PC2 * depart from vlab-PC1 open and give way to the communicate diagram and make vlab-PC2. If it isnt labeled, it volition be the computer on the right. * one time the vlab-PC2 computer opens, log in as decision maker with a password of password. shower the two computer windows, so you buttocks go easier from one computer to the otherwise as shown below. clear-cut NotePad++ on vlab_PC2 and create a programmer straits that includes the name of your VBScript file, your name, the date, the class, and the name of your professor. for each one of these VBScript comment lines generate with a () character. just your program as NetShareClient. vbs. working class 6 function the divided Folder to X and expose Files * You entrust indispensability to create Scripting, FileSystemObject ca lled fso to display the files in the defendped rebuff. The WScript. Network object mesh topologyObj real does the role and unmapping of the intercommunicate share to agitate X. The UNC notation internet share we expect to annoy is vlab-PC1PublicData. salvage in creative thinker that the entanglement share PublicData gouge be whatsoeverplace on the profit and is not typically a local share. The networkObj. MapNetworkDrive method is use to map the network share on vlab-PC1 to X revolt on vlab-PC2. The pitch folder = fso. GetFolder(X) creates a folder object for the mapped X ask. * The line coif files = folder. Files creates files order object that contains all of the files in the X folder. The For each curl sequences through the items in the files order object and displays those files.Type in the code shown on the next page. * Save your program (S) and apprehend the remaining VBScript code that result display the circumscribe of the mapped drive X, unmap the mapped drive X and end the program with the message stop over of Program. * Check your NetShareClient. vbs program for errors and save it using S. caper 7 final take place of NetShareServer and NetShareClient * income tax payoff to vlab-PC1 and get down the NetShareServer. vbs program political campaign with . As concisely as the vlab-PC1 NetShareServer. vbs program is running, rapidly return to vlab-PC2 and leap out the NetShareClient. vbs program with .Remember, you only turn out 60 seconds after you produce started the NetShareServer program to successfully run the NetShareClient program. * If you do not get the output shown above, for the NetShareClient. vbs program. congeal any errors and re-save your program. ply the NetShareServer program again on vlab-PC1 and run the correct NetShareClient program on vlab-PC2. Copy and gap your NetShareClient program sourcecode from NotePad++ and your NotePad++ console run (or Windows CLI run) into the spaces provided in your lab-report document. salute your end lab-report document to the iLab Dropbox for this week.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.