LukasCCB

HTML/PHP start .bat or .exe from windows apache

18 posts in this topic

hi, I'm need system execute from html or PHP.

execute files (start.bat) or (server.exe) from windows wampserver.

I did one that just runs the file (close.bat) and runs a taskill more want one that makes the start.

Share this post


Link to post
Share on other sites

Have a look on

Please login or register to see this link.

and

Please login or register to see this link.

:)

Personally I've been using this

Please login or register to see this link.


Excellent guide that does what it needs. I've however not tried it from a Windows environment so that's up to you!
 

1 person likes this

Share this post


Link to post
Share on other sites

exec() or system() or passthru()

read:

Please login or register to see this link.

Please login or register to see this link.

Please login or register to see this link.

Share this post


Link to post
Share on other sites

My function from close programs in .bat file (PHP Test from VPS apache WampServer)

Close.bat

@echo off
taskkill /f /im "srcds.exe"
taskkill /f /im "cmd.exe"
ping -n 5 localhost>nul
pause>nul

 

command.php

<?php // Fechar servidor
if(isset($_POST['close']))
{
    exec('close.bat');
    echo "<br>Server Closed! <br>";
} else {
?>    (Please, Wait 5 sec!)
    <form action="" method="post">
        <input type="submit" name="close" value="Close Server Now">
    </form>
<?php } ?>

 

this makes something close more want something to open.
my problem is.
I have searched in many forums and no responses.

Sorry my bad english.

Share this post


Link to post
Share on other sites

there is a program that runs other programs in the background, it has the function of being managed in php.
but my knowledge of it is 0%.

Name is: FireDaemon Pro Service Manager

Share this post


Link to post
Share on other sites

Change close.bat, delete all contents then add command u want to use ie: notepad.exe ... then command.php will launch notepad.exe.

Share this post


Link to post
Share on other sites

@

Please login or register to see this link.

the closing process, everything is correct, what I want is to run.

exec('start.bat');

Share this post


Link to post
Share on other sites

Just add start.bat at the end of close.bat file it wil start automaticly when all is done in close.bat.

1 person likes this

Share this post


Link to post
Share on other sites

start.bat (don't work in php only click from windows)

start C:\GameCPRemote\installs\csgo_ds\srcds -game csgo -console -usercon +game_type 0 -tickrate 128 +game_mode 1 +map de_dust2 +exec server.cfg -maxplayers_override 11 +sv_setsteamaccount 5BDC7298A70EDDD78835371D4F6C0BC8

Share this post


Link to post
Share on other sites

Read what i wrote... u are adding it in close.bat not in command.php it will WORK couse it is WINDOWS BAT FILE.

Share this post


Link to post
Share on other sites

This? don't work, just close more no open

v3pC2QD.png

or start start.bat

in start.bar put code

start C:\Windows\system32\cmd.exe

(Don't work)

Share this post


Link to post
Share on other sites

I think you are better of just uploading the files and give us the link cause it's very hard to understand you :)

Share this post


Link to post
Share on other sites

Please login or register to see this link.

All files

Link: 

Please login or register to see this link.

Share this post


Link to post
Share on other sites
8 minutes ago, zeroabsolut said:

not can create script execute from url?

Ofc, just run the script directly when you enter the URL instead of pressing submit?

Share this post


Link to post
Share on other sites
17 minutes ago, Ocrion said:

Ofc, just run the script directly when you enter the URL instead of pressing submit?

thanks

On 3/17/2016 at 11:17 AM, LukasCCB said:

Please login or register to see this link.

All files

Link: 

Please login or register to see this link.

can reupload

Share this post


Link to post
Share on other sites

Please login or register to see this link.

Yes, files reuped.

Please login or register to see this link.

1 person likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now