Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

aspexec

Status
Not open for further replies.

sirron

Programmer
Mar 11, 2004
139
US
I try to run this code. It works but I need to do more with it.

I'm able to go to the directory that I specify, but now I want to run this (nrcmd.bat). I tried it by using this
Executor.Application = "cmd /c c:\CNR\NetworkRegistrar\bin\nrcmd.bat"

But something comes up saying not an internal command or external.

So I tried it on the Dos cmd. I get the same thing but if I change the directory then run the (nrcmd.bat) it works

So does any one know how to run a program once I'm in the directory where the (nrcmd.bat) file is?

The code I'm using

<html>
<head><title>ASPExec Test (copy)</title><head>
<body>
<H3>ASPExec Copy Test</H3>

<%
Set Executor = Server.CreateObject("ASPExec.Execute")
Executor.Application = "cmd.exe"

Executor.Parameters = "/C dir c:\CNR\NetworkRegistrar\bin"
Executor.Parameters =
strResult = Executor.ExecuteDosApp
Response.Write "<pre>" & strResult & "</pre>"
%>
</body>
</html>
 
make the batch file change the directory?

[thumbsup2]DreX
aKa - Robert
 
the nrcmd.bat is a program that opens up as a DOS prompt.

example: nrcmd>

I can do this from the DOS command is like this

I change the directory first

C:\Documents and Settings\Administrator>cd c:\CNR\NetworkRegistrar\bin\

second: I run the bat file from this directory
C:\CNR\NetworkRegistrar\bin>nrcmd.bat

this works by using the DOS command.

Does anyone know how to do this using ASPEXEC or using a bat file to do this option?

 
use the batch file to change the folder


@echo off
C:
cd\winnt\scripts\bin
blah blah blah


[thumbsup2]DreX
aKa - Robert
 
Hello sirron,

Despite very much looks like a reasonable choice of .ExecuteDosApp, change the execution line to this.
[tt] strResult = Executor.Execute[red]Win[/red]App[/tt]

regards - tsuji
 
If I use a batch file to change the folder.

Once the folder is changed. Should I use the batch file to run my (nrcmd.bat file) or should I use the asp page with ASPExec?

If so how would I do this?
 
sirron,

If so, run all the way in the batch, ie, including all the instructions.

I am interested in knowing whether .executewinapp has a positive impact or you are using .executedosapp and getting results?

- tsuji
 
nrcmd.bat is a batch file, and the additional commands i suggested would just go into that.

[thumbsup2]DreX
aKa - Robert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top