View previous topic :: View next topic |
Author |
Message |
WolfWood -
Joined: 03 May 2003 Posts: 1
|
Posted: Wed Oct 08, 2003 7:36 am Post subject: ms-dos batch files |
|
|
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 |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Wed Oct 08, 2003 11:32 pm Post subject: Re: ms-dos batch files |
|
|
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 |
|
|
JohnC -
Joined: 09 Oct 2003 Posts: 34
|
Posted: Fri Oct 10, 2003 12:29 am Post subject: |
|
|
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 |
|
|
igoryonya -
Joined: 17 May 2003 Posts: 11
|
Posted: Wed Dec 17, 2003 2:43 am Post subject: process bat files |
|
|
I think, that if you add in CGI Interpreters section in Abyss Configuration and associate it with . It should work. Since is the interpreter for batch files.
I've never tried to do it myself, but, if it works, please tell me. |
|
Back to top |
|
|
|