Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

Codeless

...it just goes on and on.

Posted

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?

Codeless

...it just goes on and on.

  • Moderators
Posted

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)

Visit...Bassic Software
Posted

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.

Codeless

...it just goes on and on.

Posted
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.

Codeless

...it just goes on and on.

Posted

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.

Codeless

...it just goes on and on.

  • *Gurus*
Posted
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.
Posted
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.

Codeless

...it just goes on and on.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...