Hi Veritant,
Thanks for the code you gave and it worked fine without any error.
Then I tried to run the exe which I actually want to run from my ASP page. I made the exe in Visual Basic, the code for which is as follows:
Sub Main()
Set oIELinkGeneral = CreateObject("InternetExplorer.Application")
Call oIELinkGeneral.Navigate("http://www.linkgeneral.com/logon.asp")
oIELinkGeneral.Visible = False
While oIELinkGeneral.ReadyState <> 4 Or oIELinkGeneral.Busy
Wend
oIELinkGeneral.document.Forms(1).Logon.Value = "seema"
oIELinkGeneral.document.Forms(1).password.Value = "12345"
oIELinkGeneral.document.Forms(1).LogonBtn.Click
While oIELinkGeneral.ReadyState <> 4 Or oIELinkGeneral.Busy
Wend
Call oIELinkGeneral.Navigate("http://www.linkgeneral.com/author.asp?addarticle=yes")
While oIELinkGeneral.ReadyState <> 4 Or oIELinkGeneral.Busy
Wend
oIELinkGeneral.document.Forms(1).subject.Value = "demo"
oIELinkGeneral.document.Forms(1).shortdescription.Value = "demoDescription"
oIELinkGeneral.document.Forms(1).catid.Value = "791"
oIELinkGeneral.document.Forms(1).articletext.Value = "demo article"
oIELinkGeneral.document.Forms(1).submitarticle.Click
While oIELinkGeneral.ReadyState <> 4 Or oIELinkGeneral.Busy
Wend
Call oIELinkGeneral.Navigate("http://www.linkgeneral.com/logon.asp?logout=yes")
While oIELinkGeneral.ReadyState <> 4 Or oIELinkGeneral.Busy
Wend
End Sub
I have written this code in a Module and in that VB Project there is only one module, no forms nothing. I made an exe of the project and saved it on the C: of the server.
Then in the code you provided i changed the line:
wshell.Run "notepad.exe c:\temp\textfile.txt", 1, false
to:
wshell.Run "c:\Project1.exe", 1, false
When I call the asp page it runs fine without any error. But, as you can see in the above code, I am trying to submit an article in that site, and when I go to that site I dont see any article submitted.
One more thing that I noticed is, when I checked the Task Manager on the server, I can see the exe still running under the Processess tab.
Can you please tell me what I should do to make it work?
Thanks once again.
PS: I got the following messages when I called the exe from ASP page
Starts here
8/31/2005 10:28:08 AM
Passed through
Run sucessfully
8/31/2005 10:28:08 AM
Enter your message below
Sign in or Join us (it's free).