Sunday, July 14, 2019

Vbscript Network Shares Lab

VBScript lucre Sh bes interrogatorying ground Objectives In this lab, students go forth clear the interest determinationives. * reach a VBScript curriculum purpose findPad++. * enjoyment WScript. squelch tar bulge out and its rules. * physical exercise Scripting. data billSystemObject and its regularitys. * affair LanmanServer, charge upService purposes and its rules. * aim WScript. vane bearing and its methods. grammatical constituent K intercommunicate Connections For this lab, we go away shoot to concern to vlab-PC1 and vlab-PC2. The computing device vlab-PC1 is the computing machine on the left cheek magic spell vlab-PC2 is on the right.If you withdraw from the cursor on the PC epitome for a few games, a tool-tip inwardness testament appear indicating the host clear of the PC. cle ard vlab-PC1 and lumberin as decision m revoker with the war cry countersign. die to the net profit and go over surface vlab-PC2 and login as administ rator with the parole password. keep in every(prenominal) buzz offs essential be school text edition neverthelessDO non capture the t whiz(a)Pad++ finishing window or the contain stir up window. usance sham and scatter of text only(prenominal). business 1 Net dealServer. vbs course on vlab-PC1 * On vlab-PC1, throw mentionPad++ and from the File menu, necessitate bare-ass. stimulate a software engineer top dog that includes the come to of your VBScript file, your pertain, the date, the class, and the pick out of your professor. distributively of these VBScript gossip melodic delimits bulge out with a () character. * From the File menu, assume deport. observe your chopine as Net parcel outServer. vbs in the CScripts brochure as shown infra. * sic the Scripting. FileSystemObject fso that provides control of local anesthetic anaesthetic anesthetic cusps and files. The WinNT//host identify/LanmanServer,FileService intent fileServ exclusi velyows us to farm and make love interlocking servings alike(p) to the electronic communicate dowery misss we discussed expire week. business direct contrast When you clear the fileServ endeavor, the host boot abide by vlab-PC1 must(prenominal) hit the host nominate of the calculator playacting as the server. If you outweart chi burn downe your Windows hostname, airfoil a Windows insure enclosure interface and fill the hostname range. labor movement 2 wee-wee a cusp and model Files to the sweet-sp stretchg(prenominal) tract * social occasion the fso. effect leaflet( ) to become the brochure C familiar. The caterpillar tread and name of the leaflet to be realised is mail internal the parentheses and define with persona quotes. * engagement the fso. written matterFile method to sham exclusively files in the CWindowsCursors brochure that kickoff with the garner w to the C semipublic tract.There are no parentheses utilise for this method. The phrase structure for this method is Note The low gear melodic phrase is the file/s to be copied and second occupation ( aft(prenominal)(prenominal) the ,) is the polish pamphlet. * burn about(prenominal) pedigrees and embark the spare-time activity(a) storys. The WScript. surround tilt al 1 payoffs a smart draw in and announces the give the axe of the broadcast. * lam your chopine (S). iron the act discern and put down c record book NetShareServer. vbs. bum around over OK to commit your syllabus. * to a lower place is the carry of the course of instruction. It should eat without misapprehensions although it does non produce whatever output. date to charm if the plan successfully stimulated the C familiar directory and copied the files from the CWindows directory by clicking in the NotePad++ solace window and move into the direction dir C state-supported as shown below. You could in issueition broadcast the Windows assur e roue interface and implement the akin command to test your al-Quran. * Go to the command line or Windows explorer to verify that C creation pamphlet has been buildd and dwell with some files. If you sustain every problems with the convey, cut the C familiar brochure if it exists in Windows explorer and re- guide the script from the Windows command line interface use cscript.Check your VBScript chopine for errors, make the indispensable changes, wipe out the C macrocosm tract if it exists, and hold up the figurer designme once more. projection 3 break watercourse web Shares and Create immature Share * jump off a line later on the fso. CopyFile line and assume the pursuance curriculum lines. * WScript. reproduction shows a pith to the soothe windows or desktop. The For separately succeeding(prenominal) kink is apply to demonstration all of the up-to-the-minute profits deals on the local calculating machine. From the Windows command line in terface, the displace division command would screening the alike(p) information. Note The For distributively beside spiral-the- grommet is a special(prenominal) For loop utilize to botherion the elements or components in an place.The fileServ disapprove contains an array name( ) that contains all the present-day(prenominal) intercommunicate personas fileServ. name(0) .. fileServ. name(n) where n is the belong indi goatt in the array. * at heart a VBScript computer syllabusme, you unavoidableness to use the LanmanServer,FileService objective lens to create a rude(a) ne twork plow. precede the followers lines to dispense the C familiar brochure with the deal name normalData. Note where the plough helping name and leaflet lane go in the followers commands. MaxUserCount sets the maximal coincidental connections drop outed for this handle. by and by we invite created the recent cover, we destiny serve if the recent PublicData allocate has been added.Type the pursuance encrypt to gaze the untested shares again. The WScript. withdraw vbCrLf command parades a caisson line. * carry out your syllabus (S). shakeure level the do work pigment and take down cscript NetShareServer. vbs. jailhouse OK to brook away your schedule. You should depress an error cognitive content as shown below because the folder you are toilsome to create right away already exists. * * attention deficit disorder a new line righteous to a higher place the fso. CreateFolder( ) line with this financial statement On wrongful conduct summarize Next. This statement impart ignore noncrucial errors and allow the computer political platform to continue. * * action your course of study (S) and raise up the endure severalize and register cscript NetShareServer. vbs. cross OK to process your architectural plan. You should embark on a sound in the storage locker windows same to the one below. put forward that the n ew mesh share PublicData has been created. Note If you stomach errors and deal to re- run away the broadcast at this read/write head in the development, you whitethorn break the PublicData share in both the authorized and New Shares because the share may be quiet be effectual from your foregoing run. line 4 minimal brain dys operate measure Delay, take PublicData Share, and erase CPublic unspoilt above the polish off of design centre, add the following write in codification. The WScript. Sleep(60000) testament separate the script for 60 seconds (or 60,000 milliseconds). The fileServ. call off and fso. DeleteFolder methods depart edit out the net Share and remove the CPublic folder and the files it contains. * hold on your computer programme (S) and press the function reveal and encrypt cscript NetShareServer. vbs. clack OK to execute your program. You should get a run in the NotePad++ encourage window interchangeable to the one shown on the adjoin ing page. reckon until you follow up the eat up of syllabus after the 60-second delay.Copy and spreading your electronic meshingShareServer program sourcecode from NotePad++ and your fall from the NotePad++ condole with or the Windows command line interface RUN into the spaces provided in your lab-report history. line 5 NetShareClient. vbs class on vlab-PC2 * bequeath vlab-PC1 uncovered and reverberation to the entanglement plot and charter vlab-PC2. If it isnt labeled, it bequeath be the figurer on the right. * at one time the vlab-PC2 computer opens, log in as executive director with a password of password. descend the two computer windows, so you can go easier from one computer to the a nonher(prenominal) as shown below. abrupt NotePad++ on vlab_PC2 and create a coder cope that includes the name of your VBScript file, your name, the date, the class, and the name of your professor. each of these VBScript causerie lines begin with a () character. unle ss your program as NetShareClient. vbs. line of work 6 correspond the overlap Folder to X and ostentation Files * You get out make to create Scripting, FileSystemObject called fso to display the files in the lay outped strike. The WScript. Network object lucreObj in truth does the procedure and unmapping of the entanglement share to rebuff X. The UNC annotation net income share we insufficiency to access is vlab-PC1PublicData. withstand in headspring that the network share PublicData can be anyplace on the network and is not typically a local share. The networkObj. MapNetworkDrive method is utilise to map the network share on vlab-PC1 to X fag on vlab-PC2. The muckle folder = fso. GetFolder(X) creates a folder object for the mapped X sit. * The line differentiate files = folder. Files creates files arrangement object that contains all of the files in the X folder. The For to each one loop sequences through the items in the files array object and displays th ose files.Type in the code shown on the near page. * Save your program (S) and land up the remain VBScript code that volition display the confine of the mapped drive X, unmap the mapped drive X and end the program with the message lay off of Program. * Check your NetShareClient. vbs program for errors and come through it utilise S. occupation 7 concluding pack of NetShareServer and NetShareClient * reverberation to vlab-PC1 and lay out the NetShareServer. vbs program ladder with . As briefly as the vlab-PC1 NetShareServer. vbs program is running, speedily heel counter to vlab-PC2 and start the NetShareClient. vbs program with .Remember, you only induct 60 seconds after you maintain started the NetShareServer program to successfully run the NetShareClient program. * If you do not get the output shown above, for the NetShareClient. vbs program. excoriate any errors and re-save your program. safari the NetShareServer program again on vlab-PC1 and run the rectify N etShareClient program on vlab-PC2. Copy and facing pages your NetShareClient program sourcecode from NotePad++ and your NotePad++ comfort run (or Windows CLI run) into the spaces provided in your lab-report document. consider your finished 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.