Create a VBScript script (w3_firstname_lastname.vbs) that takes one parameter (folder name) to do the following

1) List all files names, size, date created in the given folder
2) Parameter = Root Folder name The script should check and validate the folder name
3) Optionally, you can save the list into a file "Results.txt" using the redirection operator or by creating the file in the script.
4) Make sure to include comment block (flowerbox) in your code.
5) Sample run:- C:\entd261>cscript.exe w3_sammy_abaza.vbs "c:\entd261" >results.txt

Answers

Answer 1

Answer:

VBScript is given below

Explanation:

As per the given details the program should be as follows:

if (WScript.Arguments.Count = 0) then

WScript.Echo "Missing parameters"

else

'Declare the File System object to be used

Dim fso

'Declare the path variable to be used for storing the path entered by user

Dim path

'Create the File System object using the FileSystemObject class

Set fso = CreateObject("Scripting.FileSystemObject")

'initialize the path

path = WScript.Arguments(0)

'Check if the path exists

exists = fso.FolderExists(path)

if (exists) then

'declare a constant of size 1024 since 1024 bytes = 1 Kb

CONST bytesToKb = 1024

'Print the selected path

WScript.Echo "Selected Path " & WScript.Arguments(0)

'get the folder on path

Set inDir=fso.GetFolder(path)

'Create the file to store the output results

Set outFile = fso.CreateTextFile("Results.txt",True)

'Print the name, date created and size of each file and store the same in output file

For Each objFile in inDir.Files

  'Calculate the padding needed for File Name. Assuming the maximum length of file name is 40 characters

  namePadding = 40 - Len(objFile.Name)

  'Calculate the padding needed for Date

  datePadding = 30 - Len(objFile.DateCreated)

  'Add spaces to file Name so that same can be printed in a tabular format

  fileName = objFile.Name & Space(namePadding)

  'Add spaces to date so that same can be printed in a tabular format

  dateCreated = objFile.DateCreated & Space(datePadding)

  'Print the details on screen

  Wscript.Echo fileName & dateCreated & CINT(objFile.Size / bytesToKb) & "Kb"

  'Store the details in ouput file with a newline character at the end

  outFile.Write fileName & dateCreated & CINT(objFile.Size / bytesToKb) & "Kb" & vbCrLf

Next

'Close the output file once the loop ends

outFile.Close

else

'Print a message if the path does not exist

WScript.Echo "Invalid Path Entered"

end if

end if

Answer 2

In this exercise we have to use the programming knowledge to program from python in this way, so:

The code to solve this programming can be found in the image attached below.

As per the given details the program should be as follows:

if (WScript.Arguments.Count = 0) then

WScript.Echo "Missing parameters"

else

'Declare the File System object to be used

Dim fso

'Declare the path variable to be used for storing the path entered by user

Dim path

'Create the File System object using the FileSystemObject class

Set fso = CreateObject("Scripting.FileSystemObject")

'initialize the path

path = WScript.Arguments(0)

'Check if the path exists

exists = fso.FolderExists(path)

if (exists) then

'declare a constant of size 1024 since 1024 bytes = 1 Kb

CONST bytesToKb = 1024

'Print the selected path

WScript.Echo "Selected Path " & WScript.Arguments(0)

'get the folder on path

Set inDir=fso.GetFolder(path)

'Create the file to store the output results

Set outFile = fso.CreateTextFile("Results.txt",True)

For Each objFile in inDir.Files

 namePadding = 40 - Len(objFile.Name)

 'Calculate the padding needed for Date

 datePadding = 30 - Len(objFile.DateCreated)

   fileName = objFile.Name & Space(namePadding)

  dateCreated = objFile.DateCreated & Space(datePadding)

 'Print the details on screen

 Wscript.Echo fileName & dateCreated & CINT(objFile.Size / bytesToKb) & "Kb"

 'Store the details in ouput file with a newline character at the end

 outFile.Write fileName & dateCreated & CINT(objFile.Size / bytesToKb) & "Kb" & vbCrLf

Next

'Close the output file once the loop ends

outFile.Close

else

'Print a message if the path does not exist

WScript.Echo "Invalid Path Entered"

end if

end if

See more about python at brainly.com/question/26104476

Create A VBScript Script (w3_firstname_lastname.vbs) That Takes One Parameter (folder Name) To Do The

Related Questions

Write an abstract superclass encapsulating a college applicant:

A college applicant has two attributes: the applicant’s name and the college the applicant is applying to.

This class has two non-abstract subclasses: one encapsulating an applicant for undergraduate school, and the other encapsulating an applicant for graduate school.

An applicant for undergraduate school has two attributes: a SAT score and a GPA. An applicant for graduate school has one additional attribute: the college of origin.

It also has a method that returns "from inside" if the college of origin is the same as the college applied to; otherwise, it returns "from outside".

You also need to include a class to test two classes.Java please.

Answers

Answer:

The code snippet file is attached. There are four files:

Abstract Applicant ClassThe Graduate ClassThe Undergraduate classThe TestApplicantClass

The code is well commented and explanatory.

Explanation:

Which of the following is the definition of registration authority ( RA)?

a. The process of applying an algorithm to cleartext (or plain text) data, resulting in a ciphertext.
b. The certificate authority’s list of invalid certificates.
c. The concept of ensuring that an originator cannot refute the validity of a statement or document.
d. An entity that is responsible for the registration and initial authentication of certificate subscribers.

Answers

Answer:

The correct answer following question will be Option D.

Explanation:

An authority that verifies the user requests for digital certificates and tells to the CA (Certificate authority) to issue the certificates, known as Registration Authority (RA). The digital certificate contains a key named "public key" which is used to encrypt and decrypt digital signatures.

