Question

In: Computer Science

Create 2 more batch files called devTracker.bat and showTracker.bat as follows: devTracker.bat a. This batch logs...

Create 2 more batch files called devTracker.bat and showTracker.bat as follows:
devTracker.bat
a. This batch logs an entry into a log file called C:\myTemp\devTracker.log
b. The entry in the log file should indicate the date and time of the VS launch as well as a message indicating
that you started Visual Studio. Please log all of this information on 1 line in the devTracker.log file
c. After making this log entry, devTracker.bat should run myStart.bat for you
showTracker.bat
d. Create another batch file called showTracker.bat that displays the contents of the devTracker.log
file in the command prompt window.

Solutions

Expert Solution

Note: Done accordingly. Please comment for any problem. Please Uprate. Thanks

Remember to make folder : C:\myTemp

Code:

devTracker.bat

:search
@ECHO off
tasklist | find "dev" >nul
IF %ERRORLEVEL% == 0 ( GOTO found)
   timeout /t 1 >nul 2>&1
   GOTO search
:found
   echo You Started Visual Studio = %time% %date%>> "C:\myTemp\devTracker.log"
   showTracker.bat

showTracker.bat

SET filename="C:\myTemp\devTracker.log"
type %filename%

Code Screenshot:

Explanation:

:search

@ECHO off -->suppressing output
tasklist | find "dev" >nul --> checking for task whether dev is running or not. suppressing all output to nul
IF %ERRORLEVEL% == 0 ( GOTO found) --> while checking tasks if there is no error then go to found
   timeout /t 1 >nul 2>&1 --> if error then wait for 1 sec and go to search. Here we used >nul 2>&1 to hide displaying error msg and timeout msg
   GOTO search
:found
   echo You Started Visual Studio = %time% %date%>> "C:\myTemp\devTracker.log" --> if task is started log in file
   showTracker.bat --> open next batch

Output:

Batch is running but visual studio is not started.

Started Visual studio


Related Solutions

In C++ Create a class called Rational (separate the files as shown in the chapter) for...
In C++ Create a class called Rational (separate the files as shown in the chapter) for performing arithmetic with fractions. Write a program to test your class. Use integer variables to represent the private data of the class-the numerator and the denominator. Provide a constructor that enables an object of this class to be initialized when it's declared. The constructor should contain default values in case no initializers are provided and should store the fraction in reduced form. For example,...
Create a new folder called CSCI130_A3_yourname. Create all of the files indicated below within this folder....
Create a new folder called CSCI130_A3_yourname. Create all of the files indicated below within this folder. For this assignment you will be creating a total of 2 classes that meet the definitions below. This assignment will allow the user to enter in the coefficients for a polynomial function of degree 2. The user will then be asked to enter a number. The program will use that number as an argument to the function, and will print the corresponding function value....
You must create two Java files. One is called LastNameFirstNameWeek6Prog.java, and the other is called  Museum.java. Ensure...
You must create two Java files. One is called LastNameFirstNameWeek6Prog.java, and the other is called  Museum.java. Ensure you include ALL files required to make your program compile and run. I would like to see your .java files only. 5% Museum.java Class File 1.    Create a new class called Museum that describes a Museum and includes the functionality below 2.    The new class has the following five attributes: a. officialName – the museum’s given name (i.e.:“ New Orleans Museum of Arts”,etc.), type...
9.6 (Rational Class) Create a class called Rational (separate the files as shown in the chapter)...
9.6 (Rational Class) Create a class called Rational (separate the files as shown in the chapter) for performing arithmetic with fractions. Write a program to test your class. Use integer variables to represent the private data of the class-the numerator and the denominator. Provide a constructor that enables an object of this class to be initialized when it's declared. The constructor should contain default values in case no initializers are provided and should store the fraction in reduced form. For...
Working with Files in C++. Create the following  program called payroll.cpp.  Note that the file you...
Working with Files in C++. Create the following  program called payroll.cpp.  Note that the file you read must be created before you run this program.  The output file will be created automatically by the program.  You can save the input file in the same directory as your payroll.cpp file by using Add New Item, Text File.   // File:  Payroll.cpp // Purpose:  Read data from a file and write out a payroll // Programmer:  (your name and section) #include <cstdlib>...
Edit question Write a program that merges two files as follows. The two files are in...
Edit question Write a program that merges two files as follows. The two files are in the docsharing which you can download it. One file will contain usernames(usernames.txt):foster001smith023nyuyen002...The other file will contain passwords(passwords.txt):x34rdf3ep43e4rddw32eds22...The program should create a third file matching username and passwords(usernamesPasswords.txt):foster001x34rdf3esmith023p43e4rddnyuyen002w32eds22......Give the user of your programs the option of displaying you output file. CAN ANYONE SOLVE THIS IN C
John Boy Lumber cuts logs to create 2 immediate joint products, lumber and sawdust. Unfinished lumber...
John Boy Lumber cuts logs to create 2 immediate joint products, lumber and sawdust. Unfinished lumber can be sold as is for $140 or processed further at a sales price of $270. Sawdust can be sold as is for $40 or processed further for a sales price of $50. There are joint product costs (costs up to the split off point) allocated to each of the products – $176 for lumber and $24 for sawdust. The cost of further processing...
Create a C++ program that follows the specifications below: *Define a struct with 4 or more...
Create a C++ program that follows the specifications below: *Define a struct with 4 or more members. *Application must have at least one user-defined function *Declare an array of your struct using a size of 10 or more *Load the date for each element in your array from a text file *Display the data in your array in the terminal *provide brief comments for each line of code
In this programming assignment, you need to create 3 files. 1. DateType.h 2. DateType.cpp 3. A...
In this programming assignment, you need to create 3 files. 1. DateType.h 2. DateType.cpp 3. A test driver for testing the class defined in the other 2 files. You can name your file in the way you like. Remember it must be a .cpp file. In DateType.h file, type these lines: // To declare a class for the Date ADT // This is the header file DateType.h class DateType { public: void Initialize(int newMonth, int newDay, int newYear); int GetYear()...
1. Create a new Java project called L2 and a class named L2 2. Create a...
1. Create a new Java project called L2 and a class named L2 2. Create a second class called ArrayExaminer. 3. In the ArrayExaminer class declare the following instance variables: a. String named textFileName b. Array of 20 integers named numArray (Only do the 1st half of the declaration here: int [] numArray; ) c. Integer variable named largest d. Integer value named largestIndex 4. Add the following methods to this class: a. A constructor with one String parameter that...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT