Run BAT (or other file) on remotely on server

Discussion in 'HTML' started by Vlad, Nov 25, 2008.

  1. Vlad

    Vlad Guest

    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
     
    Vlad, Nov 25, 2008
    #1
    1. Advertising

  2. Vlad wrote:

    > Hi All,


    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.


    Where are the bats? In your <head>, or what?

    > 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>

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Nov 25, 2008
    #2
    1. Advertising

  3. Vlad

    Guest

    Jukka K. Korpela wrote:
    > 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.
     
    , Nov 25, 2008
    #3
  4. Vlad

    Bergamot Guest

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

    >
    > 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. :)

    --
    Berg
     
    Bergamot, Nov 25, 2008
    #4
  5. wrote:

    > 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.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Nov 25, 2008
    #5
  6. Vlad

    Guest

    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.
     
    , Nov 25, 2008
    #6
  7. Vlad

    dorayme Guest

    In article <>,
    Bergamot <> wrote:

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

    > >
    > > 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. :)


    me too... I was wondering if it was me who had mellowed or him? <g>

    --
    dorayme
     
    dorayme, Nov 25, 2008
    #7
  8. Vlad

    1 Guest

    Jukka K. Korpela wrote:
    > wrote:
    >
    >> 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.


    Hey douche bag, how ya doin'?
     
    1, Nov 26, 2008
    #8
  9. Vlad

    viza Guest

    On Tue, 25 Nov 2008 05:46:37 -0800, Vlad wrote:

    > I hope this is the correct place for this post.


    You can't do it in html, so no, this is not the right place, but if you
    didn't know that this is a good place to find it out.

    Learn a bit of php, and use the system function:

    http://php.net/manual/en/function.system.php

    HTH
    viza
     
    viza, Nov 26, 2008
    #9
  10. Vlad

    Andy Dingley Guest

    On 25 Nov, 13:46, Vlad <> wrote:

    > 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>
     
    Andy Dingley, Nov 26, 2008
    #10
  11. Vlad

    Vlad Guest

    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
     
    Vlad, Nov 26, 2008
    #11
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?c29ubnk=?=

    Run a .Bat file on the client machine

    =?Utf-8?B?c29ubnk=?=, Jan 25, 2005, in forum: ASP .Net
    Replies:
    10
    Views:
    7,408
    Kevin Spencer
    Jan 26, 2005
  2. Stuart McGraw
    Replies:
    8
    Views:
    380
    Stuart McGraw
    Sep 23, 2004
  3. chandan
    Replies:
    0
    Views:
    304
    chandan
    Mar 18, 2008
  4. Geir
    Replies:
    5
    Views:
    5,298
    Jan C. Faerber
    Sep 10, 2009
  5. Josh

    Run BAT file with ASP script [ERROR]

    Josh, Oct 23, 2003, in forum: ASP General
    Replies:
    1
    Views:
    265
    Ray at
    Oct 23, 2003
Loading...

Share This Page