How to see opened cmd running at batch script when it is scheduled to run using windows scheduler - windows

I've written batch script and added that in windows scheduler service.
It runs fine and I can access my deployed app which I'm deploying using that service but I want command promote to get open and see that command running when that service is in progress.
How to do that?

Related

Starting jenkins Slave agent using Jnlp using Task Scheduler always starts as headless

I am trying to find solution for the jenkins nodes to automatically connect to master in non headleass mode.
Here is what I have done so far
I have written batch script which calls the powershell script. Powershell script has series of commands to start the jenkins slave agent using jnlp.
This batch script is configured in Task Scheduler to run at the startup. The jenkins slave node is connected to master as soon as node starts up.
But execution of GUI test is not visible in the node when the test starts.
When I manually run this batch script from command line, it works fine i.e non headless mode and I can see the execution of GUI test.
I've read few articles about this kind of setup and none worked.
I also wrote a small piece of powershell script to allow a Windows Service to Interact with Desktop. This script runs after the batch script to start jenkins slave agent.
Task scheduler job is configured to Run as Administrator and I login as administrator to see the execution.
Since this batch script is running via Task scheduler I am guessing its running in a different session.
How do I solve it.
Try to put your script into shell:startup.
On a Windows 10 machine with the Jenkins slave under the user you need, press Windows+R (Run...) and type shell:startup and put your script into opened folder. It will run once the user logged in.
This is how you'll see console and any windows it spawns.

run batch script after windows server restart

I am trying to run a script to startup some services after windows reboot.
I have tried one method: copying shortcuts of batch script in shell:startup folder. which eventually will start the scripts automatically but someone has to login to the system.
I am thinking about the possible ways to run the script after server restart without logon to the server.
Any help will be highly appreciated.
Create a Windows scheduled task and set it to run on system startup:

Windows task scheduler is not running in Windows server 2012 when trigger option is set as Startup

I have a task scheduler to execute a batch file on windows start up. I have the following setup in task scheduler,
Trigger - At startup
Action - to execute a batch file
Security options - Run whether user is logged on or not
When i reboot the machine, the task is not getting triggered and the status is ready. The same is working fine when i run it on demand.
My scenario is to run the batch file at the system startup (user will not log on to the machine) and the batch file should open a separate command prompt.
The above is working when executing the task on demand and not while during startup.
Following two steps are important
1 Configure for Windows 10 is important
2 Make sure all the checkboxes are unchecked as shown below, this is important
Refer this for more details

How to run JMeter server as a service in windows

Is it possible to run JMeter server as a service in windows?
Currently I'm just logging in and running it manually, but from time to time I have to restart this machine and I would like to make JMeter server run automatically after each restart (even no user logs in after restart).
To create windows service sc create serviceName binpath= "path\to\exe"
You can also create a shortcut/bat file in the windows startup folder to start the JMeter. C:\Users\username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
You can also have a look at this - to start a program using windows task scheduler w/o user log in.

Is there a way to open an interactive Command Prompt from a service?

When I try to execute "vstest.console.exe" file in Jenkins CI (service mode), it responses
Error: Could not start test run for unit tests for Windows Store app:
Unit tests for Windows Store apps cannot be run from a service or non
interactive process. Please run unit tests from an interactive
process..
However it will be able to run successful if I execute the same command from a Command prompt.
So I want to ask if there is a way to open Command Prompt from a service such as Jenkins CI.
I have tried with "start ExecuteVSTest.bat /I /K /REALTIME" but the result is still the same.
I couldn't find a way to open Command Prompt from a service. However I am able to resolve the problem between Jenkins CI and "vstest.console.exe".
We just need to deploy Jenkins from the WAR file via Tomcat server instead of installing Jenkins service native package.
Since the Tomcat is running in the console mode so Jenkins CI won't have the same trouble when executing "vstest.console.exe" as when it run in service mode.

Resources