How i can run a default browser from .bat file - batch-file

I create a PHP server instance and I would like to run browser automatically with running run.bat
Bat file content:
"php/php.exe" -S localhost:81 -t dokuwiki

Just write folowing...
start website_address

Related

How do I run localhost server then open the browser in one batch file?

I'm just exploring batch files to avoid unnecessary typing. First, I set up the localhost server, then attempt to open the browser to access the local server. The batch file opens and starts the server, but then stops there. (it doesn't perform the open browser command) batch file looks like this:
cd C:\directory
py -m http.server
start /max http://localhost:8000
what am i missing?
The Problem
The problem is that once you start the python server, it keeps running, not stopping to run the open browser command.
The Solution
So you have to run the open browser command before the python server command.
Example
Like this:
cd C:\directory
start /max http://localhost:8000
py -m http.server

Using curl to upload files

I want to automate a file Upload to my webserver using curl. I created a batch file and used Windows Task Scheduler to execute it. When I run the batch file manually with my mouse, it sends the files to my webserver. When Windows Task Scheduler executes the batch file, it does not send files and I get error message :
'curl' is not recognized as an internal command or external, an executable program or a batch file.
curl -T C:/wamp/www/weblab/vinums/100321092.php ftp://ftp.myhost.com/anatemp/ --user user#myhost.com:mypassword
I have resolve that problem, by adding to the Windows > Control Panel > System > Advanced Settings > Environment variable
The path of curl for example : (C:\curl-7.75.0-win64-mingw\bin;)
And it works ... thanks for all

Jenkins Output Incomplete Log to the Console - SilkTest

I have a Jenkins pipeline that will run a batch file which contains command to run silk test. The part of the pipeline is as follow:
stage('execute-testscripts') {
steps {
script {
bat "cd Automation"
bat "C:\\Users\\Administrator\\Desktop\\silk_test.bat"
}
}
}
The content of silk_test.bat is as follow:
"C:\Program Files (x86)\Silk\SilkTest\ng\gui\STW.exe" -d examplexx -u example_id -p xxxxxx -r MY_EXAMPLE -s "ExampleXML" -verbose >> output.txt
type output.txt
del output.txt
When I execute the batch file on the command prompt on the Jenkins slave (via Remote Desktop Connection), the result is as follow (some details are hidden):
However, when I run the build on Jenkins, the console output is incomplete (doesn't show the output after the line "VERBOSE MODE: ON"):
[The same command is being run on the same Jenkins slave]
Is there any way to fix the Jenkins pipeline so that it displays the complete console output?
The issue is resolved by running the Jenkins slave agent as a Windows process, rather than running it as a Windows service, so that the process can interact with the applications.

Batch file to run an application placed on share drive

I am not able to run my batch file which is located on Share Drive..However it runs perfectly when the location is Desktop or local drive
Batch File Code:
cd "\\\172.17.23.42\Extra\"
"SL - EOD.acsauto"
Firstly, you must download the PsExec.exe tools from this link:
https://technet.microsoft.com/fr-fr/sysinternals/bb897553.aspx
Then, you type this command:
PsExec.exe -h -s \\NameOrIpOfYourServer -c -v PathFile_In_your_pc\file.bat
Best Regards

Batch file to run JMeter script

I have a .jmx file of all of my test plans and I want to create a batch file. When I click that, everything starts and ends automatically. So that I can provide it to my client as well to verify that I have performed the load test on his website. How can I achieve this?
jmeter does not support running batch of .jmx files as document part 2.4.3 (Command Line Mode) gives to us.
I would recommend you to try 2 approaches:
1) to follow best practices of running jMeter in non GUI mode.
In accordance to this approach you are expected to use the command
jmeter -n -t D:\TestScripts\script.jmx -l D:\TestScripts\scriptresults.jtl
Where the pareameters:
-n [This specifies JMeter is to run in non-gui mode]
-t [name of JMX file that contains the Test Plan]
-l [name of JTL file to log sample results to]
-j [name of JMeter run log file]
2) to use any cloud service for running your .jmx file.
BlazeMeter (http://blazemeter.com/) worked for me fine.
One can adjust the test plan settings.
Testing results can be seen on “Load Report” tab as soon as test finishes.
For detalization one can follow Getting Started: Scripting with JMeter steps.
Hope this works for you.
Just write the following command in a text file and save this file as SomeName.bat
#ECHO OFF
jmeter -n -t "Your .jmx file path" -l "Your .jtl file path"
For example:
#echo off
jmeter -n -t F:\DEV\WORKSPACE\buyer.jmx -l F:\DEV\WORKSPACE\output.jtl
After saving click on that bat file. The test plan result will be stored into .jtl file.
Note: Make sure you put this bat file into JmeterinstallationDirectory/bin folder.

Resources