Hence, registration authority, it's an entity that is responsible for the authentication of certificate and registration and the other given options are not relatable to this authority.

So, option D is the correct answer.

#include ... void sig_handler(){ static int i = 1; printf("Beep\n"); alarm(i); ++i; } int main(){ struct sigaction sa; sa.sa_flags = 0; sa.sa_handler = sig_handler; if(sigaction(SIGALRM, &sa, NULL) != 0){ printf("Failed to bind handler.\n"); exit(1); } printf("Going into an infinite loop.\n"); alarm(1); while(1); return 0; }

Suppose the above program is run for 7.5 seconds after it prints "Going into an infinite loop". The program is run multiple times where the "system load" from other processes sharing the cpu will vary from none to many other processes. Which best characterizes how many times "Beep" is printed?

Answers

Answer:

Explained below

Explanation:

After the compiling the program it prints "Going to infinite loop" after that i started the timer till 4.5 sec. The program prints more than 4 beeps nearly 6-7 beep messages were printed.

The number "Beep" would always be strictly greater than 4.

Hence, if the above program is run for 7.5 seconds after it prints "Going in an infinite loop", it will print Beep for about 9-10 times. Hence, the number will always be greater than 7

Other Questions
Paula Boothe, president of the Indigo Corporation, has mandated a minimum 10% return on investment for any project undertaken by the company. Given the companys decentralization, Paula leaves all investment decisions to the divisional managers as long as they anticipate a minimum rate of return of at least 10%. The Energy Drinks division, under the direction of manager Martin Koch, has achieved a 13% return on investment for the past three years. This year is not expected to be different from the past three. Koch has just received a proposal to invest $1,800,000 in a new line of energy drinks that is expected to generate $234,000 in operating income.Calculate the residual income for the proposed new line of energy drinks. In an organization with Development, Testing and Production environments, an RPA Developer should not have access to the Production Environment.a) trueb) false Max is trying to prove to his friend that two reflections, one across the x-axis and another across the y-axis, will not result in a reflection across the line y = x for a pre-image in quadrant II. His friend Josiah is trying to prove that a reflection across the x-axis followed by a reflection across the y-axis will result in a reflection across the line y = x for a pre-image in quadrant II. Which student is correct, and which statements below will help him prove his conjecture? Check all that applyMax is correct.Josiah is correct.If one reflects a figure across the x-axis from quadrant II, the image will end up in quadrant III.If one reflects a figure across the y-axis from quadrant III, the image will end up in quadrant IV.A figure that is reflected from quadrant II to quadrant IV will be reflected across the line y = x.If one reflects a figure across the x-axis, the points of the image can be found using the pattern (x, y) (x, y). If one reflects a figure across the y-axis, the points of the image can be found using the pattern (x, y) (x, y). Taking the result from the first reflection (x, y) and applying the second mapping rule will result in (x, y), not (y, x), which reflecting across the line should give. Describe your long-term academic and professional goals, and how participation in the SULI program could develop or expand skills required to achieve those goals. A car traveling at 100 km/hr strikes an unfortunate bug and splatters it. The force of impact is:______ A) greater on the bug.B) greater on the car.C) the same for both. A client has recently been prescribed a drug that treats hypertension by blocking the sympathetic receptors in the sympathetic nervous system. This action is characteristic of which? The law permits only bicycle or motorcycle drivers to wear stereo head-phones while operating the vehicle.A) True B) False True or False. Sulfur-reducing bacteria can cause corrosion in neutral anoxic enclosed waste water tanks. Bacteria used to help break down fiber and cellulose in anaerobic environments are found in anaerobic reactors of tertiary wastewater treatment. Ammonia-oxidizing bacteria are found on the outside of granules used in AST. Phosphorus-accumulating organisms are used in mines in enhanced biological phosphorus removal. Chemolithotrophs are used in leaching through oxidation of materials in aquatic environments. A frozen food manufacturer can produce either pizzas or calzones. As the result of an increase in the price of calzones, the firm produces more calzones and fewer pizzas. An economist would explain this by sayingA) The supply of calzones increased and the supply of pizzas decreased.B) There has been an increase in the quantity supplied of calzones and a decrease in the quantity supplied of pizzas.C) The supply of calzones increased and the quantity supplied of pizza decreased.D) There has been an increase in the quantity supplied of calzones and a decrease in the supply of pizza. Unit Test ReviewActiveYellow light has a frequency of 5.2 x 1014 Hz and travels at a speed of 3.0 x 108 m/s. What is the wavelength of yellow light, inmeters?5.8 x 10-7m2.2 x 10-6m1.7 106 m8.2 * 1022 mSave and ExitNextSubmitthe What is the equation of the line in slope-intercept form?y=_ x +_ If you do not give credit to an outside source you used, you are in danger of what Research with infant rats suggests that _____ as a baby may insulate a person from stress as an adult. In order for the State Administrator to enter an order revoking or suspending a registration, which requirement MUST be present?A. The order must be in the public interestB. The registration must be misleadingC. A complaint must have been received by the AdministratorD. A willful violation of the Act must have occurred Which substance in each of the following pairs would you expect to have the higher boiling point? Explain why. a. Ne or Xe b. CO2 or CS2 c. CH4 or Cl2d. F2 or LiF e. NH3 or PH3 Distinguishing ionic, molecular and atomic solids web activity Conductors have(blank) resistance.Moderate. Very High. Very low. If a server notices guests are selling drugs while in the establishment but does not report it to the authorities, the server has committed which type of violation? Describe your 5 layers of citizenship (home, school, city, state, nation).List examples of rights at each layerList examples of responsibilities at each layerIdentify the source of rights and responsibilities at each level. _______ means segregation that comes from personal choice or choices Steam Workshop Downloader