Saturday, May 9, 2020

VBScript IP File Lab Essay Sample free essay sample

AimIn this lab. understudies will complete the undermentioned points. * Create a VBScript plan using NotePad++ .* Write a planar cluster of IP delivers to a book record. * Read the IP Addresses content record into a book.* Append new Room/PC/IP reference informations to the content file.* Use the article Scripting. FileSystemObject. Component K Network Connections For this lab. we will simply require to connection to vlab-PC1. The processing machine vlab-PC1 is the figuring machine on the left side while vlab-PC2 is on the right. On the off chance that you leave the pointer on the Personal PC symbol for a couple of moments. an apparatus tip message will look bespeaking the hostname of the Personal PC. Open vlab-PC1 and sign in as Administrator with the watchword. Lab OverviewWe are going to get down our lab with the equivalent planar cluster of IP references. As opposed to getting to this variety of IP reference using the room and figuring machine file esteems. We will compose a custom paper test on VBScript IP File Lab Essay Sample or on the other hand any comparative theme explicitly for you Don't WasteYour Time Recruit WRITER Just 13.90/page we are making a trip to make the exhibit out of IP delivers to a Text document named IP_Addresses. csv where each line of the document will join the Comma Separated Values ( CSV ) for room # . processing machine # . IP_Address. We will so create a different VBScript plan that will add on four new lines of informations that will represent the four processing machines in the new room 106 to the IP_Addresses. csv record. Last. we will open and read the newly added IP_Addresses. csv and uncover it substance in a significant way. Note: All picking up controls must be content onlyâ€DO NOT catch the NotePad++ application window or the offer brief window. Use transcript and glue of content only. Undertaking 1: Download and Open IP_ArrayFile_start. vbs in NotePad++ * Open NotePad++ and from the bill of admission. decision File/Open. Open the fileIP_File_start. vbs in the C: Scripts registry. In the event that you do non see this record. you can download it and pull out it from the eCollege Doc Sharing document IP_File_start. nothing. * Modify the Programmer Header varying and Save As the VBScript record as IP_FileWrite. vbs. * The line diminish ipAddress ( 5. 3 ) proclaim 6?4 planar exhibit. The 5 and 3 give the maximal record esteem. Since files ever start at 0. this is a 6?4 cluster. * The lines that follow initialise the cluster areas with IP references. The principal file ( 0. . 5 ) speaks to the suites 100 through 105. The second record ( 0. . 3 ) speak to the four processing machines in each room. * The IP reference of the third registering machine in room 104 can be found in the exhibit part or constituent ipAddress ( 4. 2 ) . This worth is â€Å"192. 168. 10. 45† . Take a gander at the exhibit cautiously to discover the centrality of the file esteems. Note: If you have to transfer a record into the C: Scripts catalog on vlab-PC1 or download a document from the vlab-PC1 C: Scripts document. detached Windows Explorer ( E ) . As should be obvious on the right. your neighborhood registering machine pushes ( in this occasion. the C: and D: ) are mapped to enroll transcript and glue ( or hindering power and dot ) simple to help through. Undertaking 2: Add the Code to Write the Array Data to a FilePseudocode| Comments|Specify the undermentioned constantsREAD = 1. Compose = 2. Attach = 8. ASCII = 0Define the variable filename and initialise it to â€Å"IP_Addresses. csv† Define the variable ipAddrStr and initialise it to â€Å"†Set fso to the â€Å"ScriptingFileSystemObject† using CreateObject Set ipFileObj = fso. CreateTextFile ( record name. Valid. ASCII ) For room = 0 to 5 For figuring machine = 0 to 3 ipAddrStr = CStr ( room+100 ) A ; â€Å" . † A ; CStr ( computer+1 ) A ; â€Å" . † A ; ipAddress ( room. processing machine ) A ; vbCrLf Use ipFileObj to Write ( IpAddrStr ) NextNext Close the fileSet ipFileObj = fso. OpenTextFile ( filename. Peruse. ASCII ) WScript. Reverberation ipFileObj. ReadAllipFileObj. Close | Named invariables ought to be all tops and the Const prefix ought to be utilized to recognize it from a variable whose worth can adjust. filename is a variable that co ntains the name of the record we will create. ipAddrStr will be utilized along these lines to hive away single records that we will make to the document â€Å"C: ScriptsIP_Addresses. csv† . You ever need to use â€Å"ScriptingFileSystemObject† to peruse. create. or on the other hand annex records. The CreateTextFile strategy has one required explanation and two discretionary articulations. The principal proclamation esteem is the document name as twine perpetual or variable. The announcement set to True organizations we will over-compose the document on the off chance that it exists. The third proclamation indicates the textfile design - 1=Unicode. 0=ASCII. 1= framework default group. Note the utilization of the variable document name. Once ipFileObj is connected to a document. it tends to be utilized only like WScript. StdOut. You can use the Write ( ) . WriteLine ( ) . what's more, WriteBlankLines ( ) strategies. Settled For cringles are utilized to dish the planar cluster of IP references. The outside cringle determines the room 0. . 5 ( stand foring suites 100. . 105 ) and within cringle determines the registering machine 0. . 3 ( stand foring registering machines 1. . 4 ) . In the a respectable starting point on balls through the cringle when room = 0 and figuring machine = 0. ipAddrStr is set to the value†100. 1. 192. 168. 10. 11† . Close the IP_Addresses. csv record using ipFileObj. Close Here we are opening the IP_Addresses. csv record and presenting its substance to confirm the File Creation and information design. . | Add the codification demonstrated by the pseudocode appeared beneath to create the Array to a book document. Real codification and identifiers for factors and strategies inside the pseudocode will be in intense wellspring. Deliberately read the comments to one side of the pseudocodewill be in italics. * Save your arrangement with S. * Press and enter cscript FileWrite. vbs. Snap OK to get down your book run. Your book will run in a docked Console window in NotePad++ as demonstrated as follows. * Another alternative for running this arrangement is to open a Windows Command Prompt ( CLI ) . change index to the C: Scripts organizer and show the arrangement to come ining the offer cscript IP_FileWrite. vbs. * Execute the dir * . csv offer to confirm the being of the IP_Addresses. csv record. * If your count has any errors or your record does non consolidate the informations appeared previously. troubleshoot your arrangement and re-run it until you have the correct results. At the point when you have accomplished the correct outcomes. transcript and paste your IP_FileWrite. vbs plan from NotePad++ into the predefined textbox in your lab-report papers. Other than duplicate the Windows offer brief count and document affirmation into the predetermined textbox into your lab-report papers. | Undertaking 3: Make the IP_AppendRead. vbs Plan The IP_AppendRead. vbs plan will make informations for another stay with four processing machines with alloted IP references. The arrangement will add on these four records ( one for every IP reference ) to the IP_Addresses. csv record. At that point the arrangement will open the IP_Addresses. csv document and uncover the substance of the document in a 1 record for each line clear arrangement. The new room records that were annexed ought to be shown. * Open NotePad++ and make another document called IP_AppendRead. vbs. Rescue this new book record in the C: Scripts registry. Do non duplicate and paste any codification from your IP_WriteFile. vbs plan. This arrangement ought to be composed from scraped area. * Add the codification demonstrated by the pseudocode appeared beneath to add on the new room informations to IP_Addresses. csv. Real codification and identifiers for factors and techniques inside the pseudocode will be in strong wellspring. Deliberately read the comments to one side of the pseudocode ; they will be in italics. Pseudocode| Comments|Add a suitable coder heading Determine the undermentioned constantsREAD = 1. Compose = 2. Add = 8. ASCII =0Define the variable filename and initialise it to â€Å"IP_Addresses. csv†Define the variable ipAddrStr and initialise it to â€Å"†Define newRoom and introductory it to â€Å"106†Define comp1_IP and initialise it to â€Å"192. 168. 10. 59†Define comp2_IP and initialise it to â€Å"192. 168. 10. 60†Define comp3_IP and initialise it to â€Å"192. 168. 10. 61†Define comp4_IP and initialise it to â€Å"192. 168. 10. 62†Set fso to the article â€Å"Scripting. FileSystemObject† | Named invariables ought to be all tops and the const prefix ought to be utilized to recognize it from a variable whose worth can modify. filename is a variable that contains the name of the record we will make. ipAddrStr will be utilized to develop the record twine that will be kept in touch with the document â€Å"C: ScriptsIP_Addresses. csv† . The factors newRoom. comp1_IP. comp2_IP. comp3_IP. what's more, comp4_IP are set to values that speak to another room ( 106 ) that contains four processing machines with explicit IP references. Utilize the CreateObject ( ) strategy to Set fso as an object of type: â€Å"Scripting. FileSystemObject† . | Pseudocode| Comments| ipAddrStr = _ newRoom A ; â€Å" . 1. † A ; comp1_IP A ; vbCrLf A ; _ newRoom A ; â€Å" . 2. † A ; comp2_IP A ; vbCrLf A ; _ newRoom A ; â€Å" . 3. † A ; comp3_IP A ; vbCrLf A ; _ newRoom A ; â€Å" . 4. † A ; comp4_IP A ; vbCrLfIf record recognized by filename does non be Then Beep Speaker Twice Show Message:â€Å"File Does Not Exist! ! ! † A ; newline A ; â€Å"You Must Create the File Before You can Read the File! ! † Quit ProgramEnd IfSet File object ipFileObj using fso. OpenTextFile ( ) make certain record is set APPEND and ASCII group Use ipFileObj item to add on ipAddrStr to stop of the record recognized by fileNameClose the file| ipAddrStr is set to a worth that speaks to the four Personal PCs in the new room 106. Note the use of the

No comments:

Post a Comment

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