Batch files

  • Thread starter Thread starter Dustin
  • Start date Start date
D

Dustin

Ok, let me try to explain... Im making a code generator
out of html and javascript for an online game(Tribes 1).
It has frames, left frame has a ton of drop down menus
and text forms, on the right is a large text area that
displays the code. I made a button to execute(from the
shell?) a batch file, but when it goes to execute the
file it gives me an error on the page where the link to
exec the .bat is, saying permission denied. I've looked
everywhere i can think of plus some and i have no idea
why this is happening. I've put a very large ammount of
time into this code generator and i'd hate to have to
stop so close to my goal. Many Many thanks for any info
on this.
 
You're on the right track, here is a functioning sample, you'll have to
adjust the file names etc to suit your purposes.

I beleive you went off track when you didn't include the if(inputparams!="")
section, but i havn't be able to reproduce the error you were refering to in
my brief tests. If the problem still occurs, its probably a problem with
the batch file or actual file securities then the script.



<HTML>
<HEAD>

</HEAD>
<BODY>

<SCRIPT type="text/javascript" LANGUAGE="JavaScript">
function executeCommands(inputparms)
{

var oShell = new ActiveXObject("Shell.Application");

var commandtoRun = "hello.bat";
if (inputparms != "")
{
var commandParms = document.Form1.filename.value;
}


oShell.ShellExecute(commandtoRun, commandParms,
"", "open", "1");
}
</SCRIPT>

<FORM name="Form1">
<CENTER>
<BR><BR>
<H1>Execute PC Commands From HTML </H1>
<BR><BR>
<File Name to Open:> <Input type="text"
name="filename"/>
<BR><BR>
<input type="Button" name="Button1"
value="Run Hello.Bat" onClick="executeCommands()" />
<BR><BR>
<input type="Button" name="Button2"
value="Run Hello.Bat with Parameters"
onClick="executeCommands(' + hasPARMS + ')" />





</CENTER>
</BODY>
</FORM>
</HTML>
 
I need to pass 32 parameters into a batch file, if i
can't call at least 32 parameters into the batch file all
hope is lost. I've read that you can't use more than 9
but THERE HAS TO BE A WAY!!! any help is more than
appreciated, thanks

-Dustin.
 
Back
Top