S
S
Sergey Sharikov2012-12-26 13:34:12
cmd/bat
Sergey Sharikov, 2012-12-26 13:34:12

Web face for batch scripts?

Hello!
Tell me a ready-made solution that allows you to quickly (with one click) run bat-cmd scripts on the server.
If someone suggests a ready-made solution that immediately allows you to do this, and monitoring, etc. (in general, brightening up the everyday life of a windows sysadmin in every possible way), I will be extremely grateful.

Answer the question

In order to leave comments, you need to log in

8 answer(s)
K
KEKSOV, 2012-12-26
@KEKSOV

There is such a thing - ssh. It's like RDP, only in text mode. Among other goodies, this system allows remote launch of programs. It looks like this - ssh [email protected]_ip c:\bin\script.bat and you will receive stdout script.bat in your console, which is physically launched on the server. You can configure everything so that you do not enter passwords every time. In a word, if you are doing administration, then ssh is your first friend and comrade for automating your routine actions.
Under Windu there is a wonderful UNIX port of the Cygwin environment when installing, specify sshd and follow this brief instruction . On clients, you can get by with plink from the PuTTY set. But I recommend putting the same Cygwin as a console, it will be more convenient.

H
HiltoN, 2012-12-26
@HiltoN

I don’t know if this will help you somehow, but many CI tools allow you to run bat scripts as well.
For example, Jenkins allows, among other things, to pass parameters entered on the UI to the script. But for all this to work remotely, you will need to install an agent on each machine on which you plan to execute scripts.
On our project, we use Jenkins not only for CI tasks, but also so that, for example, anyone can restart the app server through the web interface if necessary.

A
Alukardd, 2012-12-26
@Alukardd

In addition to the answer to the PR ssh via Cygwin (I actually always approve of *nix solutions), I can say that you can use the banal telnet.
Or if a little more advanced, then use PsExec from Rusinovich.

I
Ingtar, 2012-12-27
@Ingtar

Good afternoon! Recently discovered such a wonderful thing as Jenkins.
Gladly moved to her and can not get enough.
Web muzzle, a list of scripts, run anywhere and however you like :)
The only thing you need is to install Java and agents on the servers.
Here is an article: habrahabr.ru/post/161765/

K
KEKSOV, 2012-12-27
@KEKSOV

Well, WEBMORD is so webmorda ... if you please:

<?php
set_time_limit(0);

$bat = $_REQUEST[ 'mybat' ];
$allowedScripts = array( 'foo.bat', 'moo.bat', goo.bat' );
if ( !isset( $allowedScripts[ $bat ] ) ) {
    echo 'Go away you dirty хацкер!'
    exit;
}

echo '<xmp>';
passthru( $bat );
echo '</xmp>';
?>

And the related page:
<html>
<body>
<a href="bat.php?foo.bat">foo.bat</a><br/>
<a href="bat.php?boo.bat">boo.bat</a><br/>
<a href="bat.php?goo.bat">goo.bat</a><br/>
</body>
</html>

Does Ser want anything else—casinos, blackjack, masseuses? ;)

N
Nikolai Vasilchuk, 2012-12-26
@Anonym

I don't know any solutions.
But it is not difficult to make a page on the same php, with buttons and exec, to run scripts.
Of course, if the scripts do not work for long.

S
spmbt, 2012-12-26
@spmbt

response change test; also changed (here in habrajax edit_link will have to be tweaked a bit - margin-top: 0)

N
Nikolai Turnaviotov, 2012-12-27
@foxmuldercp

Specify the problem in full, please.
I am more than sure that there are ready-made tools to solve your problem

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question