Question: Part 1 - Creating a Perl Script to Access the Win 3 2 API This program will pull system data from the Windows OS using

Part 1- Creating a Perl Script to Access the Win32 API
This program will pull system data from the Windows OS using Win32 API functions.
Start Notepad++ and create a new file called Win32.pl and save it to a memorable location such as C:\Strawberry\Scripts.
In the new Notepad++ file, type # Win32.pl on the first line and press ENTER.
Write comments for documenting the program. Be sure to enter your name, course number, date, and a brief description of what the program does.
After your lines of documentation, press ENTER two times to create a blank line for separating your comments from the script code.
Type use win32; and press ENTER this imports the win32 module
Type $login = Win32::LoginName(); and press ENTER - this populates the $login variable with the data gathered from LoginName().
Type $NetBIOS = Win32::NodeName(); and press ENTER this populates the $NetBIOS variable with the data gathered from NodeName()
Type $Filesystem = Win32::FsType(); and press ENTER this populates the $Filesystem variable with the data gathered from FsType()
Type $Directory = Win32::GetCwd(); and press ENTER this populates the $Directory variable with the data gathered from GetCwd()
Type $os_name = Win32::GetOSName(); and press ENTER this populates the $os_name variable with the data gathered from GetOSName()
Type print "$login
"; and press ENTER this prints the data in the variable
Type print "$NetBIOS
"; and press ENTER this prints the data in the variable
Type print "$Filesystem
"; and press ENTER this prints the data in the variable
Type print "$Directory
"; and press ENTER this prints the data in the variable
Type print "$os_name
"; and press ENTER this prints the data in the variable
Your code should now look similar to the screenshot below.
Select two more Win32 API Functions from the Win32_API_Functions.pdf document [2] in the Lab Resources section or another source and add them to the code.
Add comments to the code to make it more readable and understandable
Add labels to print statements and/or create new print statements to make the output more understandable
Save the script file, open a command prompt (cmd), navigate to the folder containing your Win32.pl file, and run the script by typing perl Win32.pl and pressing ENTER.
Take a screenshot of the script code and paste it in your Lab Report with captions or titles.
Take a screenshot of the script output and paste it in your Lab Report with captions or titles.
Analyze and research results and scripts for a consolidated write-up to include in Analysis section of your Lab Report

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!