473,322 Members | 1,480 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

how to run a bat file in remote PC through ASP

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.

Oct 10 '06 #1
2 3135
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".

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Oct 10 '06 #2
kk*********@gmail.com wrote:
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/

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Oct 10 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Peter A. Schott | last post by:
If I want to verify that a file has finished writing before deleting the remote file, what would be the best method? Current code on Python 2.4: #filename - remote FTP server File Name...
4
by: Rene' Nielsen | last post by:
Context: Running Windows 2003 Server on an intranet. A web is configured with an anonymous access account that is a domain account that has been granted the desired access to a file on another...
3
by: Daniel | last post by:
Is it possible to retain local file system read, write, delete access while impersonating for access to a remote drive in a different domain? I need to be able to move files from a local computer...
1
by: POnfri | last post by:
Hi, I have a problem in a peace of code were i'm doing a file copy using File.Copy. The Source is local and the target is a remote machine. Example: File.Copy(C:\temp\hi.txt,...
1
by: Saracen | last post by:
I have a major problem with trying to access a foxpro database from a web app. I have created a web app which is deployed on a server. The foxpro database (dbf) is on a different server. The...
18
by: Jen | last post by:
I'm using Microsoft's own VB.NET FTP Example: http://support.microsoft.com/default.aspx?scid=kb;en-us;832679 I can get the program to create directories, change directories, etc., but I can't...
1
by: Duffman | last post by:
Hi, I have what seems to be a common problem, but the solutions I've found don't seem to work. I would like to use a web service to create a file at a UNC location in a shared file. Currently...
5
by: idorjee | last post by:
hi guys, I'm trying to figure how to read a file from my other computer, and here is what i did. it doesn't work for some reason. i would really appreciate if you could help me with this. i get...
4
by: Vlad | last post by:
I am having problems using the file.create method within a function that is called when looping through an array of filepaths. If I call my function with a hardcoded file path --C:\Temp.txt the...
1
by: Bob Jones | last post by:
I am using ASP.NET 2.0 w/ c#. I have an Http handler that intercepts any request labeled .file. I am trying to have this handler serve up a file from a remote location (public) and I do not want to...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.