ms-dos batch files

 
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI
View previous topic :: View next topic  
Author Message
WolfWood
-


Joined: 03 May 2003
Posts: 1

PostPosted: Wed Oct 08, 2003 7:36 am    Post subject: ms-dos batch files Reply with quote

I just wanted to know if it was possible to execute ms-dos batch files using abyss? If so, can you please tell me how?

Thanks alot
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Wed Oct 08, 2003 11:32 pm    Post subject: Re: ms-dos batch files Reply with quote

WolfWood wrote:
I just wanted to know if it was possible to execute ms-dos batch files using abyss? If so, can you please tell me how?

Thanks alot

It is impossible to do so with the current version unless you write a simple wrapper program. If you want, please contact us (support@aprelium.com)and we'll send you a wrapper to test it.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
JohnC
-


Joined: 09 Oct 2003
Posts: 34

PostPosted: Fri Oct 10, 2003 12:29 am    Post subject: Reply with quote

If you are using ASP - then you can use inbuilt windows ActiveX objects to run a batch file. The sample below is a snippet from a WSH file that I'm writing in Javascript which dynamically writes a BAT file, then runs it :

Code:
// STEP 4 : CREATE A BATCH FILE TO RUN PASCO
var fso=new ActiveXObject("Scripting.FileSystemObject");
var WSH=WScript.CreateObject("WScript.Shell");
var PB=ScriptPath+"\\pasco.bat";      // CONSTRUCT PATH TO BATCHFILE
var B=fso.CreateTextFile(PB,true);      // (OVER)WRITE BATCHFILE...
B.WriteLine("@echo off");
B.WriteLine('pasco.exe -t "'+OutputDelimiter+'" '+InDat+' > '+Pout);
B.WriteLine("cls"); B.WriteLine("exit"); B.Close();
// STEP 5 : RUN THE BATCH FILE (HIDDEN/MINIMISED), WAIT TILL IT EXITS
try{WSH.Run("pasco.bat",0,true);}   // MUST USE RELATIVE PATH, OR DOS 8.3 PATH !
catch(e){ Error("COULD NOT RUN BATCH FILE TO START PASCO :\n\n-> "+PB,ERpasco); }


In ASP you would use "fso=Server.createObject" instead of "fso=new ActiveXObject" and "WScript.CreateObject". And the commands would be slightly different, also the syntax would be different if using VB rather than JS language. The code above is NOT complete, and will NOT work as-is - it's just to demonstrate the technique.

But what you basically do is use the inbuilt MS script engines to do the work for you. There are similar function calls in Perl and PHP - that is the easiest way to get a script to run an EXE : the server runs a script that then runs the batchfile, and acts like the "wrapper" that aprelium mentions.

JC
Back to top View user's profile Send private message
igoryonya
-


Joined: 17 May 2003
Posts: 11

PostPosted: Wed Dec 17, 2003 2:43 am    Post subject: process bat files Reply with quote

I think, that if you add
Quote:
c:\command.com
in CGI Interpreters section in Abyss Configuration and associate it with
Quote:
bat
. It should work. Since
Quote:
command.com
is the interpreter for batch files.
I've never tried to do it myself, but, if it works, please tell me.
Back to top View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group