Run BAT (or other file) on remotely on server

V

Vlad

Hi All,

I hope this is the correct place for this post.

I want to add a button to a secure site that will run a bat file to
perform numerous archiving functions.

The button can only be accessed by me so there are no huge security
risks.

What HTML code do I need to run the file remotely on the web server
when I click the button.

Any ideas?

TIA
 
J

Jukka K. Korpela

Vlad said:

All just died and made me god.
I hope this is the correct place for this post.

If you ask that way, the answer is usually "No".
I want to add a button to a secure site that will run a bat file to
perform numerous archiving functions.

The button can only be accessed by me so there are no huge security
risks.

Excellent! Now we just have to... isolate you from any computer, and there
won't be any _real_ risk. After all, human beings are the important security
risk, aren't they?
What HTML code do I need to run the file remotely on the web server
when I click the button.

Your question is so confused that you should pose the following question to
a person who knows the server side technology on your server:

Can you please set up a server-side script that performs the archiving
functions [include a list here]? Then please tell be the address so that I
can use, for my private convenience, a button as in
<form action="theaddress" method="post">
<input type="submit" value="Archive">
</form>
 
E

example

Jukka said:
All just died and made me god.
Where are the bats? In your <head>, or what?

In one of those moods again, Jukka?

Where you abandon your well respected position as a
person knowledgeable in the workings of the internet,
and turn into a smart-ass critic of the clueless?

Please, let's just ignore the clueless. No need to
get mean.
 
B

Bergamot

In one of those moods again, Jukka?
Please, let's just ignore the clueless. No need to
get mean.

Hmmm, I thought he was in one of his rare humorous moods. :)
 
J

Jukka K. Korpela

Please, let's just ignore the clueless. No need to
get mean.

On your request, I will try to ignore all nameles cowards who send their
messages under a forged e-mail address under example.com, and I hope you
will keep using such an address until you consider becoming a civilized
person. TIA.
 
M

mynameisnobodyodyssea

Jukka is right, the problem is not the
HTML code, but the server-side script that has to
parse, compile and run the bat file,
and that depends on what server you have, etc.
The HTML code itself can be very simple
(a submit button in a form in a password protected page).
Depending on what you need to do,
you might consider running the script automatically with cron,
(this way you can have the script in a server location that
is not accessible from the web.)
Because there are large amounts of data that need processing,
ask the web server hosting provider support if they
recommend to run the program only at certain times, etc.
 
1

1

Jukka said:
On your request, I will try to ignore all nameles cowards who send their
messages under a forged e-mail address under example.com, and I hope you
will keep using such an address until you consider becoming a civilized
person. TIA.

Hey douche bag, how ya doin'?
 
A

Andy Dingley

I want to add a button to a secure site that will run a bat file to
perform numerous archiving functions.

You haven't told us what OS or web server you're using, but I'm
guessing Windows and IIS.

Find an online ref, probably an oldish one, and look up the use of
"CGI gateways" (web stuff, not graphics). This is likely to lead you
to where you more or less need to get to.

It's not a great technique. bat files are horribly crude. Even Unix
shell scripts are somewhat limited and Windows' incarnation of them as
bats is just pathetic. You can "do" stuff, but it's hard to "control"
things if they don't work as you'd planned. Writing commercial-grade
scripts needs you to be able to tell when something has gone wrong,
stop doing the rest of the process (don't over-write last week's
backup when today's has failed) and then to report back what happened.

Then can the whole idea of web-triggered backups and use "cron" or the
Windows "at" service. Why have to manually trigger regular jobs? Get
your computer to do it for you.
The button can only be accessed by me so there are no huge security
risks.

A dangerous irrelevance. That's _NOT_ the way to think about this.

Now if only you have network access, that's OK.

If this button only works if someone has already validated their
access, that's OK.

If you think that only one person "having access to" the button is OK,
that's wrong (I can easily make my own button that submits the same
URL).

If you think that only one person "knowing about the button" is OK,
that's wrong. (I saw your button traffic in the router / server logs).

What HTML code do I need to run the file remotely on the web server
when I click the button.

Very simple <form> with a button on it: any HTML forms tutorial should
tell you the rest.

Make sure the form uses <form method="POST" ... > rather than a GET.
For why, look up "RESTful" architectures - but (in brief) you don't
want "actions" to happen on a server in response to things triggered
by a simple GET. This is why you shouldn't (you could easily do it,
but it would be a bad idea) use a <a> link and a URL to trigger your
backup but should stick with a <form>
 
V

Vlad

Sorry for the original question being a bit vague - It is a windows
server 2003 - and IIS

Thanks for the useful pointers - I'm going to go away and experiment.

Ta
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top