For my application, I think I would want to store the .exe file on the server and run the file on the server as well. All my executable does is take an Access table that is on the server side and convert it to an Excel spreadsheet. Therefore, I think it would be fine to run the executable on the server. However, I want the newly created spreadsheet file to be saved to the client's local hard drive. Any further suggestions?
I really appreciate your help. You've been extremely helpful. I think if I explained the process to you you'd understand why I am doing it this way. Of course, I may not be using the optimal solution. However, I need to work on another project that's come up. I will be in touch in the near future when this becomes a priority again. Again thanks.
You are right, I definately want to use VBScript to execute the .exe file on the client side. For some reason it's not working though. I'll include my code and give a description of what's up.
The executable file is outputExcel.exe and it is on the server.
Here is the code I used on my ASP page:
<%
Set Command = WScript.CreateObject("WScript.shell"
cmd = "./outputExcel.exe" 'error might be here, the .exe is in the same folder as the ASP page, so I wrote it this way.
Command.run (cmd)
%>
I created an ASP page that executed EXCEL and the EXCEL process shows in Task Manager. However, the browser can not display an executable or the output from an executable unless it creates an HTML page dynamically and then displays it on the fly.
You will not be able to see on the client any of the executable's out put directly.
The executable basically runs in the background and is not accessable through the web. At least, not yet. I believe .NET is working to make this happen.
As far as your code, don't use command because I believe there is a command already out there.
<%
Set Wsh = CreateObject("WScript.shell"
Wsh.run ("yourdrive:\yourdirectory\outputExcel.exe)
%>
I don't need to make the Excel spreadsheet viewable to the user in the browser. The only thing I need to do is create the Excel spreadsheet on the user's local hard drive. The executable file does this properly when I execute it myself. However, I want it to run automatically in the background from the web page.
My application has a front-end that allows the user to create a temporary table in Access from a larger database using only the fields that the user wants. From here the user wants to be able to export this data into Excel, so that they can make graphs, etc. My front-end is working properly and creating the temporary table. The VB .exe that I created exports this temporary table into Excel (and creates an .xls file on the local hard drive) when I double click the .exe that is stored on the server, but as I said when the temporary table is created I would like all this to happen automatically instead of causing the user to have to execute the .exe file themselves.
I used your code above and the executible did not create the spreadsheet on the local hard drive. I don't know what to do. The one problem could be that the .exe file is on the server and in your code above it stipulates a local drive and local directory.
Here's my updated code.....
<%
Set Wsh = CreateObject("WScript.shell"
Wsh.run ("
Your statements are confusing. You say that your exe creates an Excel file on the local hard drive (Is this a browser client? or network connected? when you click on it on the server. How does your executable know where to save the .XLS file either from the browser or interactively?
Running an executable from a command line or VBscript is different than running from a browser. Can you clarify?
I am using a local intranet here at work that is not connected to the internet.
The .exe file itself (written in VB 5.0) contains the destination directory for the spreadsheet file (this is how it knows where to store the .xls file). The destination directory is local to the user. However, the .exe file is stored on the same server that the ASP pages are stored.
Therefore, when I go to Windows Explorer and double click the .exe file (outputExcel.exe), it works properly (i.e., it takes the table that was created and exports that table into an .xls file that is stored on the user's local hard drive). However, when I try to call the .exe file from the ASP page it doesn't work properly. It doesn't appear in the Task Manager, and it doesn't create the .xls file.
First, you need to find if your web site allows you to run executables from the ASP page. Go to your Internet Service Manager, open it, go to your web site and right click on your web site to bring up it's properties.
There's an "Execute permissions" drop down. Select "Scripts and executables". Try this first.
P.S. The code I gave you sends a table but opens an Excel spread sheet on the client without having to down load the file. It should work with any browser as long as the client has Excel loaded.
Let me start off by telling you that I am using Personal Web Server as a testing environment and that Personal Web Server is not installed on my computer.
When I run the ASP page on my machine the code above does not work. However, if I run the ASP page on the machine that Personal Web Server is installed on it works perfectly. I'm guessing this is because it's not allowing the .exe file to execute on another machine.
How do I allow this access w/ Personal Web Server (please explain the Internet Service Manager message from your last post)???
Internet Service Manager allows you to set up manage your FTP, web site and SMTP servers. It's found in Control Panel, Administrative Tools.
In particular, you can create and manage web site functionality and permissions. This is where you can set your ASP page to run executables or just run scripts.
Since you can execute your VB executable on your machine, you probably have rights to do that from NT authentication. However, your WEB site uses a different account. This keeps people from getting in thru your web site and mucking around with stuff you don't want them to. It's a little complex. Basically, you just want people to get access to your web pages and not your system executables.
You have been such a big help. I have the application working now, but a little different than I originally planned. The executable is executing on the server side, not the client side. Also, the Excel spreadsheet is being created on the server side and not the client side. That's the reason that it worked from the server test machine and not my machine. It was actually working from my machine, but was executing and saving the .xls file to the server.
Now all I have to do is write a downloading script to transfer that file from the server to the client. I don't know how to do that yet, but I will get it. Any suggestions?
I'm new to this site. Is there anywhere I can leave feedback about your responses?
Once your Excel file is created, you can refer to it in a link for downloading. This way you don't have to figure out if the drive exists, etc. unless you need to have it in a certain place. This will allow the user to save it wherever he/she wants to.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.