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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running a BAT file from a web page

Status
Not open for further replies.

ASmee

IS-IT--Management
Jul 9, 2002
46
US
I want to create a web page that will allow me to run a BAT file, but this BAT file:

1 - resides on a different server (TR2).
2 - has to run on TR2.

Is this possible?

From my investigations so far I feel it is possible to execute a BAT file on the IIS server, but remotely????

Thanks
 
If your wanting the webserver to trigger it via serverside scripting, and the servers are windows you could install rcmd.exe on TR2. Then when the user opens the particular page on TR1 the servside scripting could send the command to execute to TR2.

Or you could write a tcp/ip listener socket on TR2 ( provided that the servers are safe in a DMV ect) and send the command from TR1 via serverside scripting.

Just a couple ideas they're not the best you can get from the forum but they may give you a starting point.


Thanks, Danzig
 
This may be what you are looking for:

Set objWSH = Server.CreateObject("WScript.Shell")
objWSH.Run "C:\test\test.bat", 1, true
Set objWSH = Nothing

You can map a drive letter to execute your bat file.
 
I'm new to ASP.
What will it do for line 3: Set objWSH = Nothing?
Can I use these 3 lines to execute something like "test.exe 1078" where 1078 is the passing input to a file test.exe?
THanks.

--
Mike FN
"8 out of 10 Owners who Expressed a Preference said Their Cats Preferred Web Programmer."
 
and mike, reposting the same thread tends to get you neglected....

the line 3 blahblah = nothing

that sets the object to nothing ( clears the object and memory used. )

and the other question :
objWSH.Run "C:\test\test.exe 1078", 1, true
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top