how to run a bat file in remote PC through ASP

K

kk.simhadri

Hi everybody,

I want to run a bat file which is on different PC in the same network.

I am able to run a batch file in my PC through the following code

<%
set wshell = CreateObject("WScript.Shell")
wshell.run "c:\file.bat"
set wshell = nothing
%>

but if I change the path to some network ,like

<%
set wshell = CreateObject("WScript.Shell")
wshell.run "\\10.101.xx.xxx\folder\file.bat"
set wshell = nothing
%>

the code is not working.

Does anybody have an idea on how to run the batch file in network
through ASP?

Any help would be appreciated.
 
E

Evertjan.

wrote on 10 okt 2006 in microsoft.public.inetserver.asp.general:
Hi everybody,

I want to run a bat file which is on different PC in the same network.

I am able to run a batch file in my PC through the following code

<%
set wshell = CreateObject("WScript.Shell")
wshell.run "c:\file.bat"
set wshell = nothing
%>

but if I change the path to some network ,like

<%
set wshell = CreateObject("WScript.Shell")
wshell.run "\\10.101.xx.xxx\folder\file.bat"
set wshell = nothing
%>

the code is not working.

What a strange idea setting up a shell, and then expecting this shell to
run on another machine than the one it is set up in.
Does anybody have an idea on how to run the batch file in network
through ASP?

Asp is just a html renderer, and can run allowed processes on the server.

So you will have a proces [the above shell in the case of a .bat] on the
server do that, or compromise the client security by running a proces
[shell & .bat] on the client by html.

Or you could skedule a proces on the client interrogating a server's .asp
file regularly if a client .bat file should be started.

All 3 are outside asp, this NG's topic.

So the answer to your Q seems to be: "impossible".
 
D

Dave Anderson

Does anybody have an idea on how to run the batch file
in network through ASP?

It may be possible to use ASP to initate a batch file on the machine hosting
the ASP script. You could then trigger that process via an HTTP request.

I presume this is not what you are after, however, in which case there is no
advantage to using ASP. I recommend that you check out the MSDN script
repository: http://www.microsoft.com/technet/scriptcenter/scripts/
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,744
Latest member
CortneyMcK

Latest Threads

Top