Codeless Posted February 21, 2003 Posted February 21, 2003 When I run a shell command from my web project (say with a button click from a web page) like... Shell("c:\myapp.exe", AppWinStyle.NormalFocus, False) The window never comes up, even though I can see that the process is running on Task Manager. AppActivate doesn't seem to help either. Is this a Windows function only? Quote Codeless ...it just goes on and on.
Moderators Robby Posted February 22, 2003 Moderators Posted February 22, 2003 You can simply provide the link (path) to the exe on the server in an <a href>. (it can be contained in a Label or Hyperlink control) Quote Visit...Bassic Software
Codeless Posted February 24, 2003 Author Posted February 24, 2003 Thanks I think that will work ok for what I am doing, but what is the syntax for sending it a parameter? For example if I have a filename on my webpage in a text or combo box that I want to load into the executable, what would be the syntax? The following doesn't seem to work. <a href=c:\WINNT\notepad.exe myfile.txt> As another side note I also found the process.start method which also seems to work fine in a windows app, but not a web app. Why would this be the case since isn't it all just VB anyway? Quote Codeless ...it just goes on and on.
Moderators Robby Posted February 24, 2003 Moderators Posted February 24, 2003 process.start works fine for me on a web page. What does you code look like? Instead of this...<a href=c:\WINNT\notepad.exe myfile.txt> You should do this...<a href='../myFolder/myfile.txt'> (this would be the location of the text file on the server) Quote Visit...Bassic Software
Codeless Posted February 24, 2003 Author Posted February 24, 2003 Looks like this... Dim myproc as System.Diagnostics.Process myproc=New System.Diagnostics.Process() myproc.Start("c:\WINNT\notepad.exe", "c:\testfile.config") When executed I can see a notepad process running but I can't see the window anywhere. Quote Codeless ...it just goes on and on.
Codeless Posted February 24, 2003 Author Posted February 24, 2003 I guess I should also explain that the executable that I will ultimately be running is not notepad. I have an executable that was created in VB6 that I don't want to convert to .NET because it works just fine as it is. I just have to pass it a parameter that comes from a selection on the web page which will then do some other processing on the server directories. Thanks for the help. Quote Codeless ...it just goes on and on.
Codeless Posted February 25, 2003 Author Posted February 25, 2003 Anyone want to venture even a guess? Been dealing with this for 3 days now. Latest thing I tried was to impersonate the admin user while running the web and no avail. I can still see the process is running, but can't see the window. Very strange... I've tried it using a windows app, and it works flawlessly. Quote Codeless ...it just goes on and on.
*Gurus* Derek Stone Posted February 25, 2003 *Gurus* Posted February 25, 2003 Notepad, if launched from an ASP.NET page will run under IIS' local user account, meaning that you won't see any windows or be able to communicate to the process from the account you're currently logged into. Windows will be displayed on the desktop associated with that account, not your desktop. The only indication you'll see is the process details in Task Manager, since all processes on the local system are displayed there, regardless of the user account they're running under. Quote Posting Guidelines
Codeless Posted February 26, 2003 Author Posted February 26, 2003 Thank, that makes complete sense to me now. That is a whole paradigm shift for me. I come from a background of VB6 and have never done any ASP. Now that I'm programming ASP.NET, and the look and feel is that of classic VB6, it seems that everything should work the same as well. But alas I have to keep in mind that I'm not programming apps anymore, but web sites and web services. Which for me is a whole new concept. Thanks for your patience. I'll get there. Quote Codeless ...it just goes on and on.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.