Tuesday, December 22, 2015

How to run a batch script from Workspace

In order to run a batch job through Workspace, we can take the following steps:

In this example, I am going over the steps in creating a job which when runs the ExportSecurity batch job (that I have created for a specific application) from the Workspace.


The “Generic Job Application” tab opens.
Right-click anywhere and choose “Create New Generic Application” OR click the “+” sign.
The following “Create New Generic Application” window pops up.



Provide a suitable “Product Name” like in the following screenshot. In my example, I have given a name “Export_Security_From_Workspace”
Choose a Product Host, which is the Server where Workspace is Configured.
We can “Click a button to insert a Command Template value.” In this case (it being a Windows batch job), we can select “$PROGRAM” and “$PARAMS” – Note: Please refer to “Reporting and Analysis Frameword Admin guide” for more information on this.
For the Executable we can specify the “CMD.EXE” file - %WINDIR%\System32\cmd.exe


Click OK

Now the steps to import the batch file.
In this example, I am in the “Testing” folder in Workspace.
Import “File As a job”



The following windows pops up.


Provide the file, a name and description (optional), and check “Import as Generic Job” like in the following screenshot.



Click Next. The following screen pops up. Choose the job we created in the beginning of the tutorial.



Based on requirement or the work environment, we can choose “Run Options” “Parameters” “Credentials” etc. However, it can be finished at this point by clicking the “Finish” tab.
Now, we can see the job in the folder “Testing” in the Workspace.


We can now run the job by double-clicking or by right-clicking.


The following windows appears where we can specify the output.



Click “Run”



When the job completes, we can see the security file being populated.



Check the “Testing” folder again and we now have the OUTFILE as well where resides the “SECFILE.TXT”